Building a Raspberry Pi UPS and serial login console with tinyK22 (NXP K22FN512)


Erich Styger has been working on a UPS with the Raspberry Pi to cover a short power out:

There are different ways to ruin a Linux system. For the Raspberry Pi which uses a micro SD card as the storage device by default, it comes with two challenges:
1.Excessive writes to the SD card can wear it out
2.Sudden power failure during a SD card write can corrupt the file system
For problem one I do I have a mitigation strategy (see “Log2Ram: Extending SD Card Lifetime for Raspberry Pi LoRaWAN Gateway“). Problem two can occur by user error (“you shall not turn it off without a sudo poweroff!”) or with the event of a power outage or black out. So for that problem I wanted to build a UPS for the Raspberry Pi.

Project info on MCU on Eclipse site.

This Quick Hack Will Keep You Online During Your Next Power Outage

The modern human’s worst nightmare: a power outage. Left without cat memes, Netflix, and — of course — Hackaday, there’s little to do except participate in the temporary anarchy that occurs when left without internet access. Lamenting over expensive and bulky uninterruptible power supplies, Youtube user [Gadget Addict] hacked together a UPS power bank that might just stave off the collapse of order in your household.

This simple and functional hack really amounts to snipping the end off of a USB  power cable. The cable is then attached to a screw terminal to barrel connector adapter and plugged it into a pass-through power USB power bank. No, really — that’s all there is to it. [Gadget Addict] notes that while most modems and routers are designed to run off a 12V power supply, they still operate at 5V. He goes on to connect several router and router/modem combination units to the power bank. In each case the system appears to boot up and perform normally.

The particular UPS unit [Gadget Addict] was  using has a lead acid battery that was prone to failure on an almost annual basis — which defeats the purpose of a backup power supply for even a non-critical system. This quick hack could be the ounce of prevention that offsets the potentially hours of internet-less boredom that strikes with your next power outage. An accompanying solar-powered 3D printer should also keep you plenty occupied.

[Thanks for the submission, Gadget Addict!]

Filed under: hardware, internet hacks