Friday, January 18, 2013

Small UPS for RaspberryPi

Some time ago I went into Radio Shack and found a small USB rechargeable battery that has a retractable USB connector on one end and a microUSB on the other. It looks something like this but it is only 800 mah and was on sale for $8.

I wanted to use it as a power source for my RaspberryPi but wanted it to use the battery only when mains where off. I looked around for circuits that allowed for instant swithcing between 2 power sources and actually found something I could make but it was pretty complicated.

First thing I did is opened it up so that I would have access to the wires, I didn't want to use the microUSB connector it came with. When doing this I managed to damage all the small tabs that kept it together. No matter, I cut the microUSB and soldered the wires to a a USB extender wire. I didn't cut the wire all the way because I wanted to leave the data wires intact and just give power to the cable.

I had a rather small 10cm extender and used that and luckily the battery had color coded wires as well so just soldered red to red and black to black. And to put it back together I used some electric tape.

I still had the problem of switching from mains to the battery. In the instructions that came with it (yes, I read the manual because I take my own advice and I always tell people to RTFM), there was a warning to always turn the battery off before plugging it in to charge. I do read the manual but I don't really listen to warnings so I tried to power something off of USB with the battery ON and plugged in to a power source. I used a USB wall wart to charge the battery and an old Bluetooth handsfree (that I didn't mind blowing up if something would have gone wrong). I did this because damaging the apartment power lines was more OK for me than damaging a USB port on my laptop (I pay rent, they can fix it).

What happened was that everything went better than expected. The handsfree would charge bath when the battery was plugged in to the wall and when it wasn't. So it seems that it acted like a UPS on it's own.
I still needed to make sure that nothing bad happens over time so I left it there, watching it with the corner of my eye for a half a day. All was good, nothing got hot and the battery was always full.

The down side to this small battery is that when I used it with the Pi it lasted for about 30-40 minutes. That is enough time to find another power source or to shutdown the device and save the work. Maybe I will try upgrading the cells inside as they resemble standard AAA rechargeable batteries.

I don't have pictures of the inside or of the build, but this should be pretty simple. Here is the finished project.

Enercell 800 mah battery top view
Enercell 800 mah battery side view

Small things add up so take it one step at a time. Enjoy!

No comments:

Post a Comment