Neopixels occasionally flickering white

Hey all,

I have been using neopixels successfully in conjunction with the pi pico for a while now, however I’ve just started running into some problems. In my previous project I was doing a basic setup - one strip of 256 LEDs to one pin, external 5V DC supply, level shifter. Pretty much the most basic / vanilla setup you can do which is illustrated in this diagram (obviously pico instead of the PI, but you get the idea):

So far, so good. Next I’ve been attempting something slightly more complex by using three additional pins and the remaining channels on the level shifter, so now my circuit looks like this (please forgive the quality of this drawing):

(Also not each pixel strip is ~1m and contains 54 pixels, and each strip is connected to the pico by wires of 10cm, 1m, 1m, and 2m respectively)

As soon as I do this I start seeing one of the strips flashing a random LED pure white. Sometimes the whole strip will go white. Sometimes in between these extremes, so the effect seems unreliable / intermittent in terms of how badly the fault presents. If I then change my code to set the entire strip black, it won’t turn off (eventually it does, it’s like I have to send that signal a number of times and the strip eventually “steps down” to turn off). Coincidentally this strip is the one with the longest wires between the neopixels and the pico (2m, which the internet tells me is getting into bad territory but still acceptable).

Things I’ve tried:

  • Switching picos
  • Switching level shifters
  • Reordering the strips
  • Using two level shifters instead of one (ie 2 channels of each)

None of the above seem to make any real difference. Running each strip by itself is fine, as is two and three at a time. However the forth obviously reaches some threshold that I’m not aware of, and thus the issue presents.

I have read in some places (Adafruit forums) that adding capacitors across the + / - terminals smooths out any large current shift which could be the cause, or that noise on the signal line could be something to do with it.

Can anyone tell me definitively what might be wrong or other things I can try? Tempted to try the capacitor approach (written here for reference: Best Practices | Adafruit NeoPixel Überguide | Adafruit Learning System) they mention using 500–1000 µF or thereabouts.

Any help greatly appreciated, and thank you in advance!

1 Like

Hi James
The fact that 1, 2, 3 strips seem OK and adding a 4th upsets things all points to the old favourite. The power supply does not have enough grunt and is sagging with the 4th strip in circuit.

Try doubling the capacity of the 5V power supply. Like use a bigger one.
Cheers Bob
EDIT. Regarding suggestions in that link. All valid. The Cap suggested cross the 5V + and - negates the pumping effect due to switching larger currents through the wire inductance (yes a piece of wire HAS inductance, it does not have to be coiled) but you have to be careful as the total inductance will if too large will cause a large inrush current which the power supply has to accommodate. better to keep the wires shorter and larger (less inductance).

2 Likes

Thanks for the quick reply, Bob. Does this mean that 4 strips running in parallel totalling 216 leds is more power hungry than a single strip of 256 leds? I suppose in the latter example (I believe you helped me out there too) I was starting to loose current (leds that were white started going yellow) but no issue with data signal fouling up.

1 Like

Hi James

Yes. 4 times as much. In parallel you add the individual strip currents, in series the same current flows through all the LED but the total voltage DROP across the LEDs multiplies.

Yes this indicates not enough current.

The data line is voltage driven as compared with LEDs which are current driven and will stand a bit of voltage dropping (but not too much) without too much drama.
Cheers Bob

2 Likes

Ok excellent, thanks Bob that gives me something I can test pretty easily. Any suggestions on a power pack? Currently on 5v 4000ma, should I go up to 12v? I suppose I’ll have to step back down to power my pico.

1 Like

Hi James

Is that a power bank? There has been volumes written about this on this forum.

If so it is NOT a power supply. It might be rated at 4000mA but that is mA per hour and probably will only supply 1A or 2.1A at best. Also the 4000mAhr is quoted at the BATTERY (3.7V) and will be substantially less at 5V. these devices are primarily designed to provide several charges for a phone or similar when mains power is unavailable. NOT as a primary source.

My advice. Get yourself a power SUPPLY. One that will supply 3 to 5A or whatever current you need. You can stick with 5V but get some grunt and you will have a lot less heartache later.
Cheers Bob

I just re read your post above re 256 LED strip and am a bit confused. What exactly have you got. 256LEDs is 256LEDs no matter if it is 1 or 4 strips as each LED is effetely in parallel and it is the total number of LEDs that is of concern so I was incorrect when I said the power is 4 times. I thought you had 4 identical strips in which case 4 strips will be 4 times the number of LEDs so WILL be 4 times the power.
If this seems to be going in circles it is because it probably is.
Could you please clarify the statement

The short answer to this is NO. But earlier you implied that you had 4 identical strips so that means you progressively added more LEDs as you added strips. Parallel or series would not matter as in reality you are only adding LEDs.

My power requirement comments still apply.
Cheers Bob

1 Like

Hi Bob, thanks once again for your answers. Will clarify.

So my previous project was a single strip of 256 LEDs. This worked well with both a powerbank (standard usb phone power bank rated at 5v, 2.1A, 5000mah I believe) and power pack (5v, 4000ma). The results were essentially the same - LEDs behaving as you would expect save for some slight colour deviation towards the end of the strip as resistance increased. I deemed this acceptable for that project and worked around it.

This new project has less overall LEDs - 216 in total arranged in 4 strips of 54. Power is running is parallel and four gpio pins are now used instead of one as in the previous project.

I have tried the same power options as written above (bank and supply) and basically get the same result - occasional LEDs turning white or another colour when I bit-bang that strip’s pin. However the fault seems to vary - sometimes the whole strip will go white whereas sometimes only random LEDs on the strip will go white (when bitbanging in a while-loop this gives the impression the LEDs are twinkling).

if I had to guess it seems like my data signal is getting corrupted somewhere. I read that perhaps the power draw is causing some noise on the data line, which might explain why the fault only appears once I add the fourth strip. But then the overall power draw should be less than my first project which had a greater number of LEDs in total. Must be something to do with more strips running in parallel.

Also I perform my bitbangs for each strip and wait a second before doing the next one, the fault still appears.

Hopefully this clarifies a few things. Thanks once again!

1 Like

Hi James
That is a bit clearer.
The first thing that comes to mind is are the LEDs the same. There are LEDs and LEDs. just because one strip of 256 LEDs worked does not mean that 4 strips totalling 216 LEDs are going to work as the LEDs could be very different. Have you checked the spec sheet for the different strips. I believe that some at full brightness (very bright) chew up something like 60mA per LED. There are actually 3 LEDs in each (R, G, B) @ 20mA each. I am assuming the brightness control is PWM.

Even at a total of 20mA for each RGB LED producing White (6.6mA each) that would be a total current of nearly 4.5A for 216 LEDs.

So I stand by my original suggestion. Get yourself a power supply that you are sure will do the job. Work out what current you need (I would think about 4.5 to 5A), then double it. That way you are sure of where you are at and could safely expand a bit in the future.

When you have a large enough source and that is proved not to be the problem or a contributing factor you can start to look for more bogey men or gremlins.

Or if you have an oscilloscope (doubtful) you could look at the 5V supply and see if there was any sagging of voltage when all the LEDs are operated. But if your supply is not up to the task nothing will work. In all my years in the electronics business I found a very large percentage of problems originate with power supply.
Cheers Bob
As a matter of interest I have some XMAS lights in 3 strings with a total of about 460 LEDs. Very rarely all on at one and even then different colours (white is maximum required current). Powered with a MeanWell 5V @ 14A supply. Don’t have or anticipate having any power problems.

1 Like

Could this threshold be the total power available for GPIO pins in the Pico? The level shifters are just switches - they aren’t doing any driving. Do you have a figure for the load on each GPIO? I would expect this to be the logic drive for the first LED in the string, but all the documentation refers to the 5V supply, not the logic supply.

Have you tried the Adafruit suggestion of a 300-500 ohm resistor between the GPIO output and the first LED of each string?

1 Like

Hi James,

Interesting problem!

Another thing worth checking would be the continuity and reliability of each connection. In your initial wiring diagram you were using a breadboard - would it be possible to send through a link of the specific one you were using?

If its possible to connect everything directly to pins that would be another good troubleshooting step along with the excellent suggestions from Bob and Jeff!

Liam

1 Like

Thanks all for your suggestions / eyeballs so far.

@Liam im able to repro the fault with a breadboard and a pcb, so feels unlikely joins are the issue… just for further clarification my pcb has a pico and a level shifter soldered on, so testing on the breadboard is testing a different pico and level shifter (led strips are common in both tests, however rotating these still shows the fault). So starting to think it’s not immediately component / wiring related.

@Jeff105671 i haven’t tried this yet, no. Feels like resistor / cap / power packs are the lowest hanging fruit to test.

1 Like

Hi James,

Would it be possible to send through a photo of your full setup along with the code you are running?

I’ve run into the rapid blinking with overvoltage or a poor strip-strip or wire-strip connection while testing some joining methods.

We’ll get to the bottom of it!
Liam

Hi James

I don’t see why everyone is keen on pussyfooting around here. Do something logically. Reverse that order of things and start with the power. If this is not right NOTHING will work as I have stated above. Eliminate things one at a time and as the power source affects everything this would be the LOGICAL place to start.

If you insist on going in circles instead of approaching the problem in a structured manner I shall have to retire from this thread as I do have other things on my plate.
Cheers Bob

Thanks Bob. That list wasn’t necessarily in order, just reiterating on what I will check next and report back on.

The point is that part of it is working. Power does not seem likely.
“… flashing a random LED pure white”. White is all LEDs lit. A power problem is not likely to appear as failing to a case of higher power consumption.
“…If I then change my code to set the entire strip black, it won’t turn off”. A power problem would probably not manifest as a failure to turn off.

216 LEDS will require less power than 256, and wired in parallel instead of series means less voltage drop throughout.

One change in power that has occurred is the change from a single GPIO to multiple GPIOs. That seems to be the logical place to start looking.

1 Like

Hi Jeff

I thought all the LEDs on these strips were in parallel. At least the ones I purchased from Core are. So even when you connect multiple strips in “series” all the LEDs are effectively in parallel.

Think about it

If they were all in series 256 LEDs would require something like a supply of some 500V, not 5V.(allowing a nominal 2V drop per LED)

Cheers Bob

But OP is connecting the strips in parallel, not in series. The voltage drop for a strip of 256 LEDs is going to be greater than the voltage drop for separate strips of 54 LEDs. But if voltage drop was a problem it would have a greater effect on LEDs towards the end of the strip (whatever its length) and that is not what OP is seeing.

Hi Jeff
I don’t think we are talking voltage drop here. We are (or I am) considering the real possibility the power supply cannot supply enough current for 216 LEDs. My belief is it is not and until a more robust source is tried and the power source is definitely eliminated I will take a rest and let the circus continue.

Is it really that hard to try a supply capable of 5+A. I believe until that happens the fumbling in the dark will continue.

One of the supplies in use is stated as being good for 2.1A, the other one’s supply capability is unknown. Now at 20mA each LED that equates to 4.32A and it is a wonder the power bank or whatever does not shut down completely.

I stand by that statement and as the power supply is the heart of any system that is the first thing I check. I have had much success with this approach both in a workshop and out in the boondocks.
Cheers Bob

Update: After perusing some more literature online I found an issue in gituhb that just about matches the description of the issue I’m having. Their fix is to overclock the pico using:

machine.freq(270000000)

which seems to fix the issue pending further investigation. So I suppose now the question is, is this a good idea, what are the ramifications, exactly how much overclocking do I need to remove the problem, etc.

1 Like

Hi James,

If you are using the PIO code then the timing will be fine and you won’t have to overclock.

Did any of the fixes above work/show any yield?

1 Like