What is the difference between the 74HCT245 and sparkfun's logic level converter?

visualSound

Well-known member
I'm still getting up to speed on making sense of schematic's and data sheets, so I'm having trouble understanding the difference between these two chips.

1) is the 74HCT245, mentioned as a must have for communicating with 5v led strips such as the neoPixels from the teensy.

2) is the "Bi-Directional Logic Level Converter" https://www.sparkfun.com/products/12009 from sparkfun.

I know they aren't the same exact thing, but I would like to understand how they differ and are they interchangeable in regards to communicating with led strips from a teensy?
They are a bit more practical in shape and size for use with out a breadboard.

Thanks!
 
This is the post that measured various logical level converters and found that the 74HCT245 was the only one to handle a a lot of WS2812 leds without problem. The TXS-0102 shifter appears to work for just a few leds, though there was one failure with a so-called grumpy strip. The two shifters from Sparkfun just cannot handle the 800 kHz signals that WS2812 lights generate: http://happyinmotion.com/?p=1247
 
Yeah I saw this post a few days ago, I was curious if it was as simple as one just not being compatible. Seems like it is!
I have a few of the 74HCT245's on the way.

Thanks for the confirmation!
 
I'm still getting up to speed on making sense of schematic's and data sheets, so I'm having trouble understanding the difference between these two chips.

1) is the 74HCT245, mentioned as a must have for communicating with 5v led strips such as the neoPixels from the teensy.

2) is the "Bi-Directional Logic Level Converter" https://www.sparkfun.com/products/12009 from sparkfun.

I know they aren't the same exact thing, but I would like to understand how they differ and are they interchangeable in regards to communicating with led strips from a teensy?
They are a bit more practical in shape and size for use with out a breadboard.

Thanks!

The Sparkfun product is a passive level shifter. It will be quite slow (especially on the rising edge fron a LV signal to a HV signal (the final pull up is 10k) -- delays coudl be in the 100's of ns range), and may not work well with widely varying votlages (such as 1.8 V to 5 V).

It is capable of converting LV to HV signals, and HV to LV signals.

The 74HCT245 is an active driver -- it converts from one level to the other and drives the line strongly; its delays will be in the 10's of ns only. You do need a control that sets which direction it is driving -- in the WS2812 case the signals are only from the Teensy to the LEDs, so this can be hard wired.
 
That's super helpful, thank you for explaining.

Do you know of any wiring diagrams or images that show how to set that up?
 
PJRC now sells a 74HCT245-based level shifter. It also has the 100 ohm series line matching resistors, and RJ-45 jacks to plug in CAT6 cable which exactly matches the 100 ohm resistors and offers excellent signal quality.

http://www.pjrc.com/store/octo28_adaptor.html

Of course, this circuitry is pretty simple, so you can certainly build your own. For a large LED project, I highly recommend you follow the wiring advice on that page, especially locating the power supplies as close as practical to the LEDs and use short, large diameter wires for the LED power. The Teensy ground and LED power ground should meet at or near the LED data input.
 
Those passive level converters, using a N-channel mosfet and 2 resistors, are really only good to use for I2C.

Their big weakness is the high level output on either side is only due to the weak pullup resistor, so the low-to-high output is very slow. Because high-to-low is much faster, they result in a distorted waveform output, which is terrible for WS2811 LEDs where the width of the pulses matters. They're unable to source any substantial current into a load, so troubleshooting by connecting a LED to "see" the signal causes trouble. Even just connecting extra wire to the output, especially when experimenting on a breadboard, can really alter the low-to-high speed.

Unfortunately, Adafruit, Sparkfun and others have sold that level convert circuit as a general purpose solution, which though it performs really well only with certain protocols like I2C. Adafruit revised their description a few month ago from an overly optimistic "good for everything" sales pitch to a much more conservative approach.

Likewise, the active bi-directional converters, like TXB0108, have often been promoted to hobbyists with overly optimistic descriptions. Those TXB0108 chips work similarly to the passive approach, except a circuit detects any unexpected change at the "output" and very briefly drives the other side high very strongly for a brief moment. Thereafter, the output voltage is maintained with only a weak pullup. The momentary strong drive solves the slow low-to-high transition. But the detection circuit is a ticking time bomb, ready to go off and cause incorrect behavior. Those TXB0108 tend to work well when the signals are on short wires between digital chips on the same circuit board. When driving long wires to LED strips, where huge changes in current also happen along shared ground paths, those drivers can easily become a liability.

A unidirectional buffer (or able to buffer with way, but hard-wired for the intended direction) is the right way to buffer WS2811 data signals. Since the first day I published OctoWS2811, the web page has recommended a 74HCT245 chip. It really is the right approach.
 
Wow, thanks for the break down Paul,

Yeah I will be investing in some of those adapters for the next project, right now I'm kind of keeping things small and getting educated on all this stuff as it's my first time playing with these led strips.

I ordered a dozen of the 74HCT245's, so I should be in much better standing when those arrive!

Thanks again!
 
A somewhat related question, is there a chip with less channels that would do the same job as the 74HCT245 ? I only need 2 channels...
thanks !
 
74HCT08 is a quad AND gate, which could be used for 4 channels.

It's slightly smaller and maybe slightly less expensive, but still pretty similar.
 
74HCT08 is a quad AND gate, which could be used for 4 channels.

It's slightly smaller and maybe slightly less expensive, but still pretty similar.

But that's not a level shifter -- it would be marginal with a 5 V WS2812 system and just 3.3 V from the Teensy.
 
Why would an AND gate not function as a level shifter?

It's got the same TTL level thresholds (worst case high > 2.0V, worst case low < 0.8V). The HCT08 output is specified at 4 mA currents instead of 6 mA, but it's still a true 5V push-pull drive that's plenty strong enough for a line (through a series termination resistor) to the LED strip.

Both chips have the same TTL level logic input circuit (a specific ratio of mosfet sizes: an oversized N-channel so the logic threshold is nominal 1.6 instead of 2.5), some logic inside the chip involving multiple inputs which ultimately turns on a mosfet transistors connected to the output pin. Even though the '245 is depicted as a pair of buffers, inside the chip is it certainly implemented as several logic gates based on the 3 input signals which create 2 internal logic signals that drive the 2 big mosfet transistors connected to the output pin.
 
And could something like an ULN2003 also work ? (I'm asking because I have a bunch of those chips around)
 
Why would an AND gate not function as a level shifter?

It's got the same TTL level thresholds (worst case high > 2.0V, worst case low < 0.8V). The HCT08 output is specified at 4 mA currents instead of 6 mA, but it's still a true 5V push-pull drive that's plenty strong enough for a line (through a series termination resistor) to the LED strip.

Both chips have the same TTL level logic input circuit (a specific ratio of mosfet sizes: an oversized N-channel so the logic threshold is nominal 1.6 instead of 2.5), some logic inside the chip involving multiple inputs which ultimately turns on a mosfet transistors connected to the output pin. Even though the '245 is depicted as a pair of buffers, inside the chip is it certainly implemented as several logic gates based on the 3 input signals which create 2 internal logic signals that drive the 2 big mosfet transistors connected to the output pin.

I apologize -- I Googled and checked the thresholds -- the NXP part ( http://www.nxp.com/documents/data_sheet/74HC_HCT08.pdf ) has the 74HC08 and 74HCT08 in the same data sheet, and I was looking at the HC version of the part. The HCT version does have a logic high threshold guaranteed at 2.0 V so it would work.

Note however (because of the way the input circuit works) it could consume an additional 250 uA per pin if the inputs are not rail-rail. This is current that would be consumed from the 5 V supply. It's probably not an issue in LED applications, but could be a concern in other cases.
 
A unidirectional buffer (or able to buffer with way, but hard-wired for the intended direction) is the right way to buffer WS2811 data signals. Since the first day I published OctoWS2811, the web page has recommended a 74HCT245 chip. It really is the right approach.


Very interesting post, Paul. I got the Sparkfun "logical level converter ", it did not work with Teensy 3.1, now I know why. Question: So the OctoWS2811 is unidirectional? I believe is hardwired A-to-B, or 3.3V to 5V, am I right? Which means it will let pass data from the micro-controller to the external device, but not the other way around, correct? How about if I want to have data both ways?

I just got the OctoWS2811, and together with Teensy 3.1 is working very well, I am working on some addressable LEDs Xmas lights project. I need to investigate a little more because I will use SPI addressable LEDs. I think I know how to solve this. I tested it with some WS2812.

By the way, is there anyway to get the OctoWS2811 schematic? Thank you.
 
Last edited:
Yes, OctoWS2811 is unidirectional.

In fact, as far as I know, ALL addressable LEDs use only unidirectional signals. Ok, I'm not including microcontrollers+LED products like ThingM, which uses I2C as I recall. But all the LEDs like WS2812B, APA102, LPD8806, WS2801, etc are only unidirectional. Even the ones which emulate DMX protocol are unidirectional.

If you want data both ways, first you need things that actually communicate both directions! Let's talk of this in terms of specific protocols or devices. Details matter.

Whatever you do, don't believe the maker myth that you can buy a cheap bidirectional level shifter as a universal solution to all 3 vs 5 volt interfacing needs. Especially the mosfet plus resistors circuit in of limited use, mainly only for I2C, and nearly useless for high speed communication!
 
Another thumbs up. I am using the CD74HCT245E to drive 12x5m of 12v ws2811 strips over 30 feet of cheap thermostat cable and it works great. This little chip solved a problem I have been having for some time. Also note - if you are running over very long distances you need to account for voltage drop. I am using 18ga with a starting voltage of 13v to end up around 12v at the strip. I will probably move to 16ga wire. Low voltage presents a lot like a degraded signal - so check!
 
I know this is a very old thread but i was wondering if the NXS0108-Q100 Dual supply translating transceiver; open drain;auto direction sensing. can be used when dealing with connections to an MCU and Sensors. I need this for level translating from 5 volt sensors to the Teensy 4.1.???? I just don't know if the one listed on this thread will work.
Please help very important!
Regards.
Marathonman
 
I'm using an 74LVT245AN to translate between +5V and +3.3V. Digikey has them in through hole and SMD packages. Adafruit has the through hole package. At the moment using, one to translate 5V DRO outputs to 3.3V so my Teensy 4.1 can read them. I need to do this for 7 inputs in my ELS system, so an octal is worthwhile for me.
 
So my original question need clarifying. The NXS0108-Q100 is open drain 3.3 to 5 volt Translator so can this be used for sensor communication to a Teensy 4.1. I am stuck in my design because of this. Any thoughts will be appreciated. And "NO" not any 245 can be used in this situation.

Regards,
Marathonman
 
Back
Top