1
\$\begingroup\$

Disclaimer: Not an EE, I just write code, so apologies if terms are wrong.

Video demo of my issue here !!epilepsy warning!!

My Setup

I have several strands of ALITOVE ws2811 12v leds connected in series that I'm using for christmas lights. A Raspberry Pi 4 Model B acting as the controller, running ws281x-python, is connected to the strip from GPIO 18 and GND. Then a 12v/5a power supply also connected to the strip. (Also tried using a variable dc power supply, same result.) Note: Connections from RPi and PS first go to some 3 pin connectors to make moving/installing everything easier. See diagram below. wiring diagram for raspberry pi, power strip, and led light strip

Problem

When running with 12v, the lights produce a flickering effect and change colors unexpectedly. Some observations I've found:

  • The entire strip flickers, not just ones at the end like other posts I found.
  • Reducing voltage down to 5v significantly reduces the flickering, but not entirely. The LEDs are 12v though.
  • Animations with more white increases the problem
  • The video contains 250 leds. When reducing it down to only 50, I don't see a difference in behavior.
  • If I leave it at 12v but kill the ws281x-python script, the lights look fine. It's only when instructions are sent to the lights that they mess up. Adding 1s delays between sending instructions shows that it doesn't flicker on it's own, but only when being sent commands. Demo video
  • I have replicated my exact setup with a second raspberry pi, power supply, and light strip and the problem persists, so I don't think it's specific to a piece of hardware.

My suspicion

As mentioned, I don't know electrical engineering very well. But based on the digging I've done, I suspect it's something to do with the data signal to the lights getting interference or something with the way I'm grounding things. I've checked and rechecked the connections to make sure they're secure but haven't found anything that fixes it.

What else can I possibly try to diagnose this? Any help would be greatly appreciated! TIA!

\$\endgroup\$
4
  • \$\begingroup\$ I'm guessing you don't have an oscilloscope to look at the data line? \$\endgroup\$
    – JYelton
    Commented Dec 1, 2022 at 23:18
  • \$\begingroup\$ @JYelton unfortunately no. I’ll ask around if anyone has one I can borrow though. \$\endgroup\$
    – Stephen
    Commented Dec 1, 2022 at 23:23
  • 1
    \$\begingroup\$ Do you have a level converter or are you driving 5v logic at 3.3v? \$\endgroup\$ Commented Dec 1, 2022 at 23:27
  • \$\begingroup\$ I am not using a level converter, nor did I know what that was until 20 minutes ago. Makes sense though. Ordered one and we’ll see. Feel free to make that an answer if you want and I’ll happily accept it if that turns out to be it! \$\endgroup\$
    – Stephen
    Commented Dec 2, 2022 at 0:55

1 Answer 1

2
\$\begingroup\$

The ws28xx addressable LEDs use 5v logic but your Pi uses 3.3v logic, so the signal voltage you're sending is too low. Often it'll work anyways with the lower voltage, but since you have no margin any noise will flip bits, which is probably what you're seeing.

A simple way to fix this is to put a silicon diode in series with +5v going to a single pixel right after (ideally on) the controlling microcontroller. Then run wires from that pixel to the strip. The reason this works is the pixels compare the input signal voltage to the supply voltage. If you drop the supply voltage to 4.3v using a diode, the logic high voltage is dropped too, making 3.3v work more reliably.

\$\endgroup\$
1
  • \$\begingroup\$ Amazing. Thank you for expanding your answer here with a "why" as well to help me understand it better. Makes perfect sense when you put it that way. I ended up just getting a logic level shifter off amazon and that did the trick, but I get why just using a single LED would work too. \$\endgroup\$
    – Stephen
    Commented Dec 2, 2022 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.