Build Your Own Arcade Controls Forum

Main => Raspberry Pi & Dev Board => Topic started by: Haloman800 on December 09, 2016, 07:43:42 pm

Title: Raspberry pi & power switches
Post by: Haloman800 on December 09, 2016, 07:43:42 pm
During thanksgiving, my siblings saw the arcade I built for my parents, and now want me to make one for them. I was thinking of going with a Pi, but I have some concerns.

1. Is there an easy way to make an on/off switch, whereas the Pi and other components can be safely turned on/off with a single switch
2. Related to #1, is the issue of the Pi getting corrupt a big concern?
Title: Re: Raspberry pi & power switches
Post by: DorkVonWaterfall on December 10, 2016, 08:37:50 am
i use a Mausberry shutdown circuit....work like a charm....
Title: Re: Raspberry pi & power switches
Post by: PhiDeltCraiger on December 10, 2016, 01:27:46 pm
I use the PowerBlock (http://blog.petrockblock.com/gadgets/powerblock-another-power-switch-for-the-raspberry-pi/) along with this switch (https://www.amazon.com/gp/product/B0198PVYS4/) from Amazon. Works like a charm and looks rather slick.
Title: Re: Raspberry pi & power switches
Post by: mahuti on December 10, 2016, 11:32:01 pm
The power block or mausberry (or similar) is the key for safe shutdown of the raspberry pi. The switch that gets wired up to one of those RPi shutdown circuits can also shut off your cabinet or other components, but the trick is that the Raspberry Pi would need to be powered separately from the components of the cab. If you have your pi's power supply connected to the cabinet power, and the main shutdown switch powers off the cabinet, the Rpi would be cut off instantly along with the cab power. So basically you have to power the Raspberry Pi upstream from the cabinet's switching power supply.

My original Defender cab was set up like that so that it could have an accessory plugged in and working even if the rest of the cab was powered down, so that you could plug in a lamp or soldering iron or whatever and work on the cabinet without running an extension cord to it.

So basically if you have the cabinets power going into a switching power supply, you could add in an outlet for the pi's power adapter upstream from the cabinet's switching power supply so the cab's power and the Pi's power are separate. I think then you could use a two-pole switch (https://www.amazon.com/Morris-70100-Toggle-Switches-Terminals/dp/B005GDG0Z0/ref=sr_1_4?ie=UTF8&qid=1481430381&sr=8-4&keywords=two-pole+switch) to control the cabinet power, and as a switch for the power block (or whatever).

I haven't wired this same thing up myself, but it's what I've been planning to try sooner or later.

Alternately, you'd have to create some kind of relay so that once the PI is powered up or down, the rest of the machine would also be powered up or down. I've seen some people do this with breadboards, but seems more than what I need so I haven't looked into it.
Title: Re: Raspberry pi & power switches
Post by: JDFan on December 12, 2016, 02:15:40 pm
THere's also a tutorial on adding a shut down script for one of the GPIO pins that will let you shut it down with a button hooked to a GPIO pin and ground - then you just wait for it to shut down before pulling the plug (or turning the rest of the power off)

Tutorial Link -- http://lifehacker.com/easily-add-a-shutdown-switch-to-a-raspberry-pi-1706950870 (http://lifehacker.com/easily-add-a-shutdown-switch-to-a-raspberry-pi-1706950870)

and video of it in action -

! No longer available (http://www.youtube.com/watch?v=W5YTm0xkCb8#)
Title: Re: Raspberry pi & power switches
Post by: obcd on December 17, 2016, 07:23:51 pm
There is another option. You can run a raspberry pi with a "read only" root file system.

You will need a separate partition for your high scores and everything that needs to stay after a reboot.

I have no idea if it's easy to alter a preconfigured image for that.

We use fsprotect to make the rootfs read only. It depends upon aufs which is not a standard part of the pi kernel.

So, we had to recompile the kernel and had to add that module to the kernel.
Title: Re: Raspberry pi & power switches
Post by: ark_ader on December 26, 2016, 02:30:33 pm
Just power the unit off.  It does not hurt it and, its quick and cheap.  Or you can buy a cheap windows tablet running 8.1 with mini hdmi and use whatever you want to shut it down, rdp, smart power, etc.

I like the windows tablet as you can use the display for a tiny bartop.  100 bucks currently at wally-mart.
Title: Re: Raspberry pi & power switches
Post by: DorkVonWaterfall on December 27, 2016, 07:13:23 am
Just power the unit off.  It does not hurt it and, its quick and cheap. 

thats not true...it can definatly corrupt your SD cart
Title: Re: Raspberry pi & power switches
Post by: matsadona on December 28, 2016, 04:01:56 am
Just power the unit off.  It does not hurt it and, its quick and cheap. 

thats not true...it can definatly corrupt your SD cart

True, still I have not yet managed to do that. And I have +15 RPi's turned off frequently... Perhaps I have been lucky so far.
Title: Re: Raspberry pi & power switches
Post by: mahuti on December 28, 2016, 11:57:43 am
if they aren't doing anything when you unplug them then nothing will usually happen.

I've been unplugging windows machines and rpis ungracefully for years and I've never had it obviously cause problems.

That said, the worst part about corruption is that it's hard to see and can build up over time. Better to be safe then sorry and handle it the recommended way, which is to shut down gracefully. Shutting down gracefully isn't a giant obstacle, so might as well tackle it.
Title: Re: Raspberry pi & power switches
Post by: nitrogen_widget on December 29, 2016, 01:17:20 pm
There is a new read only image for the raspberry pi on the attractmode forums.
it uses a USB drive for roms and configurations.

theoretically it can't be corrupted.
Title: Re: Raspberry pi & power switches
Post by: pbj on December 29, 2016, 01:24:13 pm
A link sure would be awesome around here.....

I haven't had any issues with cutting power while a game is loaded.  At the menus, it's about 50/50.  Configuring the damned things is such a pain in the ass that I'm willing to go to great lengths to avoid it.

Title: Re: Raspberry pi & power switches
Post by: vinegar on January 01, 2017, 12:03:33 pm
lifepo4wered/pi guy just came out with one for the pi 3 which i used on a recent build, it was pretty fantastic.

http://lifepo4wered.com/ (http://lifepo4wered.com/)

it's a UPS that supports safe shutdown/reset with mains power detection using a LiFePO battery instead of li-ion, much safer and'll survive the kinda charging cycles of a UPS situation longer.  i feel like i'm shilling for the dude at this point, but he really came through releasing it before christmas so i'm enamored with his nerdery.
Title: Re: Raspberry pi & power switches
Post by: matsadona on January 02, 2017, 03:44:21 am
lifepo4wered/pi guy just came out with one for the pi 3 which i used on a recent build, it was pretty fantastic.

http://lifepo4wered.com/ (http://lifepo4wered.com/)

it's a UPS that supports safe shutdown/reset with mains power detection using a LiFePO battery instead of li-ion, much safer and'll survive the kinda charging cycles of a UPS situation longer.  i feel like i'm shilling for the dude at this point, but he really came through releasing it before christmas so i'm enamored with his nerdery.

Thanks, this is really a great product.
Title: Re: Raspberry pi & power switches
Post by: langlem on January 02, 2017, 07:54:16 pm
Im just about ready to begin my first Rpi project... For those that have used the new life4powered product... Do you have any additional info on how you set it up?

Thank you.

Matt

Edit - I did read thru the info on their website ... but just curious on your set ups. Thx
Title: Re: Raspberry pi & power switches
Post by: vinegar on January 03, 2017, 12:45:51 am
i used it simply as a safe-shutdown timer, which means installing the daemon and CLI tool, and with it setting AUTO_BOOT to 4 and AUTO_SHDN_TIME to 1 (as a buffer for user flicking the switch like it's a reset button).  it did what it was told with no issues.  one thing i'd note is to remember that you still need to send the CFG_WRITE magic value even if you're using the CLI tool and not programming directly, which may not be obvious from the docs.  so when everything's working, you set CFG_WRITE to 70, and your settings will survive the battery being removed—a step you may not really need to take if it's for your own use, but i anticipated the non-technical recipient of the cab i used it in doing something silly like not turning the cab on for months and the battery getting discharged.
Title: Re: Raspberry pi & power switches
Post by: langlem on January 03, 2017, 03:04:25 pm
Awesome...thats exactly what I was looking for.  Just waiting for my Pi to land....uh...yeah.
Title: Re: Raspberry pi & power switches
Post by: mahuti on January 04, 2017, 11:30:24 pm
Looks cool. But pricey: $42.
Title: Re: Raspberry pi & power switches
Post by: Titchgamer on January 05, 2017, 05:08:54 am
Ive just ordered a mausbery shutdown circuit.
I have not used one before but it looks like a good solution so I will give it ago.
Title: Re: Raspberry pi & power switches
Post by: vinegar on January 05, 2017, 10:44:45 am
Looks cool. But pricey: $42.
yah, glad it included the battery.  that's $10 retail right there, so i felt better about it.
Title: Re: Raspberry pi & power switches
Post by: mahuti on January 06, 2017, 03:15:02 pm
If not for the fact I spend so much on other things it would be great.  :embarassed:
Title: Re: Raspberry pi & power switches
Post by: 1500points on April 20, 2017, 12:23:23 pm
I bought a powerblock and had install errors...no one seemed to be wiling to help with ideas, so I threw it in an box to forget about it.

After that I discovered this super cool and easy method:


I learned this from building a mini NES but the concepts apply, in general.
Adding power switch, reset switch, fan, and led to a raspberry Pi 3:


Site with the detailed instructions- http://www.westaby.net/nespi/assembly2.html (http://www.westaby.net/nespi/assembly2.html)

Summary:
Power switch- Put a latching or toggle switch across pin5 and a GND.
Reset switch- Put a momentary/pushbutton switch across pin7 and GND.
Power Light- Put an LED and 100-300ohm resistor across pin8 and GND.
Fan- Add small fan red wire to pin4, ground to GND.
Update the Pi with the scripts in the assembly guide above.

How it works:
The power switch will power up and power down the pi.
the reset switch will restart a game......come on, do over!
the fan stays running while the power is applied to the pi itself, it is not controlled by the power switch.

(http://www.westaby.net/nespi/images/electronics/RP2_Pinout.jpg) (http://www.westaby.net/nespi/images/electronics/RP2_Pinout.jpg)