Building a Battery Board for the Raspberry Pi – Battery Board V0

Raspberry Pi Battery Board V0

Raspberry Pi Battery Board V0

Two big features of the Raspberry Pi development board are its versatility (due to open hardware/software) and its compact size.  I had read a couple of different project articles on the web on how to use a USB Wi-Fi adapter to convert the Pi into a wireless access point.  As an access point the Pi is creating a mini wireless network that has data passed through from the ethernet port.  Taking just the wireless network part of the code and using it a portable means of communication with other devices seemed like something that could useful in a number of projects.  With a bit of tinkering I could use the Pi as a wireless Samba server and a wireless web cam.  Adding battery to power the Pi you would have a portable Wi-Fi network you could take with you.  Googleing around showed that a number of hackers out there were already had projects doing exactly this.   Some example applications include:  wireless still/video camera, wireless file servers (Pirate Box), remote control and wireless data collection.  I didn’t have a CSI camera at the time but I could see a number of uses just with the camera alone such as: balloon cam payload, motion activated nature cam, and time lapse photography.

Of course the easiest solution for most would be to just buy a portable cell phone charger and plug it into the mini USB port. This solution is a little bulky but takes 0 development time. Looking at the footprint of the Raspberry Pi board I thought it should be possible to build a battery attachment that would be less than 1″ thick and power it for at least two hours. With a little creative packaging it would look cool too.

Most of the powered components for the Pi were designed to be used in portable electronics. More than likely the power for these devices would be from a 3.7V li-ion battery. To power the Pi with a li-ion battery, a circuit would be needed to step the voltage up to the 5V. The battery would also need a special circuit to charge it.

Getting The Parts Together

Thanks the powers of mass production and the ever growing smart phone market most of the components necessary to build a useful battery board for the Pi are available through ebay. The three main components I needed to build my battery board were a inexpensive battery, a charging circuit, and a boost converter to convert the 3.7V to 5V. Note, whenever building something powered by a li-ion battery you have to be sure there is a circuit that has a cut-off for over voltage and under voltage limits on the battery. Since most cell phone batteries have these built into the pack I didn’t have to buy a separate one – though I do have a few in my junk box from previous projects.


No Name S3 Battery

It took a bit of web research to figure out what battery I wanted to use. There is a huge after-market for cell phone batteries and buying a good one can be a bit of a craps shoot. Also, though most postings for li-ion phone batteries will show a rated voltage and claimed capacity very few show the physical dimensions of what they are selling. I decided to take a chance and buy an aftermarket battery built for the Samsung Galaxy S3.  The Galaxy S3 is very popular phone that has been out for a while, I figured the cost/performance for the battery should be fairly good. The no-name battery I purchased out of Hong Kong ran about $4 US. The label claim 2300mAh but I later found it to be more like 1600 mAh.


5V 1Amp Boost Converter

Next I needed a boost converter to take the 3.7V from the battery and step it up to provide 5V with at least 700mA of current output.  Suprisingly, doing a ebay search for boost converter will yield several options for a tiny circuit board to convert from a lower voltage up to 5V. I wanted a minimum of ! A output for less than $5 delivered. I ordered two boards, one rated at 1A and one rated at 3A. The 3A unit was a bit over $5.  The small 1A unit was  roughly 3/4″ x 3/4″.


500mA Charger

The charger unit was harder to find than the boost circuit. I found a couple of options on the Sparkfun and Adafruit websites but not too much on ebay short of some AC wall-plug chargers. I did notice that the simplest chargers available on Sparkfun and Adafruit used the MCP73831 IC to control the charge. I considered buying a MCP73831 and building up the circuit myself since it only required a few components but when you add in shipping costs and probably a breakout board to make the tiny IC connections it was more than I wanted to spend on a quick and dirty prototype. I went back to ebay and did a search under MCP73831 and found a little charger board for just under $8 delivered.

The image I have of the charger board was taken after I removed the JST plug.


As a platform to hold all my components together I used a piece of perforated prototype board (perf board). I used perfboard for a lot of my projects in the past. Perf board from US vendors is kind of expensive – especially if you want the double sided type with plated through holes. Buying through ebay provides a number of low cost alternatives.

In my work with Ardruino hardware I had put a number of circuits together using combination breakout board glued to a common piece of perf board using double sided adhesive. The double sided adhesive is actually a 3M adhesive film that is applied to a surface along with a no-stick backing material whick removed before the surface is applied to another. I would use this double stick adhesive attached to both sides of a piece of business card stock. Of course this technique only works on breakout boards with components on one side only. The purpose of the business card stock was to allow for a little more compliance between the two surfaces and also provide a layer of electrical insulation when used on circuit boards with exposed backside traces.

Boost CircuitAndTape

To get the final assembly to be as thin as possible i cut the perf board so that when the board was mounted above the Raspberry Pi the header pins lined up with the holes in the perf board – I didn’t want to cut the header pins just yet. I also cut a 1/4″ hole to give some additional clearance to the 220uF filtering cap nex to the USB plug. For mounting the board to the Pi I added four holes for 4-40 standoffs that would be fastend with screws to the perf board. Only two of the stand offs would actually be fastend to the Rasperry Pi board the other two only acting as spacers.


Cut Perf Board With Holes


Perf Board with Standoffs

Anyone who has looked at building an acessory board for the Raspberry Pi has probably spent some time deciding how to work around the analog video port. The analog video on the Pi comes out through a RCA Plug that sits quite a bit higher than the I/0 header pins. Designing a acessory board that had a standard header socket mounted to it would have to implement some means of going over or around the RCA jack. As most of the applications I was interested in had no use for the analog Video out my solution was to just de-solder and remove it. While I was at it, I also removed the audio jack. Early on I had decided to use a model A Pi board for this project to avoid having to deal with clearances with the 2 port USB and the Ethernet recepticles.

Model A with RCA and Audio Removed

Model A with RCA and Audio Removed

The one piece of hardware that I didn’t mention earlier, was some kind of switch to switch between battery power and normal micro USB power.  Searching through one of the local surplus stores, I found a 4 pole double throw switch marked ‘ALCO‘ that I thought would do the job.

alcoSwitchDoing a seach on Digikey for a similar looking switch I found the rating to be 0.4 VA @ 20V.  I believe the 20VA is a power rating, so at 5V I should be good to 2A?  I don’t think the calculation is quite that simple but I thought there was a good chance the rating was high enough.

Not wanting to have a usb plug hanging off the mini usb port that normally powers the board, I decided to make power connections to the Raspberry Pi by breaking into the power input at the poly fuse. The poly fuse on the Pi is on the back of the board next to the SD card holder. I didn’t use any kind of quick disconnect plug and made the hard wire connections directly on each board.


Below is a hand CAD sketch of how I wired all the parts together:


With the no-name S3 battery fully charged I could run the Xbian version of XBMC with a Wi-Fi dongle streaming video for about 2 1/2 hours.  After testing the battery board for a few days I decided that I would build a second battery board.  The two major improvements on the second battery board would be : extended battery life, and multiple USB ports through use of a mini hub.   The tests I had ran to improve battery performance led me off into another project altogether – a watt hour meter built on the Arduino platform.


Battery Board V0 Rear View

17 comments on “Building a Battery Board for the Raspberry Pi – Battery Board V0
  1. Nice project to make it more durable, the life of the battery to be extended, can i plug more in paralel ?

    • sgyoshida says:

      I’ve seen some Li-Ion packs set up to run in parallel with each cell using its own charge limiting circuit but there is probably some inefficiency that begins to come into play the more the discharge curve of the two batteries differ from one another.

  2. Wonderful article! We will be linking to this particularly great
    post on our website. Keep up the great writing.

  3. Mark says:

    I am currently working on a system that uses either the Intel Galileo board or the Raspberry Pi board to create a kiosk type appliance that displays the room bookings for meeting rooms where I work. I have been trying to work out what sort of power supply to use and I came up with the same sort of idea… but instead of having a single Li-ion battery to run everything, there are 2 with a monitoring system that will automatically switch to the second battery when the first battery gets low and sends an email to the person who’s job it is to maintain the setup.

    The other thing that I am thinking of putting into the box is a RFID or NFC reader that will pick up pre-programmed RFID coils or NFC coils stuck to doors inside the room which just contains the room number. This will allow the units to be swapped out if there is a failure with zero downtime. Just walk up to the door and clip it on.

    The system would talk to the master server via a wireless connection.

    You’re battery concept is awesome :)

    • sgyoshida says:

      I like the dual battery idea. The batteries I’ve been using are pretty thin – about 5mm thick. So a second battery wouldn’t add too much bulk.

      One of the ideas I was playing around with was incorporating an atiny85 into the board. My plan was to use the atiny to control a wake functions so Raspberry Pi could go to sleep for applications like wildlife cameras or time lapse photograpy. You could just as easily use the analog inputs on the atiny to monitor battery voltage to and control switching between the packs.

  4. Peter Laucks says:

    Hi- Thanks for this most useful post! I’m putting a raspberry pi in my car as a mobile media player. I will be able to control the Pi from an app on my android phone. My problem is that I want to be able to properly shut down the Pi when I turn the car off, but I don’t want to have to think about it and wait for. I figured if I had a battery as a “backup” it would buy me the extra 45 seconds of proper shutdown after the car is off.
    What do you think? What kind of switch would I need to do this automatically with the rest of the equipment as you stated. Arduino?


    • sgyoshida says:

      You might be able to use something like an ATtiny85 to shut things down. You could put the switched power from your car on one of the digital inputs so that when it goes low the ATtiny would send a digital output to the Pi to shut itself down. I suggest an ATtiny because you would only need a couple of IO to do the job but a regular ATMega328 Arduino would work too. Arduino pro-minis are really cheap out of China (4 to 5 dollars US).

  5. Hi! I’ve been following your web site for some time now and finally got the bravery to go ahead and give you a shout out
    from Houston Tx! Just wanted to tell you keep up the excellent job!

  6. Yaseen Reza says:

    Hi – I am really intrigued by your post, and think you’ve done a great job. If you still look at these comments, I just want to ask – on your CAD sketch, you have two labelled power inputs, one for the Raspberry Pi itself, and one for the Lithium charging circuit. Is it possible to have a 5v 2amp supply split, half to the charge circuit and half to the Pi through a voltage regulator? Or even a Raspberry pi B+ which can tolerate the extra amperage?

    • sgyoshida says:

      As long as the wall adapter has enough current capacity to both power the Pi and its accessories and charge the battery at the same time it shouldn’t be a problem. The two circuits are isolated by the switch in this design. The maximum charge rate on the Li-ion battery will be 500 mA so the adapter needs to be able to handle 500 mA plus whatever the Pi is using.

  7. Joao Sombra says:


    Very nice project, congratulations! Have you packaged all the Raspberry PI+Battery+Charger+Booster
    inside a almost closed case? I’m working into almost the same project, I wanna pack all this
    components inside a standard RPi Case, but, the PI Core reaches a “high” temperature value (53ºC
    up to 60ºC), and a standard liion battery works at 40ºC maximum, so I’m afraid if the heat could
    drive the system to a damage or even a risk of explosion.


    • sgyoshida says:

      I haven’t tried anything with a completely enclosed case. I think GoPro cameras have a similar issue with having to dissipate heat in a sealed enclosure. If you look at a GoPro teardown you can see a lot of heat sinking material built into the design.

  8. Nick says:

    What points are the red white and black wires soldered to on the pi board exactly? I’m looking to do this but on the rasberry pi 2 model B and the arrangements of points is a little different than the board above

    • sgyoshida says:

      The black wire is power ground for the raspberry pi. The red and white wires represent a break in the positive power pin coming from the mini usb port on the raspberry pi. The ‘break’ starts just after the usb plug at one of the poly fuse pads. If you look at the middle picture of the three small pictures in the article you can see I’ve flipped the poly fuse around to uncover the pad and glued it to the board. The white wire is soldered to the uncovered pad. To connect to the other side of the ‘break’ I soldered the red wire to the open side of the poly fuse.

  9. yogesh says:

    A tp-4056 will also work well for charging battery and with 1 amp charge current

Leave a Reply to Cancel reply

Your email address will not be published. Required fields are marked *


* Copy This Password *

* Type Or Paste Password Here *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Hit Counter provided by orange county property management