WS2801 and ESP32 (Dev Kit V1)

I have been watching the project for a while now but only now am I attempting to get some WS2801 LED’s (62) working. Unfortunately I am not having much success. I have configured the following on my device and besides a few random flashes on the first few led’s I can’t seem to control anything. My question is are the Pin assignments in for WLED the same as the GPIO assignments for ESP32? (Pin 2 = GPIO02 and Pin1 = GPIO01) and are there specific pins I “should” be using?

“Pins” in wled refer to GPIO pins.

That is where you can enter the pin numbers you want to use.

Ws2801 can be susceptible to clock speed.
If you are using anything below 0.13-b4 you may need to reduce the clock speed from 10MHz.
You can do that by editing bus_wrapper.h and reompiling.

I was using release 0.12.0 and thought it might be a level shifting problem (3.3v → 5v) so i added a level shifter and that did not solve my problem. I then installed 0.13-b4 and things started to work as expected.
Thanks for the support.

1 Like

I am having some random flashing with a WS2801 led strip and none of the solutions I tried has fixed the issue, and after reading your comment I am thinking the clock speed might be the issue as I have the clock setting in slowest in the wled UI, how can I know what speed correspond to “slowest” and change it to a lower value to see if that fixes the issue?

Clock speed changes have long ago been “deprecated”.

What version of WLED are you running and on what hardware?

I am running WLED 0.14.0 build 2310130 in an ESP32.
I had to set the clock to Slow or Slowest for the led strip to work as any other option (Normal, Fast, Fastest) causes the led strip to display a wrong colour and not reach all the leds.

Do you have a levelshifter in place and what kind?

I tried adding a 4 channel IIC I2C Logic Level Converter Bi-Directional, connecting both Clock and Data to two of the channels of the levelshifter, and it actually made things slightly worst, with random colors appearing and led strip responding worse to actions (flickering and producing wrong colours/sequences randomly), and having also the same issues when changing the clock to Normal or higher in the WLED UI than without the levelshifter, so I removed the levelshifter.

I2C Levelshifters are known to be too slow/unreliable for addressable LEDs.
Would be worthwhile to try a 74AHCTxxx based shifter.

How old are these LEDs? I haven’t seen anything using an actual ws2801 recently (just my $.02).

The led strip is around 5 years old but apart from those random flashing (every 5-10 seconds) it is working fine and is able to match the tv colours when using Hyperhdr. I just think reducing the clock speed could fix the issue as it seems to be a bit better when moving from Slow to Slowest. If I could recompile wled with lower values I could see if I am able to get rid of the flashing.

Before I’d try a software fix, I’d make sure the hardware is correct.
If you’ve got any spare 5V pixels around, you could even try a “sacrificial pixel” shifter. Bit of a kludge, but guaranteed to be faster than the I2C style.

I already reduced the distance between the ESP32 and the led strip to less than 0.5m and enabled the option to skip the 1st led, but unfortunally it didn´t help. I agree that making sure hardware is correct is the first step but tbh I am getting out of ideas of what else to test in relation to hardware. At the same time my guest is the 5 values for clock in the wled UI (Slowest, slow, normal, fast, fastest) should be linked to some frequency (i.e. 10khz, 15khz, 20khz, 25khz and 30khz, I just made these up) that should be easy to modify in the wled code and recompile, is my understanding incorrect?

I would still try at least the sacrificial pixel levelshifter to get the ESP output up to the voltage specs of the LEDs. The short distance is OK, but won’t solve an inherent low signal issue.

Have you tried a different GPIO pin (16 is the current default)?
The other thing you might try is move up to 0.14.1-b3.

Honestly, flashes that happen that infrequently are not likely to be due to a mis-timing in the underlying WS2801 protocol.

But as the distance between the ESP32 and the led strip is so short, am I not already doing the sacrificial pixel levelshifter when I enable the option to skip the 1st led in the wled UI?

Another test I did is to skip the first 100 leds in wled (son only 18 leds should turn on) and the random flashing still happens within the first 100 leds. This random flashing doesn´t happen when I turn off wled (even the ESP32 and the led strip are still receiving power), so the issue only happens when wled send data (not sure if wled send clock info when is off though).

I already tried different GPIO pins (the WS2801 requires 2 pins, one for clock and another one for data, being the GPIO 01 and 02 the defaults, which I swapped in my ESP32 to do another test, so I am using now GPIO 01 for data and GPIO 02 for clock).

Sorry, I had the wrong basic LED protocol in my brain. I missed completely that you’re using CLK/Data style devices, my apologies

You can still try different GPIOs (say 16 & 22 for Clock and Data) to try and get away from the lower GPIOs which can have other things happening on them as a side effect.

As well, it would be worthwhile to get up to V0.14.1-b3, bunch of changes there for stability.
It might even be worth a try to back down to V0.13-3, that seems to be a mainstay of stability for some.

The levelshifter comments still stand (even more so with WS2801 style devices) and especially the speed issues with I2C style shifters. You want a 74AHCTxxx shifter so you can use 2 channels one for CLK and the other for data.

@divsys I think I finally found the source of the issue!! and you were right, it was a hardware issue.
I have just done a test using a different 5V power supply (a phone charger) and the issue is gone, so it seems the power supply is creating the issue by producing unstable voltage I guess, I will try adding a big capacitor to the output of the power supply to see if that fix the issue before replacing the power supply

Glad to hear you’ve got it figured out!

Just get a proper power supply, and/or get a separate supply for the ESP32 board.
Best practice is to isolate at least the power wiring for the ESP from the LEDs and at best the entire power supply.

The capacitor on the strip thing has always been a Kludge at best.
A proper power supply and wiring is the correct solution for power problems.

BTW - a good source for a higher power 5V supply is an old PC power supply.
Klunky, but very effective and will let you see what your setup can look like with clean power.