Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: Driving WS8212B from a Teensy 3.3V pin

  1. #1
    Senior Member
    Join Date
    Aug 2013
    Location
    Gothenburg, Sweden
    Posts
    295

    Driving WS8212B from a Teensy 3.3V pin

    Is it possible and safe to use a 5V tolerant output pin with a 100ohm series resistor and a 5k pullup to 5V to drive the signal input of a WS2812, the pin would be in OC output mode ?

  2. #2
    Sure. I am doing it now on my Teensy 3.1, for a string of 23 W2812's. I am not using a pullup, but am using a 100 ohm resistor on the drive line. The string is powered from a dedicated 5V supply, with the ground tied to the Teensy.

  3. #3
    Senior Member
    Join Date
    Jan 2013
    Posts
    184
    mlu: You didn't specify, but I assume you are using a Teensy 3.x or LC. If you just want to play with some "blinking lights" and are using short wires, then you can drive the pixels with only the Teensy's digital output. There is enough margin that it is likely "good enough".

    However, a more robust design would use a 3-to-5 volt level shifter, such as a 74HCT125, between the Teensy output and the LED pixels. These are readily available.

    The pull-up resistor also pulls up the output when Teensy is trying to output a logic low. This might cause as many problems at it solves.

    I believe that the 100 ohm resistor that you and Blitter are referring to is used to match the impedance of a "long" drive line and to somewhat protect the output of the Teensy in the case of shorts or static electricity. It isn't necessary for short wires.

  4. #4
    Senior Member
    Join Date
    Jan 2013
    Posts
    184
    Quote Originally Posted by mlu View Post
    the pin would be in OC output mode ?
    I re-read your original post and noticed your comment about Open Collector outputs. For driving any of the many RGB LED pixels, WS8212B based ones included, I suspect an O.C. output will not be fast enough and "square" enough. My suggestion is to use nothing when playing around and use a fast level shifter when you need a more robust solution.

  5. #5
    Senior Member
    Join Date
    Aug 2013
    Location
    Gothenburg, Sweden
    Posts
    295
    I will test with 3.3V and then a simple transistor buffer before ordering any more chips, the price is not a problem but the postage/freight charged by most suppliers makes me cringe.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,238
    Quote Originally Posted by mlu View Post
    Is it possible and safe to use a 5V tolerant output pin with a 100ohm series resistor and a 5k pullup to 5V to drive the signal input of a WS2812, the pin would be in OC output mode ?
    This might work.

    Then again, simply driving the WS2812B with a 3.3V signal might work too. A few years ago, it happened to work on pretty much all the WS2811 and WS2812s, even though the spec sheet says either 3.5V or 4.0V is the minimum for a guaranteed logic high. Yes, there are multiple datasheets, all in broken English, all of questionable accuracy, some with obvious errors in other places, so the true specs for these LEDs are a matter of some guesswork. About 2 years ago, some WS2812B started appearing on the market with definitely did not work with 3.3V signals while powered with 5V. They look exactly like the ones that can work with 3.3V, so there's really no way to tell other than testing.

    So I'd first recommend just trying regular 3.3V output, if for no other reason than learning if your LEDs happen to be ones that can work with 3.3V signals.

    The pullup with the pin in open collector mode might work. I'd recommend a 680 ohm or 1K resistor for the pullup, connected directly at the pin and to 5V. The pins are rated for 10 mA, so those resistors should be fine. The trouble with pullups is slow rise time, because the resistor has to charge the capacitance of the pin and wire. The WS2811 protocol depends on pulse width, so different rise and fall times will change the waveform shape, which directly corrupts the signal. Lower value resistors will give you faster rise time.

  7. #7
    I did connect a level buffer ic 74hct 245 no resistor, with 21 ucs1903 leds works great, connected it to 400 leds and a powersupply 5v the teensy now gets hot and does not respind anymore think i burned it how is that possible ?

    Can buy a new one but dont want to wreck another one

  8. #8
    Junior Member
    Join Date
    May 2018
    Posts
    4
    bumping an old thread but I have a similar issue : I'm sending data to the WS2812B from a 3.3V output (output 3 on my Teensy LC). The LEDs won't work until I add a 10k pullup resistor from pin 3 to 5V.
    Is it safe to do so or is there a risk that my Teensy might burn ?

    I tried to use pin 17 instead of pin 3 but with no luck so far.

  9. #9
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,583
    Pin 3 of the Teensy LC is not 5V tolerant. Pulling it up to 5V via a 10k resistor might damage the pin's internal protection diodes over the time. There is a specific 5V pin on the Teensy LC which is especially made for that. In order to use it, you'll have to send your DATA to pin17, but you'll have to connect your WS2812B to the buffered secondary pin17 which is on the short side of the Teensy PCB.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •