Go Down

Topic: WS2812b and logic level shifters... (Read 4202 times) previous topic - next topic

sblantipodi

Jan 29, 2019, 03:51 pm Last Edit: Jan 29, 2019, 03:52 pm by sblantipodi
Hi all,
everyone seems to agree that the best logic level shifter for WS2812B is the Texas Instruments 74HCT245 and similar.

I am using a Mosfet based logic level converter like this:

https://www.sparkfun.com/products/12009


and on a circuit like this:


where there is:
1) ESP8266 on a D1 mini lite board (powered via PC USB)
2) 1000uf 16V capacitor
3) 220ohm resistor
4) 95 LEDs WS2812B 5V
5) External power supply for LEDs

this configuration seems to work perfectly, I'm using it since many days as a PC Ambilight and I am not experiencing visible problems but...

... should I upgrade my logic level shifter from the sparkfun to the Texas INstruments?

I'm asking it because I don't want to solder a new circuit, now it works and I would like to leave it as it is.

Will I have some cons in using this circuit with that logic level converter for a long time?

What is the disadvantages of using a LLC like the sparkfun if it works ok?

Can you explain me why the Texas Instruments it's better?

I'm asking it even because I want to learn something.

Thanks :)

PaulRB

#1
Jan 29, 2019, 04:50 pm Last Edit: Jan 29, 2019, 05:00 pm by PaulRB
My experience so far has been that ws2812 leds can be driven directly by a 3.3V Arduino such as Wemos mini. I may well just have been lucky so far.

But with ws2811 chips and "clones" like GS1903/TM1903, when using a 3.3V Arduino, level converters have been needed.

I also found that the LLC modules designed for i2c bus lines worked with ws2811. However, the circuit was not very stable. Touching the LLC module with my fingers would cause the data signal to the led strip to be unreadable and the strip would start to flash and change colour randomly. Taking my finger away, everything started working normally again.

My theory as to why the LLC modules are unstable is that they don't switch fast enough. i2c signals switch at 100KHz, although they can also optionally be 400MHz on most Arduino. ws2811 signals switch at 400KHz and ws2812 at 800KHz.

With 74hc14 chip instead of the LLC, there was no instability. Touching the circuit did not affect the strip, which updated perfectly.

Grumpy_Mike

If you could look at the signal with an oscilloscope you would instantly see the answer. Unfortunately while I do have an oscilloscope I use a much cheaper solution for I2C level shifting.

sblantipodi

really appreciate the answers guys. thanks...
you are always really clear.

My BTF-LIGHTING WS2812B does not work well if directly connected to the wemos d1 mini.
Sometimes commands are not received correctly.

With a "mosfet logic level shifter" it seems to work perfectly, never seen a command don't received correctly even with fast transitions.

may I say that if "it works don't fix it" or will I have some problems in the future due to the slow level shifting?

Grumpy_Mike

Quote
will I have some problems in the future due to the slow level shifting?
It is not the shifting that is slow it is the edges of the signal that could have a poor rise and fall time. If it affects anything, it will be with getting the signal into the first LED. After that, the signal is regenerated by every LED it passes through.

Paul__B

everyone seems to agree that the best logic level shifter for WS2812B is the Texas Instruments 74HCT245 and similar.
Well, I don't know that "everyone" agrees in respect of the 74HCT245.  If it is the most readily (and cheaply) available, so be it but the 74HCT14 is simpler and has exactly the same effect.  And the 74HC14 will most likely do just as well and is the most readily available of all.

this configuration seems to work perfectly, I'm using it since many days as a PC Ambilight and I am not experiencing visible problems but...
... should I upgrade my logic level shifter from the sparkfun to the Texas Instruments?
I'm asking it because I don't want to solder a new circuit, now it works and I would like to leave it as it is.
Will I have some cons in using this circuit with that logic level converter for a long time?
Not sure.  There may be some ageing effect and a drift in parameters such as to cause it to be unreliable.  Changes in supply voltage may affect it.

Can you explain me why the Texas Instruments it's better?
Because it does the job of level translation correctly with no room for error.  That's all.

My experience so far has been that ws2812 LEDs can be driven directly by a 3.3V Arduino such as WeMOS mini. I may well just have been lucky so far.
Well, if it were not reliable, it will cause trouble with all the WeMOS WS2812 indicator "shields" because that is exactly how they are implemented.  (Mine works fine.  :smiley-lol: )

My theory as to why the LLC modules are unstable is that they don't switch fast enough. i2c signals switch at 100KHz, although they can also optionally be 400MHz on most Arduino. ws2811 signals switch at 400KHz and ws2812 at 800KHz.
400MHz?  I seriously doubt that.

Yes, that is exactly the problem.  They pull down just fine, but the pull-up is merely a resistor.  A lower value can be fitted within the ESP8266 capability to drive it.

sblantipodi

#6
Jan 30, 2019, 01:27 pm Last Edit: Jan 30, 2019, 01:28 pm by sblantipodi
I was able to connect the mosfet logic level shifter, is there a guide on how to connect the 74HC14 ?
will the 74HC14 fit on a breadboard or it is too small for a breadboard?

edit how can I know that I am buying an original Texas Instruments and not a clone that may work worse than my mosfet logic level shifter?

Grumpy_Mike

#7
Jan 30, 2019, 01:33 pm Last Edit: Jan 30, 2019, 01:34 pm by Grumpy_Mike
Quote
will the 74HC14 fit on a breadboard
Yes

Wire it like this:-

PaulRB

Quote
400MHz?  I seriously doubt that.
C'mon Paul, you know I meant 400KHz :)  It's not the first time I made that mistake. Perhaps I can blame it on the autocorrect...

sblantipodi

#9
Jan 30, 2019, 09:38 pm Last Edit: Jan 30, 2019, 09:39 pm by sblantipodi
Yes

Wire it like this:-

I'm not able to read that schema.
Is there a more simple one that says where to connect pins in an Easter and less technical way?

Something like the one I posted on the first post

Grumpy_Mike

Quote
I'm not able to read that schema.
This might help you:-
Reading a schematic
Reading a schematic

Colin's Lab video on reading a schematic
https://www.youtube.com/watch?v=9cps7Q_IrX0

DrAzzy

I'm not able to read that schema.
Is there a more simple one that says where to connect pins in an Easter and less technical way?

Something like the one I posted on the first post
The physical pin numbers are marked on the input and output of each element ;-)

Make sure to also connect power and ground (see the datasheet for full pinout)
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up