I am doing a lot of Home Automation projects, which requires flipping the circuit breakers.
Linux systems like the Raspberry Pi may not be very forgiving when they aren't properly shutdown.
For me, the Raspberry Pi that gets impacted the most is the Family Room RPi running Kodi and OSMC. I have a backup of the image. But restoring the image is a waste of time.
After restoring the image for the tenth time, I decided to "build" an Uninterruptible Power Supply for the Raspberry Pi.
Requirements
The first step is to define the requirements.
low-cost (I have 7 RPis running Kodi/OSMC and want to put this on all of them if it works
Automatic cut-over
Enough power to drive my Cord Cutting Kodi system (Raspberry Pi 3B+, fan, push button with led, and IR receiver)
5volt and 2.1amp output
Don't overheat and catch fire
I bought several RPi UPS hats, battery pack boards, and some more expensive devices. These either didn't work (no automatic cut-over) or were too expensive.
This device meets the requirements and is low-cost:
KMASHI 10000mAh Portable Power Bank with Dual USB Ports 3.1A Output and 2A Input from Amazon for $14.99
So, it's cheap
It allows simultaneous charging and powering the Raspberry Pi
While this isn't a true UPS, it provides automatic cutover and can run for a couple of hours before the battery is used up. When I flip the breakers it is usually only for a few minutes.
Step 1:
Charge the Power Bank according to the instuctions.
Wait until it is charged.
Step 2:
Instead of plugging a charger into the RPi, plug the output of the Power Bank into the RPi micro-USB using a USB to micro-USB cable.
The RPi should boot.
This has been running for 6 months and I haven't had an issue with the Power Bank overheating and I haven't re-imaged the RPi.