Logic Level Shifter and WS2812b LEDs

preview_player
Показать описание
Do you need a logic level shifter with your ESP controller and WS2812b LED strips? What happens if you omit it? Get both the true specs and see a real world test with and without the shifter.

Items shown in video:

(The above links are Amazon affiliate links. While it does not affect your pricing, this channel may earn a small commission if you make a purchase).

Wish to help support this channel and future projects? You can:

#ws2812b
#wled
#esp8266
Рекомендации по теме
Комментарии
Автор

Thank you for confirming my suspicions with this video. Been doing this for years but started using a thicker longer wire out of my control box and ran into the exact issue you showed in this video. I did not realize extra length on the led strip can cause this issue, always thought it was just the length from the first pixel. Ordered some logic level shifters. Thanks again for the thorough videos, learned a lot.

teedo
Автор

Awesome video . I learned something new. Logic level shifter needed only if you use data wire longer then 3 feet .

tiberiud
Автор

Thank you. That's exactly what my project needed. I was at my wits end :)

dfontanesi
Автор

The cable length from my controller to the first LED was going to be long enough that I decided I needed a level shifter when I began designing my system. But after looking into the reasons for the level shifter, I chose a different solution. The problem is NOT the ohmic loss of the cable, and it's not exactly the voltage min/max you reference from the data sheets, it's that the ESP is 3.3V and the output drive is weak. That leads to slow rise and fall times of the waveform. The serial signal is based on bit times, and different pulse widths for 1's and 0's. If the timing is too far off, the signal cannot be decoded properly. I chose to use a buffer IC from the 74HCT family. I used a 74HCT244, but a 74HCT125 or other buffers would do the same. The '244 has 8 buffers for less than 25 cents. Here's why the HCT family is a good choice for this problem. These parts are built to accept TTL inputs, but generate CMOS outputs. That means any input over 2.0V is considered a '1', and anything below 0.7V is considered a '0'. The CMOS outputs swing to almost VCC (5V) and almost GND. This gives a very nice output with 35ma drive. I checked the data stream with an oscilloscope, and get a MUCH better looking data stream from the output of the HCT device than the incoming signal. Many of the so-called "level shifter" products are little more than a pullup resistor. That works to a point, but it's just a band aid. To be a true level shifter, the circuit needs to have active devices that amplify the original signal.

wally
Автор

Great videos, I’ve got everything I need on order now. Wish me luck for my first of many installs 😊

CoastyCody
Автор

I once made an led cube with pl9823 (same voltage specs as ws281xx) it was all working fine until i poured it into resin. The led’s and esp32 where still working, but the data signal from the esp didn’t anymore. Moral of the story: USE LEVEL SHIFTERS!

MaltWhiskey
Автор

I had, 8 different setups using d1mini (8266) four on my parents house and four on mine. Everyone had between 8 to 10 feet of cable between the 5v PSU /d1mini and the start of the pixel strips, smallest amount of pixels on a D1 was 127, most amount was 230. Not had any issues at all. PSU used where all low 3amp units ( apart from the 150+ runs) .
I'm not saying don't use a shifter as it will fix issues. Just saying that your test is not a repeatable test as you say with different strip manufacturers and different cable you can get less than 6ft or even more than 19ft.

bikeuser
Автор

You replicated AND solved my problem. Thank you so much!

corvxnite
Автор

For the WS2812b you're misinterpreting the datasheet a little.
The Vih and Vil parameters refer to the minimum and maximum voltages that can be applied for the chip to reliably register a '1' or a '0'. So the 0.7VDD is the minimum voltage the chip needs to "see" to recognize a '1'.
The IO buffer inside the chip will have protection diodes from the pin to the VDD and GND rails. They will forward conduct with around 1V on them. So the maximum voltage on the pin before the diode conducts is around 6.5V (5.5V max + 1V diode). If you exceed that the diode will start clamping the voltage internal to the IC and will generate some heat in doing so. The purpose of the diode is mainly for dissipating static electricity from accidental pin touches.

In any electronic system you want to design the thing not to exceed maximums.

The reason a simple resistor can work is that it will limit the current that can flow into the pin with an excessive voltage. Whilst this will work, a level shifter is the proper way to do this job.

scaresandsparks
Автор

Wemos D1 Mini with logic level converter wired exactly as shown. Strip of 8 leds & powered on with a 10 amp supply and nothing. Unplug & plug back in the logic level converter and the strip lights up. Does work perfectly with an ESP32 or ESP8266, no need to unplug/plug back in. Have tried several LLC modules with same results.

jimcraig
Автор

it's interesting, for me 240pixel rings work on a 20-meter cable without any problems. On arduino (5V) I tested even at 100m and it worked as it should

worldexplorerPL
Автор

3 feet are 1 meter.
That means I can put 1 meter of cable between them and don't need a level shifter.
But at 2 meters I should use one.
Or I put a Neopixel directly behind the ESP and then long the cable.

jensschroder
Автор

I found the need of logic level shifter, by trial and error,
at first when I made simple colour changing batman logo(without wifi), it worked fine,
but when i started using wifi of wLed for custom effects on a seperate project using esp32 developer board it started flashing in random colours. That is when i decided, to use shifters and now i have made two projects one with ws2811 led and other with ws2812b.
both run for 4-5 hours daily.

highjack
Автор

Since this is data in one direction only I use a SN74AHCT125N chip instead.

brucehanson
Автор

I think Hiletgo changed the chips used in their shifters because they no longer work with the high speed needed for WLED. I bought some from your direct link and just tried them tonight. I made sure they were working with an oscilloscope and a program that would flash the D4 data line every 50ms and they worked great 3.4v went to 5.1v. However, when I put them on WLED it's signal is at 800Khz and they no longer boosted the signal both in and out were between 3.4v and 3.5v. If you want I can share the o-scope pics, but I think Hiletgo changed their chips without saying anything.

mikeboehk
Автор

even with these level shifters, the flickering wont stop. I used these cheap ones, then switched to those big IC with 4 outputs...nope..still flickers at 5 Meter data line...at last i just bought ws2812B single led breakout boards & used that..heck i am running 10 m long data line with no problems at all...dont go with these logic level bs...you might wanna use some resistors depending upon your placements with other lines..

ishdemon_
Автор

He listed the wrong logic level shifter.. That one is too slow for the 800 KHz data signal and very limited drive current.

Get one based off a 74LC1T34 instead

Ryne
Автор

I saved this video after watching it about eight months ago because I knew I would need it one day, and that day is now come.

What I'm not clear on is how you wire in the logic level shifter to the ESP board. I have some D1 Minis like you have in this video. But I also have some 30-pin 8266 boards, and some ESP32 boards. Is it a good idea to install these logic level shifters with these larger boards as well? I bought about 20 of them after seeing this video months ago so I've got lots. I just don't know how to hook them up.

Verminator
Автор

I think this is my problem and solution. Are you powering the level shifter from the same power supply that drives the LEDs? Will try soon and report back. Thanks!

derekgodbout
Автор

For my testing I use my eyes.
I have a run of 1200 for 66' and another of 1600... I do have my controller less than 2 feet to first run, fuses and power injection of 4x and that is it.... and my colors are true at p910 as p1. I have nothing for the data .And that goes for candy cane also.
BUT.... since I am not an expert and believe in OVERKILL ... I am going to add these! :)

graphguy