Flashing on boot

Trying to figure out if I have things setup wrong, or if this is something else. I’m setting up a project that will be controlled with a standard wall switch, so flip the switch and power goes to a meanwell RS-15-5 which is providing power to both the D1 mini and the LEDs. Not using any level shifters, the distance to the LEDs is inches. I do have a 1000uF cap across the power and ground. Using RGBW leds.

When I flip the power on I either get the first LED blinking a green/yellow color, or the entire string blinking full white. Seems random on which one happens. I have nothing happening at boot, meaning no save states being called, no macros, setting to turn LEDs on at boot is not enabled. However changing any of these does not change the behavior.

I have tried a trick I’ve used on other non WLED projects where I put an extra LED in between the controller and the rest of the strip, where that pixel is fed by a diode that drops the voltage to that single LED. It’s a super hacky way to get around some LED strips and controllers not playing nice at the voltage differential. I don’t have level shifters on hand to try them.

Does this sound like a hardware issue, something about how I have it wired? Or is this a WLED issue? I have noticed this on other projects, however only with the first LED blinking, not the whole string.

Edit, Figured out the randomly changing what blinks thing. It depends what what set when everything gets turned off. When the whole string was lit, the string then blinks quickly to that same state when power comes on and then WLED seems to catch up and turn them off. When the string was off before power is removed it is simply the first LED that blinks that yellow/green quickly.

Yes, hardware. Bad or wrong connection if it does not turn-on orange.

I didn’t state, the LED work just fine after boot. I did some configuring so WLED no longer does the orange at boot thing. All LED behavior is fine after boot (but it will do that just fine when I set the settings back to stock), so the hardware itself is fine.

The problem is this flash at boot where the LEDs very briefly flash to their state when power was last removed (or the single LED 0 flashing if the whole string was off at power removal)

Ah, okay. Adding a relay to control power to LEDs fixes that.

Honestly didn’t realize there was a relay function built in. I’ll see if I have a relay kicking around and try it.

Having the switch control the relay rather than the power supply might be better, depending on the supply.

Since it’s a meanwell P/S, the relay integration with WLED is probably best, leaving the switch controlling power into the P/S.

If you have a brand of P/S that randomly dies at power up (not meanwell), often leaving the P/S on all the time is better. In that configuration, leaving WLED on all the time might be better too.

If WLED is left on all the time, a double pole relay controlled by that switch would be perfect. One set of relay contacts interrupts the LED strip power, and the other set controls 3.3V input to WLED for BTN PIN configured as a simple switch to control LED On/Off.

That “WLED on all the time” option is good for automation setups where sending configuration changes in advance of the switch coming on for a nice surprise effect (like birthday or anniversary) is possible. Otherwise, it runs the same effect until powered up, wifi connected, and then changes can be sent.

The project I’m building out is replacing bulbs in a rather unique ceiling light fixture with custom build LED bulbs. The idea is to have the wall switch control the light just like a normal light. So the desired configuration is to have the meanwell supply in the light fixture connected to the wall switch controlled 120VAC. I want behavior 90% of the time to be that when the switch is flipped and power turns on to the D1 mini and LEDs, WLED simply powers up and sets all LEDs to full brightness white. I was hoping to have it all work without having to leave WLED powered up constantly. The other 10% of the time I’ll use the web interface or automation interfaces to change the full white to other effects.

It appears that the above does work, I have it working on my workbench. The only problem is the LEDs flashing that quick blink of the state they were at the last time power was removed. I’ll do a few more experiments with relays or other configurations and see if I can figure out the issue.

If I really can’t solve the flash at boot up problem I can resort to leaving the wall switch on constantly and putting an ESP-01 connected button on the wall next to it and have that button trigger the power on and off in WLED. That would work, but I would prefer to stick with the simple wall switch turning the power on and off to everything.

In that case, the relay pin controlled by WLED is the way to go.
That said, you may need a custom compile of WLED, or find slower closing relay if you still get a flash at power up.
The only issue with leaving WLED off is that mild delay between flipping the wall switch, wled booting, enabling relay, led strip lighting - it’s probably perceivable.

But, cross that bridge if / when you get to it.

Full speed ahead with WLED & RELAY input. The wiki describes relay use. Google searches for “site:github.com WLED RELAY” and “site:wled.discourse.group RELAY” may offer better suggestions should you need them.

Be sure and post your solution and how high WAF is for it. :slight_smile:

Ok, I think I’ve just proved it’s not a WLED problem, it’s something with the LEDs. I finally thought to remove the D1 and apply power to the LEDs with no controller. They revert to their last state when power was removed. Meaning if I had the strip on full white when I remove power, then remove the D1 completely, then apply power to JUST the LEDs, they will light back up full white. If the LEDs were lit some color pattern when power is removed, and then I put power back to the the LEDs with no controller attached, they resume that pattern (with no changing, just the steady state of that last pattern frame).

So what I’m seeing is the LEDs resuming their last state while WLED boots, then as soon as WLED is up and going it kicks in to initialize the LEDs as off, then apply whatever the defined boot pattern/behavior is. I will see if throwing the correct relay in between the LEDs and power changes this behavior by allowing WLED to fully come online before applying power to the LEDs.

The LEDs i’m using are these Inolox RGBW chips on custom PCBs.

The relay does seem to solve the problem, if I can get WLED to be fully booted before the relay applies power to the LEDs it stops them blinking their last state. However now I’m running into the issue that the D1 won’t click the relay on at boot. I found some other relays marked as “3V” relays meant for 3.3V devices. However it still seems like the D1 just can’t throw enough power at the relay to activate the coil at boot. Again, after that first automatic enable, if you toggle the power in WLED it controls the relay just fine.

I’m going to try a different microcontroller and see if it’s an issue with that D1.

I think you need a solid state relay, or mosfet driven by D1 output.

That would probably solve the relay problem yes. I swapped to a spare NodeMCU instead of the D1, and it has no problems driving the relay at boot. And the relay has solved the “previous state” flash when power is applied. So I think I’ve found a working configuration. Setting up a macro to run at boot that sets the effect to solid, LEDs to full white, and power to on results in the lights coming on when you apply wall power to the power supply with no weird effects. For version 2 maybe I’ll look at utilizing a fet to get around the D1’s low power delivery at boot, but I think I’m happy just substituting in the nodeMCU.

So, summary of what I found to be the issue and solution:
The LED chips I picked will revert to their last state if power is supplied before the controller fully initializes and gets the data line running. This creates a flash or blink right when power is supplied to the LEDs. By using a relay to control power to the LEDs you can delay the LED on time until the data line is up and running. A D1 mini (or my particular D1 mini) may not be able to supply enough power to the relay at boot, use a Fet or a different ESP board.

1 Like

i have this exact problem with all LEDs flashing full white once after powering on with a wemos D1 (wemos and APA102 LEDs share the same PSU)

did i understand correctly that there is only a hardware solution for this problem (i.e. adding a relay to the circuit) or is it somehow possible to achieve this via software as well?

i tried with a playlist that starts with a solid black and then moves to the desired effect but that does not eliminate the white flash after powering on .

Try a different GPIO.

thank you for the reply @tonyno
do you mean for the CL or the Data line? or both?
currently its gpio 2 for Data and 0 for Clock

Recommended is to use GPIO1 (TxD) for clock and GPIO2 (D4) for data
hardware SPI: use GPIO14 (SCLK) for clock and GPIO13 (MOSI) for data


this seems to have fixed it! thank you so much it was driving me crazy

@pho9574 so you changed from gpio 2 (which i also currently running) to gpio13?


For single wire LEDs GPIOS 1, 2 and 3 are recommended. Other GPIO will require CPU to handle timing and may produce a lot of flickering.

Using 2 wire LEDs GPIO 13 and 14 are required.

1 Like

Yeah, also read the recommended pins, so i wondered if that changed.
But now i know why, for 2 wire (data & clock) strips, you have to use GPIO13 & 14.
So because mine is 1 wire strip, i will leave them on gpio 2.