Till
Posts: 4
Joined: Tue Dec 20, 2016 3:26 pm

Turn on/off peripherals when I turn on/off the Pi

Wed Aug 16, 2017 7:25 am

Hey guys,

when I turn on my Pi (Media Center) I want the peripherals I use with it to turn on, too. Analogously when I turn it off.

I thought of a master slave socket board where the Pi is plugged in as master and the external Drives, TV and sound system are plugged in as slaves.
The problem with that is that the Pi uses too little energy to trigger the switch in the socket board that turns on the slaves even if that switch is adjustable (current / power). You just can't lower the threshold to such low values.
At least I couldn't find a socket board which would work for me.

Has anyone of you have an idea how this could be done?

Thanks in advance,
Till

alphanumeric
Posts: 1196
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Turn on/off peripherals when I turn on/off the Pi

Sun Sep 03, 2017 9:33 am

How about this, https://www.adafruit.com/product/2935 Controllable Four Outlet Power Relay. Then use the Pi's GPIO to turn it on off.

Till
Posts: 4
Joined: Tue Dec 20, 2016 3:26 pm

Re: Turn on/off peripherals when I turn on/off the Pi

Sun Sep 03, 2017 8:25 pm

Awesome, I'll give that a try!
Looks promising...

Thanks a lot!

alphanumeric
Posts: 1196
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: Turn on/off peripherals when I turn on/off the Pi

Sun Sep 03, 2017 8:32 pm

There is one always on outlet. That's where I would plug the Pi's power supply in. I'm not sure why there is one normally on outlet though? I assume that will turn off when you turn the two normally off ones on. You may have to plug a second power bar in if you need to turn on more than two devices. Not the end of the world if it does what you want though.

User avatar
ab1jx
Posts: 366
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Turn on/off peripherals when I turn on/off the Pi

Sat Sep 09, 2017 3:09 am

I'd probably just hang a transistor or FET off one of the GPIO pins and use it to drive a relay. The question is how much software you're willing to write to get it just the way you want it. Raise (go to a non-zero voltage) one of the GPIO pins, connected through a current limiting resistor to the base of a transistor to turn it on, have that pull in a relay. When you turn the Pi off the GPIO voltage will go away automatically so it all turns off. Junk box parts are fine. Turning it on is the only tricky part.

Code: Select all

apropos gpio
pig2vcd (1)          - A utility to convert pigpio notifications to VCD.
pigpio (3)           - A C library to manipulate the Pi's GPIO.
pigpiod (1)          - A utility to start the pigpio library as a daemon.
pigpiod_if (3)       - A C library to interface to the pigpio daemon.
pigpiod_if2 (3)      - A C library to interface to the pigpio daemon.
pigs (1)             - command line socket access to the pigpio daemon.
All much fancier than you need, seems like I've seen a way to do it from a script, which you could call from your bashrc file. Fun.

Return to “Recommended peripherals”

Who is online

Users browsing this forum: No registered users and 5 guests