Feature List
- Provide a stable powersupply with short time UPS function
- Backup short power interruptions <2sec. without user notice
- Mechanically stable USB-C powersupply connector instead of micro USB
- Shutdown function using a power button
- No maintenance cost caused by dead batteries
- No risk of fire because the powersupply is using supercapacitors instead of using risky LiIon techology
- Connector for external power button
- Connector for an expansion board with relay & power LED to switch loads without draining current from the supercaps
Addon board with
- External power LED
- External relay option to switch high current loads
The UPS function is limited to an operation time of approx. 30..60 seconds. That is far enough for a save shutdown.
The powersupply remembers its last state. It excacly comes up in the last mode it was running.
That means:
- If the device was disconnected by removing the power cord while it was on, it will restart in "on-mode" after reconnecting the power cord
- If the device was off when removing the power cord it will remain off after reconnecting it and can be started using the power button
- If it was switched off by the power button it must be switched on by the power button
- If it was shut down by the shutdown command or via the user interface it will come up if the power button is pressed or the supply cord is (re-)connected
All those functions are available in a PIhat compatible PCB
Initially it was designed for arcade machines but there are a lot of usecases where it fits like:
Raspi based:
- NAS
- Homeserver
- IoT server
I'm using it on all of my raspi computers at home because it is so convenient just to remove the power cord without the risk of corrupted SD-cards.
How it works
The design is based on the supercap charger LTC4041 from Linear Technology. I was following mainly the application note for that chip.
An additional µcontroller is taking care of the interface to the raspi and interacting with the LTC4041.
µController functions
Backup UPS funktion
This is not a really UPS backup power function. It is just to bridge small power outage glitches of < 2s.
Shutdown on power loss
The µcontroller is "listening" to the power fail output of the LTC4041. If it indicates a power fail. The µcontroller is waiting until the backup time of 2s is expired, then it gives notice to the raspi by pulling the power good signal low. After a period of approx. 25s it switches the supply to the raspi off.
Shutdown on button press
If the power button is pressed the µcontroller gives notice to the raspi by pulling the power good signal low. After a period of approx. 25s it switches the supply to the raspi off.
Shutdown using the Linux shutdown command
The raspi is pulling a specific GPIO (24 or 26) low. The µcontroller recognizes it and is switching the supply to the raspi after 25s off.
Remembering the last state
The state of the powersupply is recorded in the eePROM of the µcontroller. This means that after re-powering or pressing the power button it comes up in the same state as it was before switching off the power. A kind of wear leveling algorithm is used to ensure a lifetime of > 1 million switching cycles recoded in the eePROM.
DC Specification (For best performance use the official raspberry pi USB-C power supply)
Input Voltage | 5V .. 5.2V |
Output Voltage (Power cord connected) | same as input voltage |
Output voltage during shutdown | 4.72V .. 4.88V |
Output current (Power cord connected) | limited by wall plug max. current |
Supercapacitor charge current | 1A max. |
Backup time (500mA load current, 25F Supercap) | 60s (theoretical vallue, load will be disconnected after 20s) |
Backup time (1000mA load current, 25F Supercap) | 25s (theoretical vallue, load will be disconnected after 20s) |
Performance (with 35F Supercaps)
Raspberry PI 3B with official TFT display powered by the official raspberry pi USB-C supply
Images showing the shutdown procedure
Channel 1 - Supercap...
Read more »
Hi,
I just received and tried the UPS. It seems a very nice engineered product. Thank you.
However, I wanted to ask you what is the expected behaviour in the raspberry console when the power button is pressed or power cord is removed?
I was expecting the typical raspberry poweroff and shutdown sequence messages printed to the console, but this does not happen. Nothing is displayed and the power is removed from Raspberry only after 22seconds, not 30..60.
I tried adding to /boot/config.txt the lines below individually or together
dtoverlay=gpio-poweroff
dtoverlay=gpio-poweroff,gpiopin=22
but it does not work
I have a Raspberry 3B+ and the UPS is the version with 2 orange 30F SUPERCAP. I don't have any load attached.
It doesn't seem to perform the safe poweroff procedure...
What should I do?