How to power LEDs only when rPi is on?
-
Setup: rPi 3 and PowerBlock 1.1
I have a number of 5v LED lit buttons that I would like to only be on when the rPi is on.
The current of the LED string adds up to 200 mA, and my power supply is 5.1VDC at 3A.
Right now, I just have the LED string powered directly from the power supply. The rPi gets it's power through the PowerBlock barrel connector, also wired to the power supply. The PowerBlock also has a SPST switch and indicator LED wired.
I'm not well versed in what we can do with the GPIO and PowerBlock 1.1, so I'm looking for someone to guide me in the right direction. My initial thought was to have a relay receive a signal from either the GPIO or PowerBlock that the pc board has power then close the LED string circuit... but I'm looking for ideas on how this goes.
-
I can't speak to a PowerBlock specifically, but I've been noodling around with LEDs a bit and this may be a place for you to start. You'd just want to tell the code to start automatically with the Pi and not timeout after a second as in the tutorial code.
-
Very nice, thank you for that part of the puzzle.
Now to find out how to do this with an externally powered circuit.
-
I used transistors attached to the GPIO pins to turn on my LEDS, this way you don't need to power the LEDS through the PI.
-
5v? Can't you just splice into a USB wire and plug it into a USB port on the PI? PI on, LEDs on!
-
@challenger2010 said in How to power LEDs only when rPi is on?:
5v? Can't you just splice into a USB wire and plug it into a USB port on the PI? PI on, LEDs on!
The LED string will eventually draw more current, but I like the idea :-).
-
Quick update:
Since I'm using a switch for the PowerBlock, I'll change it to a DPST ON-OFF switch (rather than SPST), this should control both circuits with one actuator and light up the LED's when the rPi is powering up.
I'm not sure why I didn't think of this earlier. :-)
Thanks to all that responded.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.