---

Thursday, June 19, 2014

Raspberry Pi Battery Power

The Raspberry Pi uses a pretty modest amount of electricity and it is perfectly possible to run in for short periods using batteries. In this post, I will look at some of the options for making your Pi run on batteries.



How Long Will the Battery Last

Whatever technology you use to battery power your Raspberry Pi, there is one key figure for the battery that you use that will determine how long you will get. This is the battery capacity in mAh (milliamp hours). So, if a battery describes itself as 1000mAh, then it can supply 1000mA for one hour before they go flat. This is an approximation so you may get more or less time.

Now, a Raspberry Pi without anything at all attached to it (no keyboard, mouse, display or WiFi dongle) will use about 400mA. Attach WiFi and a couple of peripherals and this will typically jump to about 600 mA or more. This will actually fluctuate quite a lot, depending on how busy the Pi is. So, driving video, or running a complex program will increase the power even more.

If are pessimistic and assume that the Pi will use 800mA, then we can expect about 1000 / 800 = 1.25 hours of operation from a 1000mA battery. Double the battery capacity to 2000mAh and we should get twice as long.


Battery Booster

The first and simplest option is to use a USB backup battery designed to give the battery of a smartphone a boost. You can see the battery plugged in an charging below.



These batteries actually include not just high capacity light weight Lithium Polymer (LiPo) cells, but also a charging circuit and switch mode voltage regulator. The charging circuit comes into operation when the battery pack is plugged into a USB socket on a power supply or your computer. This charges up the cells ready for use.

When you are ready to power your Raspberry Pi with one of these, you unplug it from its USB power supply and swap the lead over so that it is now providing power to the Raspberry Pi through its micro-USB lead (see below).



These devices can be bought on eBay or Amazon very cheaply and at a variety of different capacities. If you are going to use WiFi on your Raspberry Pi, then you will need to look for one that can supply 1A (1000 mA). Be aware, that many of these are only rated at 500mA. You may be lucky and this may be able to keep up with the demands of a Raspberry Pi with WiFi dongle, but then again, it may just crash unexpectedly or just die. So for a little bit extra look for one that will supply 1000mA.



LiPo Racing Pack

R/C vehicles use high capacity LiPo battery packs. These can also be used with your Raspberry Pi.



Unlike "battery boosters" these batteries do not have built-in chargers or voltage regulators. You will need to provide both these features separately, in the form of a battery charger and a switching voltage regulator circuit such as that found on the RaspiRobotBoard v2 (RRB2) from MonkMakes. The RRB2 actual provides other features such controlling motors, so if you are making a robot, then this may be a good option.

Racing packs suitable for the RRB2 should be of the two cell (7.4V variety). Having charged the battery you can connect it to the screw terminals on the RRB2 that will then provide all the power that the Raspberry Pi could need (up to 2000mA of current, with peaks of 3000mA).

A racing pack will generally have one set of leads for charging and a different pair of thicker wires for powering things from. A pair of male to male header wires will neatly connect the battery pack to the RRB2.

This approach is great if you are making a robot, because the RRB takes power for the motors straight from the battery.


AA Battery Pack

As well as using a RRB2 with a LiPo racing pack, it will also work just fine with an AA battery pack. You will need six cells, especially if you are using rechargeable batteries, which are a slightly lower voltage than alkaline cells.



The battery box is attached to the screw terminals of the RRBs just like the racing pack.

A set of fresh AA batteries will typically provide about 2000mAh.

Conclusion

If you just want to power the Pi on its own from batteries without making a robot, then the battery booster is the best option. However, if you are planning to control a motor or need some of the other features of the RRB2 such as using 5V I2C displays then the RRB2 with either an AA battery pack or LiPo racing pack is a good approach.



Books.
You may be interested in the books I have written about the Raspberry Pi.



3 comments:

Rob Dobson said...

Thanks Simon (or should I say Dr Monk!), I have been looking for a basic "safe shutdown" option for a Pi Model B to avoid SD corruption. I really haven't managed to find anything despite buying a PiUPS and several other products that showed potential. Do you have any thoughts on the subject?
Basically I'm just looking for something that signals power removal to the Pi and powers the Pi until it has been able to shut down safely.
I wrote a blog post about my tribulations here: http://robdobson.com/2014/06/does-a-raspberry-pi-need-a-ups-to-avoid-sd-card-corruption/
Thanks for your interesting work and books, Rob Dobson

Unknown said...

i like your book Mr. Monk..good tutorial for raspi users ..thanks..

JKHarris said...

Is there a difference between mA and mAh? I see a lot of packs on
Amazon rated as 3200, 5200, and 10000 mAh. Thanks.