Page 1 of 1

Safe shutdown when total power turned off.

Posted: Tue Feb 19, 2019 6:47 pm
by WoodMill
I've converted my Street Fighter II cabinet into a retro pie. So fun. Picked up the game for $100, so is perfect for modding.

What I'd like to do is make this as fool proof as possible. What I'd like to do is add a battery to the RPi 3+ so that it shuts down safely when I turn the power off. In a way I see it similar, but a little different than the GBZ.

How I want it to act is if the power is pulled, it will shutdown, as opposed to an actual switch like on the GBZ. That way I can have everything, like the monitor, and speakers on one circuit breaker. When I turn off the circuit breaker, the pi will shutdown on it's own.

Any thoughts on this? Like I said, I want it as fool proof as possible, so that someone doesnt have to remember to go to the shutdown menu, or even hit the power button to just the pi before turning the rest off.

Re: Safe shutdown when total power turned off.

Posted: Tue Feb 19, 2019 7:16 pm
by McGyver
What you need is something like Pi UPS. Just google about it to get some ideas.

Re: Safe shutdown when total power turned off.

Posted: Fri Feb 22, 2019 1:00 pm
by Flavor
It almost seems like the easiest solution is to let the Pi run all the time and just turn off the monitor and speakers with the switch.

This way, it would always be on your network (assuming it's networked) to transfer files and such, too.

Re: Safe shutdown when total power turned off.

Posted: Sat Mar 23, 2019 9:57 pm
by WoodMill
Finally got around to setting up the UPS option. Ran into an issue I wasnt thinking of. So I tested it with an Adafruit Powerboost and battery. Had an extra 2500 battery. So when the power is disconnected, the Pi shuts down but the battery continues to send power to the Pi, so to turn the pi back on, I have to cut the power from the battery and plug it back in.

So I cant think of a way around this without adding a power button to reset it.

I rather not leave the pi running all the time. I'm going to have two of these arcade1up set up and they'll be no need to access it again once I set it up.

Re: Safe shutdown when total power turned off.

Posted: Sat Apr 27, 2019 1:15 pm
by Picicle
Connect the battery through the transistor. At the gate of the transistor, feed a logic 1 from any pin GPIO. In the gate of the transistor, turn on the capacitor. Set the input of the one pin GPIO to start the shutdown when the main power disappears. When the main power is gone, the shutdown process begins. And after a while (determined by the capacitor in the gate of the transistor), the battery turns off.