
UPS
When an external lead-acid rechargeable battery is connected to the Strato Pi UPS board,
the Raspberry Pi will remain powered by the Strato Pi board when the main power supply
fails, as long as there is enough energy in the battery.
When power is available, the external rechargeable battery is slowly charged with a 30mA
current.
Battery operations status is visually notified with an on-board LED and can be checked
reading Raspberry Pi's GPIO26 pin.
You can start a delayed power off cycle by rising Raspberry Pi’s GPIO16 pin.
When GPIO16 is set to high, Strato Pi will wait 60 seconds and then power off the Pi board
for at least 5 seconds.
After being powered off, the Strato Pi UPS board will supply power to the Raspberry Pi
only when the main power source is restored.
Starting from a power off condition, the Raspberry Pi will not receive power if only the
back-up battery is connected to the Strato Pi board.
The Strato Pi utility implements the following commands to monitor and control the UPS.
To print “1” if Strato Pi is operating from the battery, or “0” if main power is present:
$
sudo strato battery; echo $?
Hardware watchdog
Strato Pi UPS implements a dedicated hardware watchdog circuit that can be used to
perform a full power cycle of the Raspberry Pi.
Being controlled by Raspberry Pi’s GPIO pins, it is extremely easy to control watchdog
operation using simple custom scripts in your application.
The watchdog is normally disabled. To enable it, set GPIO6 pin to high. While GPIO6 is
high, the Strato Pi controller will watch for state changes of the GPIO5 heartbeat pin. You
should ensure that GPIO5 flips its state between high and low faster than every 60
seconds.
If the Strato Pi UPS controller doesn’t see GPIO5 changing state for more than 60
seconds, it will initiate a shutdown procedure, rising the GPIO12 timeout pin to high, to
signal that a watchdog timeout has occurred.
If possible, you should immediately initiate a software shutdown on Raspberry Pi, and set
the GPIO16 shutdown pin to high. When GPIO16 is set to high or 60 seconds after the
timeout, Strato Pi will wait 60 seconds more, then power cycle the Raspberry Pi.
Note that Strato Pi UPS will power cycle the Raspberry Pi even if GPIO16 is not set high.
In this case the power cycles occurs 120 seconds after the heartbeat timeout.
The Strato Pi utility can be used to control the watchdog from your own application.
Enable the watchdog:
$
sudo strato watchdog enable
Disable the watchdog:
$
sudo strato watchdog disable
20
Strato Pi UPS User Guide