Raspberry Pi UPS: Software
<< Previous
First
2
3
Last
Raspberry Pi UPS: A Very Simple Solution Raspberry Pi UPS: Trickle Charger Raspberry Pi UPS: Safe Shutdown Raspberry Pi UPS: Software
Raspberry Pi auto shutdown softwareTo control the safe shutdown circuit we setup two GPIO pins. One output GPIO 19 that is set high when the RPi is running and one input GPIO 17 to receive the power fail signal. The running output holds the relay normally energised so that the battery is connected in circuit ready for the power to fail. When the power fail input goes high the software initiates a system shutdown. When the shutdown is complete and it's safe to turn off the running output goes low, the battery drops out and if there is no 12V supply present the whole system will power down. Download the Python script "safeshutdownmanager.py" and copy it to "/home/pi/safe_shutdown" To setup the GPIO and start the safe shutdown script by editing the file /etc/rc.local ![]() After you reboot your Pi the safeshutdownmanager will be running in the background ready to shutdown the system when the power fails. sudo reboot Don't forget to connect GPIO 19 to the RUN input of the safe shutdown circuit and GPIO 17 to the power fail output. To verify that the script is running and protecting your Pi type the following command: ps -aux |grep safeshutdownmanager If the script is running it will be printed along with it's Process id (PID): root 2214 0.0 0.7 6540 3556 ? S Mar13 0:11 python /home/pi/safe_shutdown/safeshutdownmanager.py In the above example the script is running with PID 2214. If necessary it can be stopped with the following command: sudo kill 2214
<< Previous
First
2
3
Last
Raspberry Pi UPS: A Very Simple Solution Raspberry Pi UPS: Trickle Charger Raspberry Pi UPS: Safe Shutdown Raspberry Pi UPS: Software |
Now subscribe to our newsletter and don't miss a thing |
|
Comments (66)
your scheme is really helpful for me. Thanks a lot.
But, i want to ask. what should i do, if i want to connect with 4 raspis all at once? should i just change fuse to be 8 A?
Thank you, I hope you will answer my question.
Thank you
Thank you
Thank you
Thank you again!
Thanks,
Borut
I would suggest to include another option: let the RPi know what the status of the battery is, or: add a similar circuitry as implemented for the 12VDC status. So pass a signal to the RPi "Battery_OK" . If this signal is going low it is really time to power down and deactivate the relay avoiding a complete failure of the batteries. This allows for even bigger battery packs.
Arthur
This is a simple and understandable ups for my raspberry.
I wonder what to modify to make it work as a UPS for my 12V picoPSU powered NAS ?
The aim would be to hard shutdown the NAS when power drop while using an external 12V battery.
To be as simple as possible, it would be acceptable if the circuit don't deal with battery charging.
Could you give some advices about the simplest way to achieve this ?
Many thanks
Does the charge is stopped to prevent any overcharge ?Regards,
And would they lose charge over time ( even if main power is always on ? )
I was thinking of the first version of the ups, what prevents the battery from discharging while on main power ?
And should minus on the battery connect to 0V ?
Is ground the same as 0V in this setup ?//P
Excellent explanation and functionality.
Maybe you can rearrange with power bank with 18650 batteries as they already have charger on them.
What do you think?
Thanks
Andrijan
Because I found and buy 2 batteries with 4V and 1.3mAh. I plan to connect it series(ony by one).And I didn't get with wich formula you calculte value for R10.Thanks!
i am not interested to switch between the two modes. i will do only with the disconnection of battery at the end. it is only interesting to keep the battery on if you have for example an arduino with the RPI.thanks again.
nuno
thanks .
nuno
very nice feature!
i will build this circuit and test in my rpi.
thanks again!
regards
nuno
did you try this circuit?
Add Comment