# Controlled RasPi shutdown on sudden power loss

**URL:** <https://forum.core-electronics.com.au/t/controlled-raspi-shutdown-on-sudden-power-loss/4370>\
**Category:** Raspberry Pi\
**Created:** [18 January 2019 08:02 UTC](https://forum.core-electronics.com.au/t/controlled-raspi-shutdown-on-sudden-power-loss/4370 "2019-01-18T08:02:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles78749](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@Charles78749](https://forum.core-electronics.com.au/u/Charles78749)\
**Post date:** [18 January 2019 08:02 UTC](https://forum.core-electronics.com.au/t/controlled-raspi-shutdown-on-sudden-power-loss/4370/1 "2019-01-18T08:02:12Z")

</div>

Hi, I’m looking to enable a controlled RasPi shutdown upon sudden power loss when car ignition is turned off on a RasPi, GPS Pi-screen application that needs to be very reliable. I’ve been looking reliable, long term, (3 to 5yr), cheap, simple, smallish plugin pcb solution.

Two options appear available; RasPi script to sense when power is suddenly disconnected, then temporary power supply via battery or SuperCap option.

After doing the research, I think a RasPi Supercap solution is the best option. If a unit has a rechargeable battery then it has to be charged at the very first power up to be reliable from the very start and this may not happen.

So anyone know of a board with supercaps, other than these ones ?

[http://techniccontroller.ingwelt.com/mini-ups-for-raspberry-pi-zero/](http://techniccontroller.ingwelt.com/mini-ups-for-raspberry-pi-zero/) ( possible option )  
[http://www.sensorsiot.org/safe-shutdown-for-raspberry-pi-with-super-capacitors-133/](http://www.sensorsiot.org/safe-shutdown-for-raspberry-pi-with-super-capacitors-133/) (simple, reliable, safe?)  
[https://juice4halt.com/](https://juice4halt.com/) (expensive, overcomplicated)  
[https://raspberrypi.stackexchange.com/questions/5372/circuit-to-safely-power-down-pi](https://raspberrypi.stackexchange.com/questions/5372/circuit-to-safely-power-down-pi) (circuit only, possible, not tested)

Thanks for any suggestions.

---

<div class="post-metadata">

**Author:** ![Stephen](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/stephen/32/1599_2.png) [@Stephen](https://forum.core-electronics.com.au/u/Stephen)\
**Post date:** [21 January 2019 00:38 UTC](https://forum.core-electronics.com.au/t/controlled-raspi-shutdown-on-sudden-power-loss/4370/2 "2019-01-21T00:38:39Z")

</div>

Hi Charles,

I think I would go after this problem with this:

> **[PowerBoost 500 Charger - Rechargeable 5V Lipo USB Boost @ 500mA+](https://core-electronics.com.au/powerboost-500-charger-rechargeable-5v-lipo-usb-boost-at-500ma.html)**
>
> PowerBoost 500C is the perfect power supply for your portable project! With a built-in battery charger circuit, you'll be able to keep your project running even .. read more

A small lipo battery:

> **[Polymer Lithium Ion Battery (LiPo) 3.7V 400mAh](https://core-electronics.com.au/polymer-lithium-ion-battery-400mah-38456.html)**
>
> Polymer Lithium Ion batteries offer superior energy density with this 400mAh battery being only 6mm in height!

and follow this tutorial:

> **[How to Make a Safe Shutdown Button for Raspberry Pi - Tutorial](https://core-electronics.com.au/tutorials/how-to-make-a-safe-shutdown-button-for-raspberry-pi.html)**
>
> Pulling the power to your Raspberry Pi can cause image corruptions & other issues that can damage your Pi! In this article, we will create a small push button that will work as a ‘Safe-Shutdown’ option. We’ll connect it to our Raspberry Pi using the...

You are probably better off using a battery, and following the tutorial to create a safe shutdown whenever the power from the car is lost. These boost chargers are should switch without a pause between power supplies. I’m not sure how you would get it to turn back on though when the car starts back up. I imagine you would work with the enable pin to make that happen though.

Good luck with your project!

---

<div class="post-metadata">

**Author:** ![Charles78749](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@Charles78749](https://forum.core-electronics.com.au/u/Charles78749)\
**Post date:** [21 January 2019 08:46 UTC](https://forum.core-electronics.com.au/t/controlled-raspi-shutdown-on-sudden-power-loss/4370/3 "2019-01-21T08:46:54Z")

</div>

Thank you for the suggestion.
