Neopixels flickering

I have a 12V Neopixel strip. I was connecting it to an external power source during development and put the ground wires together, which worked great. Now I want to put this in a box with just one power supply. I do have a tranformer from 7-20V to 5V.

The pixels are getting constant power and so does the ESP. (4.9V transformed)
However the Neopixels are 60% of the time in the right color and 40% of the time white (fastly flickering).

I did check the ground wire and it is connected properly. The weird thing is that it will sometimes work if you just put a measurement wire on the ground pin of the esp with nothing connected on the other end.

Here are my schematics:

Your MCU is 3.3V logic and your neopixels want 5V logic.
I'd use a level shifter

1 Like

My suggestion would be that you might have a corrupt data signal due to no capacitors

2 Likes

Note that in this context, a "level shifter" is a 74HCT14, not a "bidirectional level converter" from Aliexpress or such.

You wire two of the inverters in succession and ground the inputs of those unused.

2 Likes

That is possible. add 1000uF on the ledstrip. And i would add a 1N4001 (or 1N4007 whichever you have) between the power supply and the 7805 and put a 100uF on the 7805 Vin and GND. and a 10uF on the 5v rail.

74HCT04 does the trick just as well, power from the 5v rail.

Also if you intent to use WiFi, using a bit-banged method will not provide you with a stabile wifi connection, due to interrupts being turned off. Switch to Makuna Neopixelbus which has a DMA mode and which does provide stabile wifi.

1 Like

It’s min 0.7 VCC for high

1 Like

Which is just a little over 3.3v That is why it sometimes works on an ESP without a level-shifter, but sometimes not.

1 Like

Of course it does, but the "14" sharpens up the transitions "just in case", so if you are going to go and buy an IC to do the job, it might as well be the "14". :grin:

2 Likes

So I should put the capacitor between ground and 12V on the strip, correct? What exactly is a 1N4001 and what is a 7805?

Adding a resistor to the data wire as often recommended is contraproductive in this case as the power on the Data wire is too low, right?

Yes a big ass capacitor on the 12v Rail of the strip.
a 1N4001 is a multipurpose diode rated up to 100v the 1N4007 is it's 700v version, which is commonly used for rectifier bridges in mains power applications. They are easy to come by handle a fair amount of current and voltage. A 7805 is a 5v regulator which i thought you were using, anyway it looks a lot like the regulator in your drawing. 7805 comes in different packages, but the to-220 package that is in your drawing is the easiest, it handles the current demand of the ESP without any extra heatsink. It may not perform properly without capacitors on the output, but there is one on the D1, and for more stable power supply it is good to have an input capacitor, which you can separate with a diode from the rest of the 12v DC.

I do when i connect it straight to a MCU to protect the output pin. People will argue that it is to protect the strip, but as far as i can tell, the strip has a logical input, and the output should be protected against overcurrent or bounce.
The ledstrip should have the input protected against accidental 12v, cause that does break them.

Which brings me to something i realized after i turned of my laptop last night.

That applies to WS2812B's, which run ideally on 5v. (apparently they can run on something as low as 3.5v but i have yet to try that) 12v strip uses WS2811's which can run at a voltage of 12v as well (and probably something in between) as long as you increase the value of the current limiting resistor, from the 100R for 5v. Check the datasheet (or measure on the strip) for the 12v spec. The WS2811 handles 3 LED's in series at 12v, where for the RED there is another current limiting resistor (less voltage drop on those 3 reds.) Most strips have 2 0 Ohms resistors for the Green & Blue. So i would say the cutoff is really close the 3.3v anyway, and timing is very important.


This is what I have tried now. It seems to have no effect, keeps flickering. Did I connect them correctly?

The power converter I am using is this one:

just used 7805 because it was builtin to fritzing.

The micro-usb adaptor board is not needed. Just connect the 5V from the 7805 to the 5V pin on the wemos.

What is needed, to stop the flickering, is the level converter.

No. The Data wire is a signal wire, not a power wire. The current flowing in that wire is tiny. So the power is also tiny. That's not a problem. What's important is the voltage. The resistor will not reduce that voltage because the current is tiny. V=IR. I is tiny, so V (the voltage across the resistor) is also tiny.

What the resistor is for is to protect the Arduino/esp and the chip inside the first led in case the 5V power is connected before the 12V power. It also helps to filter out reflections of the data signal which bounce around at the speed of light in the wire like echoes. Those echoes can corrupt the original data signal. It's like railway station announcements where you cannot tell what the announcer is saying because of all the echoes.

why does it work when both are individually powered then?

I actually meant voltage not power. But thanks for your explanation on resistors, I was always a little bit confused about when they lower the voltage by what factor.

Luck. It was probably only just working, in terms of the signal levels from the esp being acceptable to the first chip on the led strip. Now it is only just not working. Any slight change could cause it to start or stop working right now. The level shifter will fix that, moving the signal away from the danger region into the safe region.

I run 124 neopixels with an ESP32. I stopped the flickering by using a separate regulator to supply the neopixel thingies.

thats what I did intially too, but I want to use just one wallplug so I used a 12V to 5V converter.

@PaulRB yeah that makes sense. I will see if I can get one of those level shifters.

Thanks!

EDIT: wow, I didn't know this stuff is so cheap, its all below 0.50€

What's that? Most components are cheap, but even so, share what you are thinking about buying so we can check it's the right component for the job.