Level Shifting for HD108 and SK9822 LED Strips (And Older APA102, HD107)

NewLinuxFan

Well-known member
I'm a bit sad that the Prop Shield LC is discontinued and the full Prop Shield is out of stock, though I have to admit I've never used the amplifier, memory, or motion features, just the level shifter for SPI-based LED strips. I'm wondering if anybody has used the Sparkfun level converters for LED strips? My understanding is that the ones with discrete FET's are too slow, but the ones with IC chips should be fast enough? These say bi-directional, but I would only be using them 1-way. Hopefully they don't accidentally send a signal back to the Teensy pins when the MOSI line goes idle.



In theory, this one could use all 3 of the Teensy 4.1's SPI outputs by soldering to pads 49 and 50 on the bottom of the Teensy.
 
I would only be using them 1-way.
So you only need 3.3v ->5v conversion? Pretty much any 5v logic chip will work for that, as long as it reads a 3.3v input as high (and doesn't have internal 5v pull-ups).
Bidirectional shifters are notoriously unreliable, TXBs are "ok" for 1:1 connections as long as there are no pull-up/pull-downs, TXSs is basically only usable for I2C.
 
Last edited:
So you only need 3.3v ->5v conversion? Pretty much any 5v logic chip will work for that, as long as it reads a 3.3v input as high (and doesn't have internal 5v pull-ups).
Bidirectional shifters are notoriously unreliable, TXBs are "ok" for 1:1 connections as long as there are no pull-up/pull-downs, TXSs is basically only usable for I2C.
Thanks for the tips. Seems like I could just put a couple 6N137's at the LED strip and send the signal over a decent distance for whatever the dataspeed is, with current-limiting resistors to send 5 or 10mA to the infrared LED's.
 
74HCTxx series will do the 3.3 -> 5.0V conversion reliably (74HCxx won't, according to the datasheet)
If you’re OK handling SOT23-6 parts, then my favourites are 74HCT2G34 (dual buffer), 74HCT2G04 (dual inverter) and 74HCT1G86 (single XOR, useful if you’re not sure if you need an inverted signal or not…).
 
This looks easy to use and fits into breadboards and common prototyping boards:
(It would be really nice to have a Teensy prototyping board with SMD pads connected to through-hole pads. Does that exist?) It probably works without resistors, but I imagine 20 ohm signal resistors would be a good idea. The OE pins could probably go high or low without a resistor I imagine since there's no need to connect to a Teensy pin for selection when the number of LED strips is fixed at 1 or 2.

In the Prop Shield schematic which uses SN74AHCT1G08 it shows a 1.0uF decoupling capacitor which is a bit higher than the common 0.1uF cap. Should I be using 1.0uF?
 
I haven't had problems with the higher data speeds of the APA102 or SK6812 LEDs. My Infinity Mirror Clock has a string of 120 APA102 LEDs, updated 120 times a second. My Ring Clock has a strand of 276 APA102 LEDs and a second strand of 222 APA102 LEDs. The strand of 222 is updated 118 times a second.
I've always used the FastLED library, with short wires to the strips and no series resistors. The two projects I've mentioned used Teensy 3.2 processors clocked at 72 MHz. I have another project using three strands of SK6812 LEDs. The longest strand is only 60 LEDs, updated 32 times a second. I've used a Teensy 4.0 for that one, clocked at 150 MHz.
 
Because I often use Teensy to interface to SoCs, I keep some TI TXU0n0m, 74LVC1T45, and 74LVC8T245 voltage level translators in stock. Each side has their own supply (but share the same GND, these are not isolators), and you should add a 100nF supply bypass capacitor between each VCC and GND, but otherwise they're trivial to use.

For a single signal, I like TI SN74LVC1T45DBV or Diodes 74LVC1T45W6, in SOT23-6/SC-74 or SOT-26-6/SC-74R package, with 0.95mm pitch. It is small, but still hand-solderable. For 3.3V to 5V translation these can do over 400 Mbit/s (400 MHz clock), and for stuff like these LEDs that need V(ih) ≥ 3.8V, they can drive up to 32mA loads from 4.5V-5.5V supply. Little beasties.

When I have a single signal wire, I can hack up a translator by using the '1T45 is the B-to-A orientation, in flying bug style without a PCB. The two middle legs are connected together (pushing them flat to the package bottom side) and to the shared ground. On the other side (topside), I stick a 100nF X7R in 0603, and connect it between VCCA and GND. After soldering the five wires (VCCA or output voltage, VCCB or input voltage, GND, B/input, and A/output), I put heatshrink over each individual wire solder joint covering the leg as well, and then over everything a bigger piece, so that things stay put. It becomes just a nice little heatshrunk clump that is easy to handle with five wires poking out, and no PCB needed.

If you do want a PCB, I have one in CC0-1.0/Public Domain at OSHWLab for easy manufacturing at JLCPCB or other PCB manufacturers. Do note that it is tiny, under 8mm×6mm, but still intended to be hand-solderable.

Mouser will happily sell 25 of 74LVC1T45W6-7 for under 2€ total, and I like to use Samsung CL10B104KA8NFNC as the 100nF supply bypass capacitors, which Mouser will sell in strips of a hundred for slightly over 1€ total. These are Dirt Cheap, in other words; jellybean stuff.
 
Last edited:
Thanks for all the tips. The through-hole IC I found works great. However, I can't get the SPI2 data or clock signals from pads 49 and 50 on the bottom (photo includes hot glue for strain relief). The same test code works fine for SPI and SPI1. Any ideas? The oscilloscope shows nothing. I could understand the yellow wire touching another pad but not the green wire.
 

Attachments

  • IMG_20260407_171159329_HDR.jpg
    IMG_20260407_171159329_HDR.jpg
    574.8 KB · Views: 13
Got it working! Just needed this:
SPI2.setSCK(49):
SPI2.setMOSI(50);

But it looks like I can't use the SD card slot at the same time?
 
Back
Top