Close
0%
0%

Raspberry Pi SuperCapacitor UPS with Power Switch

Powersupply for raspberry pi that includes an UPS, power button function and remembers its last state

Similar projects worth following
The inital idea was to build a powersupply for an arcade bartop that has a power button to switch the bartop (https://www.etsy.com/de/listing/663378240/8-bartop-arcade-cabinet-wood-kit-4-or-6) on and off. It should prevent from corrupted SD card files if the power cord is unintentionally removed during playing. So it must have an UPS feature. Especially children are not willing follow a "boring" shutdown procedure. If the power cord is removed the device should savely shutdown itself.With this electronics you don't have to care when and how you are switching off the Raspberry Pi. It will always take care of a save shutdown.SuperCapPi was born...

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

Input Voltage5V .. 5.2V
Output Voltage (Power cord connected)same as input voltage
Output voltage during shutdown4.72V .. 4.88V
Output current (Power cord connected)limited by wall plug max. current
Supercapacitor charge current1A 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 Voltage (UPS function works as long as voltage is >2.5V)

Channel...

Read more »

expansion_sch_bom.png

Expansion board with relay and power LED BOM embedded in schematics. https://oshpark.com/shared_projects/tU2LIOME

Portable Network Graphics (PNG) - 46.97 kB - 11/24/2020 at 11:41

Preview
Download

Portable Network Graphics (PNG) - 33.74 kB - 11/18/2020 at 21:26

Preview
Download

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates