Flicker goes away if I grab the wire

Hello, I’m using an esp32 to drive 3 independent strings of 12v ws2811 (i.e. 3 separate GPIO pins). One of the strands has a strange glitch/flicker problem that people mention here from time to time, and I noticed accidentally that if I just grab the data wire and hold it in my hand, the flickering stops. I’m hoping that that is a useful clue to someone who knows more about this than I do and can give me some suggestions to try. :slight_smile:

More info below, but thanks in advance to anyone who can suggest anything - I really appreciate it.

More details about my setup:

  • I have a 20A 12V power supply to power the lights as well as the esp32 via a 12V->5V converter. The ground from the power supply goes to the LEDs and the esp32 (i.e. I’m not using the ground from the 12V->5V converter) so I’m pretty sure everything is using a common ground
  • the GPIO pins are fed into a level shifter and then from there to the LED strings, and the distance from the level shifter to the first LED in the blinking string is less than a foot
  • before taking it all outside, I did a test and saw the flicker issue, but it went away when I reordered the pins in WLED (i.e. I still used the same pins, but just entered them in a different order in the UI - it seemed really strange at the time that it would have any effect, but since the problem went away, I moved on to other issues. In retrospect, I probably should have kept investigating I guess).
  • the strings are using GPIO 12, 13, and 14, though in my initial attempt to get rid of the flicker, it seemed to happen no matter which GPIO I used for the strand currently on 14.

As far as what to try next:

  • on Flickering issue on long run - #10 by Paulie there was a comment saying that any unused input pins should be tied to GND or +5V, which I’m not doing, so I’m going to try that next.
  • that same post shows a small 0.1uF cap between the GND and +V - I’m not sure what that’s for but I’m not doing it, so maybe I should try it? (making sure to use a ceramic cap)
  • Quadruple check that the grounds are the same, though at this point I’m pretty confident in them.
  • Hook up an oscilloscope to see if I can see the glitch happen.

Stuff I’m using:

That’s step one before anything else.

That’s step 2.

Bet you’ll be in good (or very much better) shape after those.

1 Like

shifter

1 Like

Thanks all, I finally got back to work on it, made the changes, and things seem to be working great. I tried it with and without the ceramic cap and didn’t notice any difference (but left it in there, just to be safe), so I guess the thing that fixed it was tying down the unused input pins.

I’d love to understand this better, so for my own education:

  1. Why do the unused pins cause problems? I kinda assumed that the 4 separate shifters inside the IC package would be isolated or something. I understand that the state of the unused shifter is undefined/random, but how does not explicitly enabling/disabling it cause interference, while just using that shifter would have been ok?

  2. What does the cap do? And what determines the size of the cap that’s needed?

Honestly I’m just thrilled to have this working - again, thank you!! - but I’d love to understand more too, so thanks for that as well!

Well, starting off when you assumed … (you know how the rest of that goes)

The 4 separate gates are logically isolated, unfortunately the real world means the physical and electrical connections can’t be ignored. Those gates all draw power from the same place and as well their internal wiring is very close together.

We like to say that the state of the input is “undefined” when left floating, but it’s really not.
The defined specs for Hi and Lo still apply whether we tie something to that pin or not.

When an input is left floating it can act as an antenna that picks up stray voltage and/or signals from you, the environment, what have you. Those signals may rise to the level(s) of causing the logic element to switch on and off and it may happen very quickly or at best very erratically. If you have 3 out of your 4 gates reacting with random and possibly high speed switching, it’s possible they actually “overrun” the switching specs of the device or generate unwanted crosstalk between the gates.

The net effect to you in the real world is that your clean WLED data stream gets all kinds of spurious noise injected and you see it as flicker.

The other thing that can happen is the power supply pin can get injected noise from all that switching and create a “dirty” power source. The 100nF ceramic cap placed close to the power pins will cover most of that problem.

Wow, that’s really interesting! Thank you so much for taking the time to help me learn, and for the detailed reply.

No problem, the logic side of electronics is pretty simple as the rules are - logical.

It’s when you try and implement in the real world that the fun begins.

Have fun with WLED and Merry Christmas! :christmas_tree:

1 Like