Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Raspberry pi & power switches  (Read 7422 times)

0 Members and 1 Guest are viewing this topic.

Haloman800

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 140
  • Last login:February 07, 2020, 12:40:00 am
  • Awfully Awesome
Raspberry pi & power switches
« 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?

DorkVonWaterfall

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:April 14, 2024, 08:57:14 am
Re: Raspberry pi & power switches
« Reply #1 on: December 10, 2016, 08:37:50 am »
i use a Mausberry shutdown circuit....work like a charm....

PhiDeltCraiger

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17
  • Last login:March 28, 2018, 12:58:36 pm
Re: Raspberry pi & power switches
« Reply #2 on: December 10, 2016, 01:27:46 pm »
I use the PowerBlock along with this switch from Amazon. Works like a charm and looks rather slick.

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: Raspberry pi & power switches
« Reply #3 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 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.
« Last Edit: December 10, 2016, 11:36:37 pm by mahuti »
Raspberry Pi, AttractMode, and Skeletor enthusiast.

JDFan

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3448
  • Last login:May 21, 2023, 04:07:42 pm
  • I want to build my own arcade controls!
Re: Raspberry pi & power switches
« Reply #4 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

and video of it in action -

! No longer available

obcd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 160
  • Last login:April 03, 2019, 11:44:36 am
  • I want to build my own arcade controls!
Re: Raspberry pi & power switches
« Reply #5 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.

ark_ader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5645
  • Last login:March 02, 2019, 07:35:34 pm
  • I glow in the dark.
Re: Raspberry pi & power switches
« Reply #6 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.
If I had only one wish, it would be for three more wishes.

DorkVonWaterfall

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:April 14, 2024, 08:57:14 am
Re: Raspberry pi & power switches
« Reply #7 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

matsadona

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 760
  • Last login:October 28, 2023, 06:00:12 am
Re: Raspberry pi & power switches
« Reply #8 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.
Building, collecting and playing arcade machines :)

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: Raspberry pi & power switches
« Reply #9 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.
Raspberry Pi, AttractMode, and Skeletor enthusiast.

nitrogen_widget

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1746
  • Last login:March 30, 2024, 09:10:09 am
  • I want to build my own arcade controls!
Re: Raspberry pi & power switches
« Reply #10 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.

pbj

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10875
  • Last login:Yesterday at 07:58:32 pm
  • Obey.
    • The Chris Burke Band
Re: Raspberry pi & power switches
« Reply #11 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.


vinegar

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:August 12, 2017, 09:07:18 pm
  • ID/hardware hacker
Re: Raspberry pi & power switches
« Reply #12 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/

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.

matsadona

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 760
  • Last login:October 28, 2023, 06:00:12 am
Re: Raspberry pi & power switches
« Reply #13 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/

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.
Building, collecting and playing arcade machines :)

langlem

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 109
  • Last login:Yesterday at 12:09:41 am
  • I want to build my own arcade controls!
Re: Raspberry pi & power switches
« Reply #14 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
« Last Edit: January 02, 2017, 08:18:58 pm by langlem »

vinegar

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:August 12, 2017, 09:07:18 pm
  • ID/hardware hacker
Re: Raspberry pi & power switches
« Reply #15 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.
« Last Edit: January 03, 2017, 12:49:58 am by vinegar »

langlem

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 109
  • Last login:Yesterday at 12:09:41 am
  • I want to build my own arcade controls!
Re: Raspberry pi & power switches
« Reply #16 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.

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: Raspberry pi & power switches
« Reply #17 on: January 04, 2017, 11:30:24 pm »
Looks cool. But pricey: $42.
Raspberry Pi, AttractMode, and Skeletor enthusiast.

Titchgamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4222
  • Last login:December 17, 2023, 08:05:48 am
  • I have a gaming addiction.....
Re: Raspberry pi & power switches
« Reply #18 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.

vinegar

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 25
  • Last login:August 12, 2017, 09:07:18 pm
  • ID/hardware hacker
Re: Raspberry pi & power switches
« Reply #19 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.

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: Raspberry pi & power switches
« Reply #20 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:
Raspberry Pi, AttractMode, and Skeletor enthusiast.

1500points

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 550
  • Last login:November 20, 2018, 01:44:12 pm
    • How to succeed at Robotron
Re: Raspberry pi & power switches
« Reply #21 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

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.