Trying (On purpose) To make the Data fail from the ESP32

Happy Holidays everyone… I’m trying hard to Replicate a Data Signal issue on the ESP32 with WLED, I’m pretty new to this kind of thing, and normally don’t have an issue getting things wrong lol. As you will see, I’m struggling. Does anyone have any thought on why this is happening? Normally data issues happen after only a matter of feet! https://youtu.be/F-uSKGQz0Rc?si=aEtqv2ifHjE3TchB

If this is the owner (and even if it’s not) of the youtube video, you’ve highlighted one of the basic issues with “solving” flicker/data corruption issues.

Starting with idea that addressable LEDs are “magic” black boxes that we can talk to and get them to display all sorts of wonderful colours, we need some rules for these boxes:

  1. When we feed data into 1 box, anything more than data for exactly 1 box “overflows” into the next attached box (they’re “daisy-chained”). Our first box will only display the very last thing we sent it.

  2. In order to display the correct colours at the correct brightness we ask for, the box needs a 5V supply able to provide the current it needs.

  3. The protocol (“language”) to talk to our boxes consists of a set of 3 numbers each from 0-255 that tell the box what brightness to show each of the Red, Green, and Blue LEDs in the box. More importantly (perhaps even most importantly) than the value of each number, is the timing requirements of those numbers. They must be sent in a particular and precisely timed pattern. Furthermore our box is a digital device and the way it understands the 3 numbers is as a series of “1”'s and "0’s or bits. Since we need a set of 3 numbers from 0-255 which each need 8 bits, we’re sending 24 bits of tightly formatted pulses.

  4. There is a link between 2) and 3) in that our box needs to allow some margin of error in what corresponds to a “1” and “0”. Typically they’re made so that anything less than 0.3Vsupply is a 0 and anything more 0.7Vsupply is a 1

  5. When a box passes along the excess numbers we feed in, it does so by “regenerating” the numbers so that what it outputs, matches the required Vsupply0.3 and Vsupply0.7 levels

So our boxes need 2 import supplies to work properly:
A) Power supply with proper wiring
B) Data supply with proper wiring

For A) # 2) means we have to have proper power wiring to handle the total current for all the LEDs in our strip. Voltage drops happen on our power lines because of Ohm’s law and the resistance of our power wires (and the strip itself)

For B) #3 means we must worry about how the wiring affects the timing of our signal NOT the voltage drop. Voltage drop happens because of current flow through a resistor (our power wire). For the data line, the current required is typically <0.005A or effectively negligible. You can use a big wire for data if you like, but it doesn’t do much other than to waste money and/or act as an antenna for noise. The 3.3V output level from your ESP will arrive at the 1st LED at 3.3V regardless of whether you use 24AWG or 8AWG wire. What causes data corruption is distortion of the timing of those data pulses.

One way that our power lines can affect our data line (a little indirectly) is to effectively drop the absolute voltage we need for a “1”. If there’s a voltage drop in our power to the box so our 5V supply is only 4.6V, then box will still work. But because of spec 4) our box will only need to see a pulse up to 4.6V*.7=3.2V to recognize it as a 1. The box is probably only 92% as bright as it could be because of the drop, but the lowered input spec means that the normal unshifted ESP output is within the requirements of the box. That’s the basic principle of a “sacrificial pixel” or the poor man’s level shifter.

TLDR;
Your power drops will vastly skew your results.
Try your experiment with 2 power supplies:

1 - High current, a 3A USB charger is actually pretty light for 300 LEDs, but you could stick with that.
2 - lower/medium current supply powering only the ESP32, perhaps a basic 1A charger.

Wire the high current supply directly to the LEDs.
That way they have (at least at the start) the minimum possible voltage drop.
Wire the lower current supply directly to the ESP board and connect the board to the strip via a ground and data wire (of varying lengths) only. Do not join the two power wires, only ground.
That wire doesn’t need to be 18AWG, but it can be if you still have the originals.
Rerun your tests, especially at reduced brightness (which will minimize voltage drops).

Different environments can also have vastly different amounts of RF (noise) as well. Unless you have a lab environment to test in then there is the possibility of different results anyplace you do the test.

LED strips and chips are also not all created equal. You may even just have a first LED control chip that is more tolerant to things being out of spec.

A much better way to visually see how your long wire is changing things would be to use an oscilloscope.

Fantastic explanation, many thanks. It is my video, i was trying to create the issue so I could show “how to” wire a logic level shifter and show the difference it made. I wasn’t expecting the result i got. I was pretty much expecting it to fail almost right away.

Your explanation is very thorough, I will have to spend a little time going over it as i’m still pretty new to all this. Some of what I read makes sense, some not so much. I will grab a cup of coffee later and go over your message more thoroughly.

Many thanks again for taking the time to write such a detailed message.

Right now an Oscilloscope would be wasted on me. I have a hard enough time understanding a meter. lol. Thank you though for you input Jinx.