Skip to content

Blink on startup,only with relay #812

Closed

Description

@Maurotb

Hi,
i have setup my wemos d1 mini pro with 5v level shifter, I use ws2815b,with relay to enable my power supply when i power on wled.
My led blink on start instead make a soft transition...

https://www.youtube.com/watch?v=jGPSlDlD0Hg

If i remove relay and make led always powered, wled work correctly with soft start of leds.
I think it's a hardware problem, the wled signal arrives before the voltage on the LEDs is sufficient i think...
How i can resolve this?
Thanks

Activity

  1. Aircoookie commented on Mar 29, 2020

    @Aircoookie
    Member

    Hi,
    currently WLED turns the relay on at the same time as it turns on the LEDs (sends data). Having the relay turn on earlier would mean delaying the data signal. I might be able to add support for that in the future, but that is not ideal... What happens if you select a longer transition time in LED settings? (maybe 2 seconds)

  2. Maurotb commented on Mar 29, 2020

    @Maurotb
    Author

    Hi, if i select 2 seconds of transition, problem persist...
    I have tried to start power by shelly 200 300ms before send data.
    This work.

    I think the best solution is to give the option in the options to select how long to activate the power before wle and how long to turn it off after wled.
    I believe time is dependent on power supply.
    I'ts possible?
    I was hoping I could get rid of shelly with wled, but with this problem I can't do it
    Thanks

  3. Aircoookie commented on Mar 29, 2020

    @Aircoookie
    Member

    The problem is that the transition and output to LEDs is started immediately once the power-on command is received. Changing that would not be trivial, so while it sounds simple, just turning on the relay immediately, but delaying data would need quite a few adjustments to the logic.
    How long does it approx. take for the LEDs to turn on after you press the power on button?

  4. Maurotb commented on Mar 29, 2020

    @Maurotb
    Author

    How long does it approx. take for the LEDs to turn on after you press the power on button?

    I did not understand the question well, the LEDs turn on immediately, but they make an annoying flash at power on with random colors...
    I use wled to light the house as you can see from the video, it's not nice to see that flash every time I turn it on...

    I guess this problem exists in general for those who use the relay function,acceptable for effect light but not for lighting...
    Do you think it can be added as a feature in the new release?
    Otherwise I build the system using shelly and making a delay via node-red but I'd like to simplify it using the wled relay output ...

  5. huggy-d1 commented on Mar 29, 2020

    @huggy-d1
    Contributor

    What size capacitor do you have on the input to the esp and what size capacitor at the power output to the led strip? If the answer is none to either question, try adding some capacitance. You can search online for appropriate sizes if you do not know.

  6. Maurotb commented on Mar 30, 2020

    @Maurotb
    Author

    I think my setup is okay,
    i use Mean Well rsp-200-12 power supply for led.
    6 x 2.5mm cables start from this power supply and arrive at 3 different points of the LEDs (the strips are quite long,approx 15 18mt)
    At the led input there is a 1000uf capacitor

    separate 5v power supply for d1 mini pro (this is always powered on).
    In d1 mini pro i have a 470uF at input and a sn74ah level shifter.

    I have try to remove capacitor and doubled it,i try to remove resistor of signal at input, same problem :(
    My led is ws2815b

  7. huggy-d1 commented on Mar 30, 2020

    @huggy-d1
    Contributor

    Thanks for explaining your setup and problem in more detail. I have to assume you are using a relay with physical contacts rather than an SSR or other fast switching relay. The time required for physical movement of relay contacts is often in the range of the problem you describe (up to 200ms). If your default boot effect is SOLID and color BLACK, does this resolve the problem of flashing at startup? If you happen to have a faster switching relay available, please try that.

  8. Maurotb commented on Mar 30, 2020

    @Maurotb
    Author

    Yes, with solid black work with no flash.
    If I turn up the brightness even very little, the problem occurs

    I have try with a normal relay finder 5v 10A connected to wled and shelly relay connected to node-red.
    My electrical system is certified with CE marked components (europe), I would like to avoid placing non-certified components on the 220v, I do not know there are 5v solid state relays in gewiss bticino or other manufactured...

    ps
    from datasheet of my relay
    Tempo di intervento: eccitazione/diseccitazione ms 10/5

  9. huggy-d1 commented on Mar 30, 2020

    @huggy-d1
    Contributor

    Oh my, I thought you were switching 5V power, not 220VAC mains power.
    There will be an inherent lag from the time the 220VAC is switched on before acceptable 5VDC is available at the LED strip. If the 5VDC is switched, the time delay would be much less.

  10. Maurotb commented on Mar 30, 2020

    @Maurotb
    Author

    No i switch main power supply.
    I can't make a switch on low voltage (i have 2815b,12V), too much current
    and also turning off the power supply is more efficient.
    Keep in mind that I don't have a single strip, but about 40mt of LEDs will be between the entrance and the corridor powered with two Mean Well rsp-200-12 (400W).
    I believe that in real use, implementing the possibility of deciding the relay activation and deactivation time is important ...

  11. austwhite commented on Mar 30, 2020

    @austwhite

    The relay in WLED is designed with switching the stable 5V (or 12 in case of 12V strings) power for the LEDs as far as I know.
    If you switch mains power, it takes time for everything to stabilise and you will get very weird behaviour.
    For switching mains power, you'd need to engage the mains power, wait for upto 1 second then engage the WLED power line separately as far as I can work out.

    How much current are you drawing??
    There are relays that can switch at 5Volt coil voltage capable of switching 30amps and more.

  12. Maurotb commented on Mar 31, 2020

    @Maurotb
    Author

    approxx 30A.

    In the datasheets of the led power supplies it is always specified to interrupt the power supply, connect the load instantly I think it can give problems on the regulation line which could give wrong voltages to the leds as well as needing very powerful relays.
    See this:
    https://www.meanwell-web.com/content/files/pdfs/productPdfs/MW/HLG-320H/HLG-320H-spec.pdf

    However I understand that the relay pin is not server for my purpose, do you think it could be a feature that will be added?

    In 600W version of power supply (200€ argh!),
    https://www.meanwell-web.com/content/files/pdfs/productPdfs/MW/HLG-600H/HLG-600H-spec.pdf
    there is a power on input (5v) with hold up time of 15ms ,I think it's the only possibility right now, given the cost, have you ever tried?

  13. Maurotb commented on Apr 12, 2020

    @Maurotb
    Author

    @austwhite @huggy-d1 @Aircoookie
    I bought mean-well HTPG-200-12 , this power supply has a digital power on/ power off input and an hold up time of 16ms.
    I connected the pin d6 via a three-state buffer to this input , now I can turn the power supply on and off in 16ms.
    The problem of the blink at power on has reduced a lot but it is not yet perfect, we can see strange colors for a moment at power on.
    Don't you think to insert this delay in interface?
    Could you tell me in case you want to recompile I wled with this delay where can I put it?
    Thank you

  14. Aircoookie commented on Apr 13, 2020

    @Aircoookie
    Member

    @Maurotb you could try adding this to the top of colorUpdated()

    if (bri && !briIT) {
        digitalWrite(RLYPIN, RLYMDE);
        yield();
      }

    this could toggle on the relay slightly earlier, maybe it helps.

    colorUpdated is in led.cpp in current source, this corresponds to wled08_led.ino in older source versions.

  15. Maurotb commented on Apr 14, 2020

    @Maurotb
    Author

    @Aircoookie I recompiled adding the code but a blink appear on led and immediatly power off, and in webpage i see connection to light failed. please refresh page...
    Yes, if i recompile without code added, work... (but blink on startup persist)

  16. 1 remaining item

  17. Maurotb commented on Apr 15, 2020

    @Maurotb
    Author

    @Aircoookie ok, i removed yield(); and now work, but the blink problem on start persist :(
    i think time is too short

  18. Aircoookie commented on Apr 15, 2020

    @Aircoookie
    Member

    Hmm I figured the delay might be too short to make a difference. So we might need a timer, but I don't know if even that would help. Please do a short test for me by commenting out strip.service() in the main loop() (wled.cpp in new source, wled00.ino in old). You will not get any output to the LEDs, but the webserver and relay should work and you should not get any flashing. If you'd still get flashes, there would be nothing we can do in software, but if not we might be able to delay turning on by 200ms or so.

  19. Maurotb commented on Apr 16, 2020

    @Maurotb
    Author

    @Aircoookie ok i have try.
    I commented on the strip.service () function , relay go on and there is not blink in my strip led,all led stay off.

  20. Aircoookie commented on Apr 16, 2020

    @Aircoookie
    Member

    Perfect! This means we can likely solve the problem.
    Just make the following changes (I recommend updating to latest master first)

    In wled.h someplace after line 150 add:

    WLED_GLOBAL unsigned long turnedOnTime _INIT(0);

    In wled.cpp replace line 85 if (!offMode) with:

    if (!offMode && millis() - turnedOnTime > 150)

    Finally, in led.cpp, add to the top of colorUpdated()

    if (bri && !briIT) {
      digitalWrite(RLYPIN, RLYMDE);
      turnedOnTime = millis();
    }

    I hope it will help you :)

  21. Maurotb commented on Apr 19, 2020

    @Maurotb
    Author

    Good news! @Aircoookie now is perfect!
    30ms is enough with this power supply but I put 200ms for safety.
    Do you think you can insert this feature in future releases?
    Thank you!

  22. Maurotb commented on Jun 8, 2020

    @Maurotb
    Author

    @Aircoookie is possible to insert this patch in a future release?
    Thanks

  23. Aircoookie commented on Jun 8, 2020

    @Aircoookie
    Member

    @Maurotb yes, I will add this as an optional patch soon since other users have wished for this as well :)
    Tracking progress in #346

  24. Sangoku commented on Dec 19, 2021

    @Sangoku

    Perfect! This means we can likely solve the problem. Just make the following changes (I recommend updating to latest master first)

    In wled.h someplace after line 150 add:

    WLED_GLOBAL unsigned long turnedOnTime _INIT(0);

    In wled.cpp replace line 85 if (!offMode) with:

    if (!offMode && millis() - turnedOnTime > 150)

    Finally, in led.cpp, add to the top of colorUpdated()

    if (bri && !briIT) {
      digitalWrite(RLYPIN, RLYMDE);
      turnedOnTime = millis();
    }

    I hope it will help you :)

    I get a compile error when i try to add

    if (bri && !briIT) {
    digitalWrite(RLYPIN, RLYMDE);
    turnedOnTime = millis();
    }

    to the led.cpp

    Also if (!offMode) is no longer if (!offMode) but if (!offMode || strip.isOffRefreshRequred)

    
    Compiling .pio\build\esp32dev\src\wled00.ino.cpp.o
    wled00/led.cpp: In function 'void colorUpdated(int)':
    wled00/led.cpp:170:18: error: 'RLYPIN' was not declared in this scope
         digitalWrite(RLYPIN, RLYMDE);
                      ^
    wled00/led.cpp:170:26: error: 'RLYMDE' was not declared in this scope
         digitalWrite(RLYPIN, RLYMDE);
                              ^
    *** [.pio\build\esp32dev\src\led.cpp.o] Error 1
    
    
    

    UPDATE:

    Nevermind they got renamed only

      if (bri && !briIT) { 
        digitalWrite(rlyPin, rlyMde);
        turnedOnTime = millis();
      }
    

    works.

    Update update:

    No it does not. When you try to change colors it gets kinda wonky.. fail. ~~`

  25. DieNummerEins commented on Oct 5, 2023

    @DieNummerEins

    @Aircoookie
    Hi Christian. Is this feature (delay for led at power up) somewhere in progress?

    I have the same problem with blinking at startup. I use this SSR:
    https://a.aliexpress.com/_mP11K0O

    I need a real solution because I would like to install WLED everywhere in the house (every room, garage, roof edge as permanent holiday light, garden...). A preset/playlist-solution like mentioned in #346 isn't convenient if you have 30-40 WLED-controller and you want link them together (some of them should together behave as one).

    I would really appreciate this feature!

  26. blazoncek commented on Oct 5, 2023

    @blazoncek
    Contributor

    It has been implemented in 2020.

  27. DieNummerEins commented on Oct 5, 2023

    @DieNummerEins

    Are You sure? At the end of #346 there is said, that it is still not implemented.

    How can I set up the delay (if it is implemented)?

  28. doronazl commented on Dec 11, 2023

    @doronazl

    It has been implemented in 2020.

    Im also having this issue, when you say its implemented, you mean the feature should show up on current wled versions ? i cant find it

  29. doronazl commented on Dec 11, 2023

    @doronazl

    @Aircoookie mind directing me to how to get this solved ? having the same issue with a ssr

  30. svb91 commented on Mar 5, 2025

    @svb91

    @Aircoookie I also have the same issue. Could you please give us a hint how to solve it or which setting we need to adjust to increase the timer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions