Pi power button turns arduino on and off? arcade
-
Hi I'm building up a retropie barcade and I was hoping to implement a power button like so on the pi:
I was hoping to then get the pi to turn an arduino on or off i.e. Pi is on, arduino is on.. pi is off arduino is off.
The arduino runs some lighting for the arcade machine.
I was wondering if anyone had any suggestions on where to begin.
I didn't want the equivalent of pulling the plug not good for the pi!
-
@thomen Use the GPIOs that provide 5V from the RPi
Pi off > 5V off > Arduino off
Use a Mausberry for this costs around 20$ -
@thomen Maybe, power the arduino from USB, and plug it into a USB hub connected to the Pi. That's how my backlighting works, although I don't use an arduino. I get 5v via USB from my USB hub which switches off when the Pi goes off. When the Pi goes on, the USB hub (powered) also comes on, and when that happens, my LEDs light up. NO GPIO connections or scripting needed.
-
@caver01 Good catch...
-
That's a great idea @caver01 ! What powered hub are you using?
Thanks!
-
@caver01 how does the hub switch on and off as the pi goes on and off if it is powered don't the peripherals remain powered?
-
That got me thinking.. what about a master slave style powerboard where the pi is the master and when shut down the slave devices would then turn off?
https://www.bunnings.com.au/eco-solutions-6-way-master-slave-powerboard_p4331027
I like the usb hub idea better :) but I'd like to know how the master usb device activates the on state as I was thinking of using the powered usb hub to power the arduino and some neopixels.. so ideally I'd like both the pixels and arduino off when the pi turns off
-
@thomen maybe it is merely a circumstance/feature of the hub I am using. The powered hub remains connected to power via the AC/DC adapter, but the master device which connects to the Pi from one side of the hub seems to be "watched" as it triggers a power up for the rest of the devices (8 ports on the other side). Consequently, when the Pi goes on, the hub wake up, and anything connected to it starts drawing power--including my pushbutton LEDs.
-
@caver01 that sounds perfect what hub are you using? Model?
-
@thomen It looks like it is an older, D-Link model DUB-H7 USB2.0 powered hub. You can see it in my project build thread (click link in my signature below). I have since cleaned up a bunch of USB cables using custom ones I built to length, but the shorter, white USB cable in the image is the power for my LEDs.
This hub definitely pre-dates high-power charging for smartphones and tablets, so might be an out-moded design. It seems these days, folks would want their devices to continue to get power for charing even if their computer is OFF. I wonder if a modern version of this hub will work differently.
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.