1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Control LED Power Supply

Discussion in 'Off-Topic' started by Sebastian, 18 December 2020.

  1. Sebastian

    Sebastian New Member

    Messages:
    2
    Hardware:
    RPi3
    Hi,

    I have my hyperion setup working fine so far. I power most of the setup via the USB Ports of the TV. Only the LEDs have a separate power supply which I would need to switch manually.

    Does any one have a clever idea how to control the power supply with the raspberry pi? Basically I am looking for a solution to power it on when the raspberry pi powers up and cut power when the raspberry is also loosing power.

    Any idea?

    Thanks,
    Sebastian
     
  2. TPmodding

    TPmodding Administrator Staff Member Administrator

    Messages:
    2,087
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino, +WLED, RPi4
    get a wifi power plug, which can be flashed with tasmota, and then you can write a start and stop script wich can controll the plug
     
  3. davieboy

    davieboy Active Member

    Messages:
    195
    Hardware:
    RPi1/Zero, RPi2, RPi3, RPi4
    go for a 5v relay module, depending on the power supply for the led's you may need 2 channel relay to split the load if your LED's are pulling more than 10A which shouldn't be a problem tho as you will probably have at least 2 power lines going to the led strip anyway - better safe than sorry.

    Simple script to set gpio pin to pull high @ reboot then when pi powers down relay looses signal and switches the lights off
     

    Attached Files:

  4. wladi

    wladi Member

    Messages:
    69
    Hardware:
    RPi3
    Or by a master-slave power strip.
     
  5. filipe teixeira

    filipe teixeira Member

    Messages:
    36
    Hardware:
    RPi3
    Anyone have a tutorial how to use a 5v relai module with raspberry pi 3+
    When pi powers down relay looses signal and switches the lights off
     
  6. davieboy

    davieboy Active Member

    Messages:
    195
    Hardware:
    RPi1/Zero, RPi2, RPi3, RPi4
    What relay module do you have? They are pretty generic as at the end of the day its just a switch controlled by something else, usually with a voltage.

    Wire the supply and load up so that it is normally open, then when pi powers down the leds are off.

    I thought the pi didn't really have the ability to power off, more like a zombie state, but its something ive never looked into as mine have all run 24/7 when in use but either way id imagine the GPIO would kill the supply, but if your pulling the plug or physically killing the power supply to the pi the crudest most effective way would be hook the relay signal wire into a 3.3vpin on the GPIO then you wouldn't need to bother with any startup or shutdown scripts to pull the desired GPIO pin because as soon as the pi gets power again the relay will activate and bring the lights on.

    Going the other way with a startup and shutdown script is no big deal either, just depends on how your powering down the pi
     
  7. filipe teixeira

    filipe teixeira Member

    Messages:
    36
    Hardware:
    RPi3
    Thank you very much for your reply.

    What you suggest? I don't know if it will be a good idea to leave the raspberry pi on 24/7.
    I have see also a tutorial to put a button on off switch following this tutorial.


    Regarding for the LEDs I think when raspberry are off the light are in mode off mode also
     
  8. davieboy

    davieboy Active Member

    Messages:
    195
    Hardware:
    RPi1/Zero, RPi2, RPi3, RPi4
    Down to your preference bud, Yeah that would work, modify the script as needed to control the relay board.

    Nah if they were meant to be switched off they would have a button for it , less chance of SD card corruption and i aint got time to wait for the pi to boot to use it, I want to press the button and it be sitting waiting for me :D
     
  9. filipe teixeira

    filipe teixeira Member

    Messages:
    36
    Hardware:
    RPi3
    So if I leave the raspberry on 24/7 I won’t have any problems with over heating? Then regarding to the led strips they will be connected at the same power supply so they mean they will always on also, but when the tv is off the leds are off ? It doesn’t spend electricity?
     
  10. davieboy

    davieboy Active Member

    Messages:
    195
    Hardware:
    RPi1/Zero, RPi2, RPi3, RPi4
    Think your going to ave to do a few tests once you get up and running and see what works out best for your situation