Is anyone aware of a way to prevent WS2812b strips from flashing white for a millisecond or less when they are first connected to power? Apparently a pull up or down resister on Din doesn’t do it…
Since I will never come close to having all LEDs on at full white in any project, I would never use a power supply capable of driving that (impossible to find for mobile applications anyway). So the problem is that the flash at power-on trips the fault protection on a lot of power supplies.
I imagine I could build a current limiting circuit with transistors, but I’d really rather not get too complicated.
Maybe a beefy capacitor in parallel with an inline relay on the power line? so that I could power the MCU and charge the capacitor, and then turn on the relay so that the jolt of high current draw can come from the capacitor discharging rather than entirely being drawn from the power supply?
Curious if anyone has solved this in an elegant way
I’m not aware of any elegant or reliable solution; I wonder if we can think of some hack-y ones that work most of the time.
A power capacitor may help with the brownout situation.
I wonder if there’s a way to exploit the fact that the nanocontrollers in each pixel may be able to “run” with fewer volts than the LEDs. E.g., suppose the pixel controllers “are live” at 1.8 volts but the LEDs themselves need 2.2v. If you could power the strip up first at 2.0 volts, then send 0x000000 to all the pixels, and then increase the voltage to 5.0v, maybe that would work. I’m not optimistic, but it’s an idea… albeit a bad one.
Cc: @Josh_Huber
@Mark_Kriegsman Thanks for idea, Mark. I understand that the crux of the situation is that, until a signal propagates through the entire array, the inputs of all of the LEDs are floating.
I guess an other hack-y solution is a band-aid and not a cure: put inline switches on the +5V (or ground) wire every few hundred pixels, and turn them on one by one, so that each initial jolt of high load still falls within the spec of the power supply’s peak output.
@chad_steinglass I think the people at WorldSemi could also force the WS28xx pixels to “boot up” all black, but that would entail a change to the silicon. I wonder if newer pixels like the APA102 always boot up all black.
I usually just add this as a part of the void setup, but that other quick flash turn on issue is more a power thing I think. I normally just extra ground and seems to solve the issue.
void setup() {
leds[0] = CRGB::Black;
FastLED.show();
delay(1000);
@Darren_Hedlund That’s always good move, but I think what @chad_steinglass is talking about is a flash in the LEDs just as they power on, before they’ve received any data. And that one is hard to control, maybe impossible just in software.
@Mark_Kriegsman In one of my current 140 pixel projects using APA102 I get random pixels lighting up when I first turn it on (before the Teensy finishes booting), so unfortunately I don’t think they boot up black. That would be really nice if they started up black.
@chad_steinglass I can’t find the post, but I remember someone else having similar issues on a wearable project and they ended up breaking things into 3 or 4 sections that could be manually switched on one at a time. (Was is @Juergen_Bruegl ?)
@Darren_Hedlund As Mark mentioned - basically the WS2812bs, before being powered up, have all of their inputs in some floating state. The instant power is supplied to a strip, before they receive any actual data signal, they display whatever they interpret that floating state to be, even if they aren’t attached to an MCU. This usually manifests in a barely perceptible flash of the LEDs, almost too fast to see…
But even though you can barely see it with your eyes, the instantaneous current draw is very real, and, with large circuits of LEDS, it trips the fault protection on a lot of my USB batteries, which automatically turn off because they interpret the spike in load as a short circuit.
For the time being I’ll plan on doing the sections separated by switches hack… but I’ll be keeping on the lookout for an other solution… I wonder if its a static electricity thing and if grounding the strip before powering it might help (which is kind of along the lines of Mark’s first suggestion of powering the logic part of the pixels to flush them out before powering the LEDS)
And @marmil - ha - might have been my first show off your work post Though I implemented it in a pretty bulky and jury-rigged manner, with lots of barrel jacks and separate USB plugs. I could definitely make it slicker with some nice inline switches.
Place a cap on the power lines of your LED strip. If you have a lot of pixels. Every 300ish should have a cap. That and a reliable power supply that can handle a peak output. Also you should look into a different supplier, i had these issues from a particular manufacturer only.
@chad_steinglass I use 1000uf any voltage above 5v. Take care to have a sufficient power supply that can handle powering up multiple caps in parallel. I reckon you have poorly manufactured strip. where did you get it?
@Leon_Yuhanov I’m using totally cheap strips from aliexpress. Almost everything I make Is really just an experiment for fun and to learn and get better, so I’m reluctant to spend more on the parts than I have to. I’ve been using the 60/m ws2812b strips mostly recently mainly because I can find those at the cheapest per pixel, usually less than $20 per 5m reel.
@chad_steinglass Are they from Way Wus store? or Another retailer? any chance you could post a photo of your strip? I’m certain this is a fab fault. I’ve seen it happen with both apa102 and ws2812 strips from certain suppliers.
@Leon_Yuhanov I usually buy my strips from BTF Lighting or HCSOYES I think. Can double check when I get home. Though I’m not too discerning… I just generally try to stock up when a store has a good price and free shipping - I HAVE run into matchin problems when mixing LEDs from two different batches jna single project. So I buy 10-15 reels if I need some and I find them for $17-18 a reel shipped
@marmil Jumping right in the middle of the discussion.
never use a relay due to additional voltage spikes caused by the coil.
If you want to switch power for the LEDs after the µC has booted you need a logic level PNP Mosfet. If you have a pin available to keep the Gate high you can use a “quick and dirty powerswitch” at the end of section 5 in this wiki: https://github.com/GyroGearloose/FASTLED-using-a-push-button-to-switch-entire-installations-ON-and-Off/wiki
With a few amps the mosfet will not get hot, just don’t mount it to ground.
In Section 3 you find suitable Mosfets from Adafruit and Sparkfun.
If you keep on having problems with Transition Voltages it is correct to use Capacitors. However, it is not sufficient just to use just one big cap, because big caps are slow. Small caps are much faster cutting the unwanted spikes. A good setup is:
Capacitors minimum 25V, better 35V or higher.
one large Cap with 470µF, then in parallel 10µF + 0.1µF + 10nF