Alpaca69
Posts: 5
Joined: Thu Nov 07, 2019 6:17 pm

WS2812 with or with out logic level shifter?

Thu Dec 05, 2019 6:47 pm

I am trying to make a project using some LED strips(WS2812) that is 1 meter with 60 LEDs. I have seen multiple diagrams over how to wire it up but i am a bit confused. Some suggets having a logic level shifter, for not frying the pi accidentaly. :shock: . I have 5V 2A power supply to drive the strip.
What guide to follow?
https://www.google.com/search?https://t ... ed-strips/
or
https://core-electronics.com.au/tutoria ... guide.html

so what is the correct way to do it? can anyone help me out.

mattmiller
Posts: 2236
Joined: Thu Feb 05, 2015 11:25 pm

Re: WS2812 with or with out logic level shifter?

Thu Dec 05, 2019 10:12 pm

Got zillions of WS2812 connected to millions of Pi - never used a level converter

(Might have slightly exaggerated the numbers)

mattmiller
Posts: 2236
Joined: Thu Feb 05, 2015 11:25 pm

Re: WS2812 with or with out logic level shifter?

Thu Dec 05, 2019 10:14 pm

But what I do do with long chains is power the 5V on strip directly from a hefty PSU and not try to drag several amps thru the Pi 5V pins

trejan
Posts: 1874
Joined: Tue Jul 02, 2019 2:28 pm

Re: WS2812 with or with out logic level shifter?

Thu Dec 05, 2019 10:28 pm

The level shifter isn't for protecting the Pi. It is because the serial data input on a 5V powered WS2812 isn't technically compatible with a 3.3V GPIO.

The WS2812 datasheet gives the voltage thresholds it considers to be input low and input high.

Input low is < 0.3 x Vdd.
Input high is > 0.7 x Vdd.

Most setups use 5V to power the WS2812 strings so input low is anything < 1.5V and input high is anything > 3.5V. The problem is that the Pi GPIOs operate at 3.3V so a high output is in the undefined region between input low and input high of the WS2812.

If you're doing this for your own personal projects then just try it without the level shifter and if it works then it is fine. However, if you're intending to sell this then you should do it properly. WorldSemi or one of their cloner may make changes to the internal circuitry that pushes the actual threshold up to 3.5V or just normal manufacturing variation affects it. They're still within the published specifications but suddenly your Pi won't work with a new batch of LEDs.

Return to “Other projects”