Tuesday, July 08, 2014

Using an Adafruit PowerBoost 500 charger as UPS for a Raspberry Pi

 

One of the main tasks of a Raspberry Pi I have is monitoring my automatic backup generator and sending out alerts via SMS and email when the generator kicks in. This works fine, with up to now 1 glitch: when the outside power to the house is cut off, it takes at least a minute for the generator to kick in and start providing electricity to the house. So, under that scenario, the Raspberry Pi reboots and although the monitoring applications start up again, it just didn't seem to me as though it was foolproof.

So, I had been searching for a long time for a reliable, affordable Uninterruptable Power Supply (UPS) for this Raspberry Pi. I could probably have used one for a PC, but that was just too bulky and expensive. I even went so far as to try and design e backup power circuit using supercapacitors (after all, I don't need backup power for more than a minute), however, 'miserable fail' is the only term I can accurately and honestly use to describe that effort. Theoretically, it should have worked, in practice my circuit couldn't supply power for more than about 15 seconds, before the voltage dropped below acceptable levels and the Pi conked out.

Enough about that. By having Adafruit on my Twitter feed, I became aware of their PowerBoost 500C charger. Digging a little deeper, I found that this could also act as a UPS for Raspberry Pi, Arduino, etc. So, I decided to purchase one.

It arrived in mere days, which is pretty much a miracle when you realize it had to cross the US-Canada border. I soldered the USB connector in place (this is the output side from where the power is fed to the micro USB connector on the Pi), plugged in the Lithium Ion Polymer Battery I purchased at the same time and plugged the whole ensemble into the wall outlet via a standard USB wallmount charger. No smoke! On the contrary, the on-board LEDs lit up (and bright they are). I had to wait a little while until the yellow LED (indicating battery is charging) was replaced by the green LED (indicating battery charged).

Following that, a made a little YouTube video illustrating what happens when you plug a Pi into the output side, and then unplug the wall power etc.

In the video, I only have the Pi running off the battery for a short while (approximately 30 seconds), which should be sufficient for my purposes. However, in a subsequent test, I had the wall plug removed for more than 3.5 hours and the battery (2500 mAh) was still going strong.

So I think I finally have a reliable solution for my UPS problems.