If you’re running NeoPixel LED strips off a Teensy 3, maybe because you want to put 180 LEDs on a hat, then you need a level shifter. But which one? The NeoPixel data protocol is high speed and pretty harsh on timing requirements and I’ve had a bugger of a time getting reliable data from the Teensy to these strips. Hence I’ve tested a bunch of shifters. I tried a TXS-0102, TXB-0108, 74HCT245, PCA9306, and a MOSFET based shifter.
The Teensy outputs data at 3.3 Volt, the strips expect 5 Volts. Or rather, the strips might see 3.3 Volts as a digital 1 or they might not. If you want some reliability, then you’re better off shifting the Voltage level up to 5.
Each LED reads the data it needs and passes on the rest, regenerating the signal to nice square pulses, so there is no decline in signal quality along the strip. Well, that’s the theory. In reality, all sorts of weird failure modes can happen.
Anyway, short conclusion from this testing is: use a TXS-0102 shifter if you’re tight on space and running one or two strips, use a 74HCT245 if you’re not or you are running three to eight strips. The 74HCT245 was the only shifter to give perfect performance, everything else had some kind of problem.
Test set-up is as simple as I can manage; DC wall power, Teensy 3.0, shifter, and short wires to a 36 LED length of 60 per metre black NeoPixel strip. These use the WS2812B LEDs and seem more sensitive than the other NeoPixel strips. I’ve been referring to this particular test strip as the grumpy strip, coz it seems very touchy, throwing its toys if there are poor connections, poor Voltages, bad data timing, or the phase of the moon is wrong.
DSS Circuits have a dinky TXS-0102 based shifter. Small, autodetects direction and only US$ 3. Good square pulses and simple to wire up.
This gave some flickering on the first LED, but the rest of the test pattern displayed fine. It didn’t flicker when I tried it with several different white test strip.
The TXB0108 based shifter from Adafruit handles eight lines and auto-detects direction, so that’s one less pin to worry about. Scope pic looks good, but the first LED didn’t light at all. The rest were fine, which is odd, as good data is clearly coming out of the first LED, even if it isn’t responding to the data going in.
The 74HCT245 is recommended by people who know what they’re talking about. It was the only shifter I tested that didn’t have a problem with the grumpy strip, reproducing the test pattern perfectly. Good sharp edges and flat tops. There’s some ringing after the pulse edges, but that’s because this is the only shifter that I didn’t test on the breadboard. This was soldered into the Hat driver and pushing signals down a metre-long cable, hence the ringing.
It handles eight channels, if that’s what you need. Also, it’s DIP and has pins for setting the direction, hence it’s fairly large.
Sparkfun provide the PCA9306. I’ve used this successfully to run the 5 Volt I2C components in the Mitochondrion Mark 4. It’s great for I2C as it has pull-up resistors on the breakout board. However, it really can’t handle the 800 kHz signal here. Those leading edges are horrible. The strip didn’t like it either, just occasional flickers and nothing more.
Sparkfun also produce a MOSFET-based logic level converter. I’m sure it’s good for slower signals but it can’t cope with the NeoPixel data. The scope trace is crap and the LED strip produced nothing at all, not even a flicker.
So I hope that helps with your level shifting adventures.