Weird issue using WS2812B with external power supply

I'm trying to turn on leds using esp32 powered using an external 5v power supply.

The issue I'm facing is that I can only (well, mostly only. more on that later) turn the leds without the power supply, connecting everything from the esp (3.3v,GND,Data).

when the power supply is connected, either with powering the esp via VIN, or only connecting the GNDs and powering it via usb, the leds won't turn on. Had it stopped here I would've assumed my circuit is simply wrong. Yet and that's where things get extremely weird, if I try to inject the data through the copper pads specifically after the third led, the leds will turn on.

I'm extremely confused hope someone will help me solve this mystery.

These are my circuits (obviously replacing the Arduino and 1.5V battery with Esp32 and 5V power supply):

Powering via power supply

Powering via usb connecting GND

An accurate hand drawn schematic is much more desirable than a completely bogus fritzy that requires much imagination to decipher.

How to make a schematic to post.

1 Like

The ws2812B requires a 5V supply and a 5V Din signal.
The esp only outputs 3.3V

Right. You need a level shifter between the 3.3V logic and the LED strip. That link has another link to a level-shifter chip.

But you only need to level-shift one data line and it can also be done with an opto-isolator or you can make a simple transistor circuit. A "standard" one-transistor level-shifter will invert the data so you'd have to invert it in software (before it's inverted-back by the transistor). An opto-isolator can be wired so it doesn't invert.

The 74AHCT125 is NOT a level shifter. See the data sheet.
Don't take everything you see on Adafruit as gospel.

Since the WS2812B has a high z on the data line

surely all that is needed is a high value pull-up resisitor to +5 to raise the output from the ESP32 above the minimum Vih?

@Onn - exactly which developemnet board are you using? ESP32 just names the chip not the board.

Maybe the one before is acting as a pull-up; or maybe the Vih threshold is just a bit less on that chip?

1 Like

First of all thanks!
I'll admit I've been mostly unfamiliar with most of the terms you've used, after a bit of googling I'm still not confident but I think I might understand a bit.

The amazon listing refers to it as ESP-WROOM-32 ESP-32S development board, on its back it calls itself DEVKIT V1.

Searched for the power table of the devkit, and while I'm not sure that I've landed on the correct datasheet as it seems to refer to the chip instead of the complete board, it seems like it should light up without a pull up resistor considering the table describing the WS2812B you've attached.

I still assume you are right though about the pull up resistor.

I believe the first three leds to be burned so they may act as a pull up resistor.
I'll try soon to connect the date line to a pull up resistor.

Once again thanks!

Voh for the ESP32 can not exceed Vdd (3.3V) without an external pull-up to a higher voltage than 3.3 (obviously) so it cant reach the minimum ViH for the LEDs (.7 * 5V = 3.5V)
but it just needs a slight raise.

I can provide you with a simple schematic that will do what you wamt if you wnat me to.

If you power the LEDs with 3V3 then give them a 3V3 signal it will work. Just been making a project that does that.

However if you want to make it powered from an external power supply you have to make that a 3V3 power supply, or have a 5V one with a buck converter.

:man_facepalming: I've read it as 0.7V not as 0.7* Vdd.

That would actually be really nice of you, from what I've gathered so far I've made this schematic:
Screenshot 2023-02-27 at 15.58.44

Honestly I have no idea about the value of the resistor.

Don't do that.
You will be applying 5V to a 3.3V output pin.

I`ve made few lamps with WS2812B leds, ESP32 and ESP8266, all works fine with 3V3.

Why is that a problem @jim-p ?

5V - 3.3V = 1.7V
1.7V 10 k = 170uA

Surely thats not a problem for a protection diode?

But OK a bigger resistor ( 47k 40uA) should still do.

Protection diode?

Certainly in the sense that it has a minimum VIH of 2V when powered by 5V it is a level shifter.

He is a beginner with electonics. My circuit is bullet proof for a beginner. He will neither damage his esp32 or the LED strip or burn out his power supply.
If he decides to connect more strips in the future he can do so with out worring about back powering of devices through the Protection diodes.

You sure of that?
Can that circuit work at 800KHz?

When the ESP pin is configurated as output, and the pin is HIGH, then the internal top mosfet is firmly connecting OUT to VCC. I doubt a high value pull up resistor will do much there.
Maybe someone with a scope could try.

A common trick is to power the first (sacrificial) LED from a lower voltage.
Say with a 1N4004 diode from 5volt and a load resistor to ground.
Leo..