Must skip first 4 LEDs to avoid flickering

Hi All,
I am working on my first led project which currently includes 7 LED strips to be controlled with WLED.

After a hard time with flickering, I eventually found a way to make all of the effects work properly but I need to skip the first 4 LEDs of each strip which is unwanted. Is there any known reason for this? I read that one led ca be used as a level shifter but could not find any info about scenarios where multiple LEDs in a row are needed if this is the case.

The current hardware configurations is:

For practical reasons, the project is currently wired as follows and I am not sure if this might be a cause of the issue:

  • LED strip power directly from the PSU, about 60cm / 2’
  • 3 wire cable “A” 4m / 13’ : data lines for strips 5-6-7
  • 3 wire cable “B” 4m / 13’ : data lines for strips 1-2-3
  • 3 wire cable “C” 4m / 13’ : data line for strip 4 and 5V+GND for ESP32
    On a next stage each individual led strip will have its own 3 wire cable.

At first I had several flickering issues which I tried to solve based on all the suggestions I found online:

  • installing level shifters;
  • 47 Ohm resistor on data line at strip connection (only on strip n. 5 to be able to spot differences against the other strips. No difference found in my case);
  • 1000uF decoupling capacitor at line strip connection (as above, only on strip n. 5);
  • soldering on PCB instead of using breadboard as I suspected some loose connections here and there.

None of these had a visible effects on the issue, although I guess they improve the overall system reliability.
After further investigation on this configuration, I eventually found that the issue can be solved by adjusting the segment mapping in WLED skipping the first 4 LEDs of each strip by excluding them from each segment (not from the LED preferences configuration page where “Skip first LEDs:” is always 0).
Skipping less than 4 LEDs causes flickering on two or more strips on most of effects (those with a higher refresh rate although solid works but not always).

I would like to use the full length of the strip but, most of all, I am really curious about what’s going on in sight of future LED projects.

The current ESP32 pin layout and LED mapping is as follows:

Any clue? Thank you in advance and please let me know if I missed any relevant information!
G

Step 1 - read the KB Levelshifters page for recommended (and not recommended) devices.

Step 2 - get rid of the I2C shifters (see above for reasons why) and implement a proper levelshifter

Test again and move forward.

If you’re looking for a large# of data lines in the future, I’d consider going to a 74AHCT245 based shifter. That will give you 8 data lines in one package. Just remember to ground the unused inputs until you get to the point where your setup needs them.

2 Likes

Everything Divsys says, but if you are intent on a level shifter that is on a pcb this is a good option: Level Shifters - SN74AHCT125 (Pack of 4) – RGB 2 Go

2 Likes

Thank you all! Will try when I receive the parts and let you know.
G

Hi All,
Thanks again for the suggestions, I eventually installed the IC 74AHCT245N (I could not find the PCB version in my area). I followed the same schematics described in the link you provided
except for:

  • LED_Data_GND. I understood that with WS2812B is to be left floating to avoid damaging the LEDs (i.e. no short circuit to GND at the end of the strip);
  • the decoupling capacitor I had available is 100nF elecrolityc, not ceramic type. Not sure if this changes anything.
    As a result, this brought some improvement because the number of LEDs to be skipped decreased from 4 to 2 therefore this is surely a step in the right direction but not fully solved.

Before proceeding further, I decided to set everything up as close as possible to the final idea of the project therefore I re-wired the strips each with its 4 meters cable with 5V, GND and data, using the same cable I used before which is unshielded AWG22. I guess I learned too late that this cable type is not considered appropriate for my purpose.
ESP32 was powered directly from the PSU with 30 cm wiring.
Upon turning on, bad bad flickering. I took some readings (which I did not recorded in detail) which made the voltage drop due to the 4 meters cables evident. I therefore gradually increased (while measuring) the PSU output voltage to 6V (maximum) obtaining a stable result, at least with some effects, with no LEDs skipped at the beginning.

Then I took the following readings testing some effects:

With this wiring, ESP32 is powered directly from the PSU with a 30 cm cable with a step down in the middle to make sure that the voltage does not go beyond 5.5V to respect the specs of 74AHCT245N. (This is relevant to me because at a certain point I would like to use the sound reactive feature with INMP441 which requires 3.3V. It basically already works. Sometimes.).

From the above readings I see that, for the 56 LEDs strips, the power supply voltage is a bit beyond the data sheet. Is there any risk here? Except this, all the other values appear to me in order and within the specs.

Unless you notice/suggest something else, I suspect the issue remains on the data line only.

As a latest attempt, I doubled the data cables so that each strip has two parallel AWG22 cables. I understand this is basically a bad idea because, logically speaking, I expect that the same message can arrive not in sync after being splitted in the two lines, eventually messing up the result. By the way this improved the situation from “Flickering as hell” to constant flickering every 0,5 seconds about on 1 or 2 strips out of 7. At the moment, I have no appropriate cables to do this properly.
Is there any way to actually measure the voltage of a data line? Or is it a value to be taken for good from the level shifter specifications?
That being said, am I on the right direction in chaging the cables to AWG 18 or even 16 to solve this issue? Considering that the full project requires about 45 meters and the resulting cost of the cable (about EUR 70-80 in my area), I would like to be sure that I am spending money for a solid reason.

Also, these strips are the base for a light system to be used in a live music set situation, with all sorts of possible noises and hums going to the main and monitoring audio systems therefore any source of interference must be minimized or possibly nullified. Not sure if this is the case with LED strips or if any precautions should be taken to this end.
Thank you in advance for your support!
G

What do you mean by this? Are you saying that the negative ground terminal on your LED strip is not connected to anything? If so that will not work. You need a ground reference.

This needs to be ceramic.

1 Like

Thanks for your reply!
Regarding the grounding, I was referring to this schematics indicating “5V data for LEDs. Include separate GND line (best practice)” which still confuses me a bit:


Glad to confirm that in my project GND is connected to negative of the PSU :sweat_smile:.

Regarding the capacitor, in my toolbox I found some random ones marked 473 which I found to be 0.047uF. What if I connect two of them in parallel? This should be very close to the intended value. They look like this:

I guess the reason for ceramic instead of electrolytic is explained by the following from Digikey:
“If you require a substantial reservoir of energy, electrolytic capacitors are the way to go. For smaller tasks or high-frequency applications, ceramic capacitors are often more suitable.” Thanks for the hints!
G

That ground is more just indicating that you need common ground between the level shifter and the LEDs.

  • All DC grounds must be common. The LED’s power supply, LEDs, level shifter, Esp controller must share a common ground path. You don’t have to run directly from the ground of the level shifter to the LEDs. As long as all of your grounds are connected to one another generally you will be fine.

As far as the type of capacitor you are correct that ceramic ones react much faster and it’s placement is to filter out switching noise. Addressable LEDs operate at a high frequency, thus needing a capacitor that can also react at high speeds.

I don’t think running 2 of the same value in parallel is going to help and will not ‘up’ their value to .1uF. Actually the lower the value the higher the frequencies they will filter. As for if that 47nF will work, I can’t say as that is above what I know :slightly_smiling_face: Maybe someone like @divsys will chime in and provide a better idea/explanation.

If you have a selection of resistors available I would try putting one after the level shifters output to your LEDs. Test different values and see if any resolve the flickering. I would try 33Ω or something close to it. If it gets worse try some higher values like 62Ω or maybe 100Ω.

Switching from 22awg to 18awg likely will not do a whole lot for the data signal, but it would reduce the voltage drop of the power wires. If you are looking for a possible cheap wire source, try cutting up an outdoor extension cord. Often times you can find 16awg ones for a reasonable price.

1 Like

Thanks for above! I think we are very close to complete this part of this project and would like to share the developments for future reference of those like me who, waking up on a certain morning, decide out of nothing to begin dealing with LED strips and WLED :rofl:

I replaced the 0.100uF electrolytic capacitor with two 0.047uF ceramic capacitors in parallel which theoretically speaking should be 0.094uF, therefore very close to the 0.1uF (I was already approaching capacitors on pages like this: https://www.allaboutcircuits.com/textbook/direct-current/chpt-13/series-and-parallel-capacitors/). The result is now almost perfect except for presets with very high refresh rate which still suffer some flickering, therefore the spot light is still on the data transfer speed.

The preset I am using as a stress test is Fire 2012 with high cooldown setting. Considering its display result, to me this is apparently among the presets causing the largest flow of information on the data line.

I started thinking that perhaps two SN74AHCT125N would have worked better than one SN74AHCT245N (just because the workload would be split, although it might not make really sense) but I read only now the following specs of the two level shifters on Texas Instruments product page :sweat_smile::

  • SN74AHCT245N (8 channels): Balanced outputs, High speed (tpd 10-50ns), Positive input clamp diode
  • SN74AHCT125N (4 channels): Balanced outputs, Over-voltage tolerant inputs, Very high speed (tpd 5-10ns)

Therefore I mean to replace the current SN74AHCT245N with three SN74AHCT125N (the full project includes 9 LED strips + sound reactive with INMP441).

Again, regarding the ceramic capacitor, perhaps 1 capacitor has a better performance than 2 in parallel but, considering the above ICs specs which I think should have priority at this stage, I’ll postpone this replacement. In any case, this is required by both the ICs in question and, also for better design, I’ll get some 0.1uF and replace properly.

Edit to reply properly to Jinx who I thank again:

That ground is more just indicating that you need common ground between the level shifter and the LEDs.

I guess I took the schematic too literally :sweat_smile:

If you have a selection of resistors available I would try putting one after the level shifters output to your LEDs. Test different values and see if any resolve the flickering. I would try 33Ω or something close to it. If it gets worse try some higher values like 62Ω or maybe 100Ω.

I had already mounted a resistor of 47Ohm on one of the 116 LED strips but it did not help in my configuration. On the same one strip I installed a 1000uF decoupling capacitor as well to check for power issues against the other strips. I could and currently cannot spot any difference with the others but I am keen to set both resistance and capacitor on all of the strips on the final build having understood these make the system more reliable.

Switching from 22awg to 18awg likely will not do a whole lot for the data signal, but it would reduce the voltage drop of the power wires. If you are looking for a possible cheap wire source, try cutting up an outdoor extension cord. Often times you can find 16awg ones for a reasonable price.

This reassured me a lot :slight_smile: and brought me to focus on the other aspects which currently appear to be more practical, by the way I’ll remember this just in case.

I’ll take some time to solder everything back and revert.
Thanks for all the support! Naturally, any additional advice is greatly appreciated.
G

I don’t think using the 4 channel level shifters are going to change anything. I would try different resistor values. I would highly suggest trying 33Ohm. Most prebuilt controllers use 33 Ohm resistors, including the ones that cost hundreds of dollars (Kulp, Falcon, Etc…)

I have a 2,400 Pixel Mega tree running off of 6 outputs on an Esp32 using a SN74HCT245N level shifter (and 33 Ohm resistors) Plus a 7th port running a 90 pixel star and a 70 pixel spinner. There is never any flicker.

1 Like

Thank you very much! I tried the addition of the resistors as you suggested and this definitely solved the issue of my case! No more flickering regardless of the speed of animation, transition, mirror or reverse which all created some issues.

To recap the configuration changes and what I learned thanks to your advices:

  • use only recommended level shifters such as 74AHCT245N (at first, I had been using a not recommended one);
  • with 74AHCT245N, a ceramic capacitor must be used;
  • 33Ohm resistors at the beginning of the data line (just after the level shifter) do work. I read somewhere that it was better to place them at the beginning of the LED strip. I had one soldered like this on a single LED strip but I could not see any difference against the other strips which had no resistor at all.

Regarding cable thickness, I am currently using AWG 22 but I understood it might be unsafe therefore I am evaluating whether to switch to AWG 18. Safety first.

Bonus: never solder a INMP441 digital mic at °450 :sweat_smile:. I fried two of them learning only after some research that its data sheet clearly explains how sensible they are to temperature. I took my time to solder by setting soldering iron at °C 280 (the minimum at which it can melt solder and heat the pins for a minimum adherence) and waited 30 seconds between each point to let the heat dissipate. Soldered points are not nice but it worked immediately upon connection.

Issue solved, thank you so much for your support!
G

2 Likes