Flickering LEDs when going from Teensy 4.1 to WS2812B LED strip (Or: how to boost a signal to 5V. No flickering with Arduino UNO R3)

Please help me with an issue with my Teensy 4.1 when trying to send a data signal to a WS2812B LED strip. I need to boost Teensy’s 3.3V data signal to 5V. I know that a lot has been written already on the subject but I could never see anything that would completely fix my issue. I highly thank you in advance for any help, I truly need it!


I want to send data signals from Teensy 4.1 to a WS2812B LED strip. When going directly from Teensy to the LED strip I’m experiencing flickering, at times pretty extreme. I don’t see any such flickering when using an Arduino UNO R3 microcontroller, which sends data signals in 5V format. That’s why I believe that my issue is because Teensy is sending signals in 3.3V, but the LED strip is expecting a 5V data signal.


To boost the data signal from 3.3V to 5V, I bought a 74AHCT125 bus buffer gate/level shifter. (Data sheet here: https://cdn.shopify.com/s/files/1/0176/3274/files/sn74ahct125.pdf?v=1591630400) I wired it up as shown in the diagram below: The 5V power supply connects to the LED strip. The 5V power supply’s positive side connects into the VCC pin of the bus buffer gate, and the bus buffer gate’s Ground pin connect to Ground. The bus buffer gate’s OE “gate” connects to Ground of the power supply. Teensy’s Ground pin connects to the Ground of the power supply. Teensy’s data pin 2 connects into the 1A pin of the bus buffer gate. The 1Y pin of the bus buffer gate connects to the LED strip.


What I am seeing is that the flickering occurs on the LED strip no matter whether I go from Teensy directly to the LED strip (3.3V) or whether I go through the bus buffer gate — the flickering stays the same. I used a multimeter and I can see that the “vanilla” data signal from the Teensy is 0.9V, but when going through the bus buffer gate, it appears as 1.6V. II assume this is a sign that the signal boosting seems to work? But it doesn’t seem to have any impact on the flickering data signal itself.


I have tried it also with Teensy pin 1; the result is the same. I also have tried another 74AHCT125; the result is again the same.


Would you be able to give me any pointers?
 

Attachments

  • schematic.jpg
    schematic.jpg
    145.2 KB · Views: 48
Hi Paul, me again. I believe that I had some wiring issues: while I still have some minor artefacts, these are much reduced now. I cannot reliably say what I changed; perhaps the way my cables are put into the breadboard, or a different USB port on my computer's mainboard. While I still have some minor artefacts, these can be pretty much ignored and they are probably also due to some transient wiring/electricity issues.

I'm truly grateful for your help.

Just out of interest, is the above wiring diagram I sent "correct"? Do you think this is the right way to go about boosting a data signal?
 
Wiring diagram looks ok.

Usually best to keep wires short between 5V power supply and LEDs, with other wires longer if needed. Diagram shows (or kinda implies) power supply near Teensy and the buffer chip. Or maybe the layout of the diagram is not meaningful? Just know the best way is short wires between power supply and LED.

On the software side, in Arduino IDE try opening File > Examples > WS2812Serial > FastLED_Cylon. It only works with certain pins, so you'll need to move the LED signal from pin 2 to pin 1. If this solves the flicker problem, best to copy this example. Better non-blocking driver also allows higher performance if your project grows to use more libraries or do complex animations.
 
Back
Top