Introduction: Raspberry Pi Powered by Batteries

Picture of Raspberry Pi Powered by Batteries

In this instructable I will show you how to properly supply power to a Raspberry Pi or Pi 2 with a battery pack or any voltage between 2.9 -32 volts DC. I will be using a efficient Pololu Step-Up/Step-Down Voltage Regulator and a toggle switch.

This can be done with any Raspberry pi version. Using a DC-DC converter allows us to have around a 90 percent efficiency in converting the power of the battery into power for the pi. You can substitute out for a fixed output DC to DC regulator but its nice to have a adjustable one if you want to use it for other projects. Its a dollar cheaper and available here (Pololu fixed 5v regulator). This will also allow to skip the steps on adjusting the above regulator.

Happy Pi day to you!

Step 1: Get the Parts Together

Picture of Get the Parts Together

First a parts list:

  1. A Raspberry pi (with a screen or ability to console into it)
  2. Pololu Adjustable 4-12V Step-Up/Step-Down Voltage Regulator S18V20ALV (Pololu)
  3. A bit of wire or a 3 pin servo extension cable
  4. A battery pack, In this case I'm using a 6 cell AA NIMH pack. (please use rechargeable batteries if possible)
  5. Toggle switch (anything rated over 3 amps should be fine)
  6. Heat shrink tubing

Tools needed:

  1. Soldering iron/station
  2. Solder
  3. Multi-meter
  4. Wire strippers
  5. Small precision Philips head screwdriver
  6. Vise is recommend but not required
  7. A acid brush
  8. 91 percent isopropyl alcohol
  9. A 10 kΩ to 100 kΩ resistor

Step 2: Prepare the Wire

Picture of Prepare the Wire

Separate out the yellow wire from the servo cable and remove it completely from both ends. You will need something to pry up the plastic holding the wire in the header. (be gentle we will need the plastic retainer in a later step)

Step 3: Solder the Headers to the Output of the Regulator

Picture of Solder the Headers to the Output of the Regulator

Break the headers into a 4 by 4 pin and solder the headers to the VOUT and GND locations on the regulator. Go ahead and connect the cable we made in the last step to the output header. Red to positive and Black to ground. Note you do not need to hook up the enable line (its internal tied with a 100k pull-up resistor)

Step 4: Clean the Connections

Picture of Clean the Connections

Clean the connections well with isopropyl alcohol and acid brush. OH yes clean them well. Don't be afraid to scrub a little. :)

Step 5: Solder the Switch

Picture of Solder the Switch

Solder the switch between the battery and the Vin via on the regulator. Take some time and clean the connections. Also remember to use heat-shrink tubing to protect the connections. Solder the grounds up at this time to so the negative of the battery is tied directly to the GND via on the Vin side of the regulator. Then connect the switch lead (The positive wire) to the Vin via on the DC to DC regulator.

Step 6: Adjust the Output

Picture of Adjust the Output

Connect a 10 kΩ to 100 kΩ resistor to the output of the servo cable/regulator. With a multi-meter on the output turn on the switch and adjust it down to 5 volts DC. Please use patience it will take a bit to tune it in. Using the screwdriver turn the potentiometer clockwise to increase the output voltage. The output voltage can be affected by a screwdriver touching the potentiometer, so the output measurement should be done with nothing touching the potentiometer (also, note that touching parts of the board with your finger can affect the output voltage).

Once you have a 5 volts out make sure its stable.

Step 7: Verify Setup and Connect to the Raspberry Pi

Picture of Verify Setup and Connect to the Raspberry Pi


It should not matter what Raspberry Pi you have we can just connect the positive to 5 volt DC power and Ground. Move the red pin over one if using the servo header and connect it to the pi. Positive (red) should be facing away from the rest of the board. Go ahead and switch on the toggle switch. Pi's power and activity LED's should be on.

Congratulations you now have a battery powered Raspberry Pi.

Please vote for me and also stop by my personal blog @ to see awesome projects.


Ghloo (author)2016-01-20

Nice. I am planning about the same for my three-wheeled Raspi bot too.

You may consider a regulator such as (way cheaper than one you are suggesting) . I also plan wiring the regulator to a micro USB connector so that I can power the Raspi the proper way (i.e. no thru GPIO) without bypassing its overvoltage protection.

The DocDoc (author)Ghloo2016-11-03

I chose the regulator as I know I'm getting a product with high quality parts made in America.

This regulator also has built-in reverse-voltage protection, over-current
protection, thermal shutdown (which typically activates at 165°C), and
an under-voltage lockout that causes the regulator to turn off when the
input voltage is below 2.5 V (typical). So there is no need to supply via USB on the Pi as the protection is built in. This will cause no harm to the Pi being powered though the I/O pins.

Also the regulator you link cannot boost the voltage from the batteries if they drop below the output voltage. This means the regulator will stop providing power long before the batteries have fully discharged. Reducing on time.

Ghloo (author)The DocDoc2017-10-12

Yep, I get the Chinese stuff for cheapo proof-of-concepts (and I am also fairly lazy), if I were doing something seriously, I would probably take the time to buy one locally or look for a decent LiPol.

...and yes, it is only step-down as I planned a battery pack with some reserve. They got step-up ones too. ;o)

joelm145 (author)2017-02-27

How can I connect a Blackberry Bold Q10 nano-keyboard to a raspberry?
I want to make my raspberry portable console with a nano-keyboard of a Blackberry Bold Q10 but i don't know how to connect it XD

benyblack (author)2017-01-23

i am new to raspberry pi i know nothing about tham
that being said i think this set up would work well for a project i want to do
could i hook up a camera to this set up and have it so i can view it on the LCD

The DocDoc (author)benyblack2017-02-26

Yes you can easily add a LCD and a camera, However you may want to think of a larger Li-ion RC car battery 3000mAh or higher @ 7.2 or 11.1volts. You would not need to use a different DC-DC converter.

LCD official


There is also a 5MP camera that is slightly older. You can also chose a different LCD, However this one is supported out of the box and has capacitive touch built in.

khyale (author)2015-10-09

Congratulations for your project! I would like to know how long the battery takes before the raspberry's power goes down. what is the battery specifications (capacity)?

HarveyS1 (author)2015-08-15

Nice job. Definitely better than brute force linear regulation.

If you are doing something that is sensitive to the ripple Voltage of the switchmode power supply, like video, follow the switch mode with a low dropout (LDO) supply.

When doing this, I set the the switchmode to about 6V - 6.25V and the LDO removes all the ripple presenting clean 5V DC. Don't forget that most linear regulators (and especially the LDO variety) require an input cap at the regulator and an output cap.

Since the Voltage drop is small, the power disipation in the linear LDO is likewise small. At a 1V drop, the dissipation wil be 1W per Amp of supply output current.

You could also use an R-C filter, but the Voltage regulation will not be as good. An Ohm or two with a 10uF ceramic cap is usually enough.

Gelfling6 (author)2015-08-11

Maybe not as efficient as the DC-DC switching regulator, but I was able to power-up a Model-B with a 12V battery as source, through two 7805 regulators in parallel. Guess it's time for me to look into a switching regulator?

SeanS17 (author)2015-07-27

i mean lower gauge.

SeanS17 (author)2015-07-27

with higher gauge wire

SeanS17 (author)2015-07-27

also after thinking about it and checking resistance in copper wire you would also improve performance theoretically ever so slightly because that looks like about 24 gauge to me.

SeanS17 (author)2015-07-27

In case others want another way. You could also do away with the voltage regulator if you used the right batteries supplying the right reserve current.

Gugoo (author)2015-07-25

great idea 赞一个

MikB (author)2015-07-25

"adjust it down to 5 volts DC" ... Or even better aim for 5.25v -- a lot of proper PI supplies put out 5.25v (some even go to 5.35v!) to be on the UPPER end of the voltage tolerance range. It allows more scope for when you have USB devices/WIFI plugged in, and stops the "voltage droop" rainbow square appearing!

It doesn't take much to lose a fraction of a volt here and there :(

Saiyam (author)2015-07-24

That's a helpful idea!

AbdullahA19 (author)2015-07-23

nice idea

The DocDoc (author)AbdullahA192015-07-24

Thanks :)

AndreaC18 (author)2015-07-24

Hi! Can i have info about the display used in this project? Where i can find it?

The DocDoc (author)AndreaC182015-07-24

Of course, the display used in the project is a 10.1 inch IPS 1200x800 panel/board that can be found at Adafruit. The case is scrap plastic that I laser cut/drilled to build the enclosure.

seamster (author)2015-07-23

Nicely done!

The DocDoc (author)seamster2015-07-24

Thanks for the kind words it was my first instructable. :)

About This Instructable




Bio: I’m a 29 year old maker that has been working with electronics and robotics for over 10 years. I have a strong background in ... More »
More by The DocDoc:Pixybot Color Tracking Robots Raspberry Pi powered by batteries
Add instructable to: