Flickering LED's

Jblight32
Posts: 22
Joined: Fri Jun 16, 2023 4:54 pm

Flickering LED's

Postby Jblight32 » Fri Mar 28, 2025 4:52 pm

I am trying to get WS2812 LED strips to work with the ESP32 but it keeps flickering like crazy.
The ESP32-Wroom, ESP32-S, ESP32-U all do the same thing, the LED's flicker different colors and brightness when they should be solid.
I am trying to test with only 15 LED's powered by 5vdc 1amp. The color order is correct. Software is WLED.

I have tried pins 2, 12, 16 and 17, all with the same results.
The WS2812 LED's are powered by 5vdc which also powers the ESP32.
I can connect to the WLED software via web browser just fine and configure everything...
But Instead of a solid color, I get random flickering on and off, also it occasionally changes color and brightness.
This is with the ESP32 connected to the same 5vdc that powers the WS2812 LED strip and the output pin directly connected to the LED strip.

I thought maybe it needed a level converter, so I tried using a TXS0108E Level Shifter as well as a simple transistor base level shifter to boost the 3.3v signal to 5vdc, but the flickering gets even worse.

Please help!

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: Flickering LED's

Postby ahsrabrifat » Sat Mar 29, 2025 3:17 pm

Did you try powering up the ESP32 and the WS2812 from two different power supplies? If not, try it. Do not forget to short the GNDs of the power supplies.

Jblight32
Posts: 22
Joined: Fri Jun 16, 2023 4:54 pm

Re: Flickering LED's

Postby Jblight32 » Sat Mar 29, 2025 3:49 pm

Yes I also tried the ESP32 on a 5v 1a and the WS2812 LED's on a 5v 6a with the grounds tied together.
Its has something to do with the signal from the ESP32.

F1Andy
Posts: 3
Joined: Tue Mar 11, 2025 8:27 am

Re: Flickering LED's

Postby F1Andy » Mon Mar 31, 2025 3:38 pm

Do you have decoupling capacitors on the LED supplies? If not, they will behave strangely.

Also make sure the signal wire to the LEDs is quite short. (A resistor near the ESP32 in line (try 100R) with the data to the LEDs can reduce 'ringing' of the data being sent to the LEDs.)

Jblight32
Posts: 22
Joined: Fri Jun 16, 2023 4:54 pm

Re: Flickering LED's

Postby Jblight32 » Sun Apr 06, 2025 9:45 pm

I'm running two LED strips, each 32 led's, one line is only 6" and the other is 24" from the ESP32.
I added a 370ohm resistor and it seems to be stable.
Im curious what you mean by decoupling capacitors, I have a 1,000uf on the 5v across the power supply.
Is this what you mean or am I missing something?
Thanks

eriksl
Posts: 199
Joined: Thu Dec 14, 2023 3:23 pm
Location: Netherlands

Re: Flickering LED's

Postby eriksl » Wed Apr 23, 2025 7:12 am

One thing you may or may not be aware of. The WS (and similar) LED's generate their own PWM signal. IIRC it's something in the 150 Hz or higher, so you won't see it flickering. So anything you do on the ESP (software or hardware) cannot be the source of an issue there.

But the WS's may be sensitive to certain issues regarding power supply and signal levels.

First check these two things:

- is the voltage supply 5 V? They cannot run on 3.3 V (although 4.5 V works, is my experience).
- is the control line 5 V? The control line should be the same voltage as the power supply. So it can't run on 3.3 V either.

What I usually do, because I have them in the circuit already for other pruposes, is to use a mosfet gate driver and run the gate driver on 5 V. So you get 3.3 V in, 5 V out. Which happens to be very low impedance as well, which is great for keeping out noise and interference, especially at longer distances. Otherwise you will have to use a circuit to boost the voltage. This can be done with a transistor (but it will invert the signal, so you will need to set the output on the ESP32 to "inverted") or use two transistors.

Also I've found that they're quite sensitive to power supply variation, especially short down or up spikes, which can happen when one or more leds are turned on. As the control line is measured against the supply voltage and GND, it may lead to a false interpretation of the signal line and your led may go into all sorts of random colours. The solution for this is, I found, to add small, fast capacitors between the power supply line and GND at regular intervals. Something like 100 - 500 nF. You may need to experiment what works best.

Who is online

Users browsing this forum: Baidu [Spider], ChatGPT-User and 8 guests