How to Power a Raspberry Pi with Batteries

Published By

Raspberry Pis are great tools for development at all stages of engineering, but they’re designed to draw power from the micro USB port, which is a relatively precise 5V power source. All input protection for your board revolves around power being supplied through that USB port.

Even if you have a well-regulated 5V input that you connect directly to the 5V and ground GPIO pins, you’re bypassing important protection like a fuse and reverse protection diode. USB port powering is definitely the best way to go, but you can’t just connect a battery—we don’t have 5V batteries. Commonly used supplies are four AA batteries (over 6V fully charged), a 9V battery, or two 3.7 Lithium Ion Batteries (7.4V). All of them will fry a Raspberry Pi. So, how do we get them down to 5V? Here are three options, from good, to better, to best.

5V Output for Raspberry Pi: Using a Resistor Divider

The resistor divider method uses the most basic circuit principle:
0616 PYP 1

You can get VOUT to be 5V so long as you know VIN and correctly select R1 and R2. R1 and R2 can be anything, so long as they adhere to VOUT/VIN = (r1)/(r1+r2). Keep in mind, however, that this method directly dissipates any extra energy as heat, so it’s best to use a power source relatively close to 5V, like four AA batteries (6V). This method directly dissipates any extra energy as heat, so it is best to use for a voltage relatively close to 5V. A pack of 4 AA batteries (6V) will work fine. A 9V battery will seriously hurt your efficiency.

Another consideration is the power rating of your resistors. Once you calculate the resistance values you want to use, you must find resistors with sufficient power ratings. Remember that the power dissipated will be the current flowing through the resistor times the voltage dropped across the resistor. For example, if you want VOUT to be 5V from a 6V Battery pack, you can use the resistors R1=100 and R2=20. Nice, round numbers. However, if we want to supply 1A maximum to the Pi (which we should allow) and P=IV, the power through R1 (the top resistor, lost to heat) would be 1V*1A = 1W. It’s not impossible to find a 1W 100ohm resistor, but that’s still a fair bit of heat. Now, if you were trying to step down 9V to 5V, you’d lose 4W at 1A. That’s definitely going to get hot, and is going to be a more expensive resistor.

See related product

MO1CT52R101J

KOA Corporation Resistor Fixed Single-Through Hole View

See related product

SFR2500001000FR500

Vishay Resistor Fixed Single-Through Hole View

The Breakdown

Pros: It’s easy and cheap.

Cons: It wastes a lot of power and if done incorrectly is a definite burn hazard.  Also, your resistor ratio is static while your battery voltage will droop as they discharge, so your output voltage will droop with it. Keep in mind that resistor dividers are not really designed to provide current to Vout, so as you try to draw more power into your Pi, the math changes.

Using a Raspberry Pi Linear Voltage Regulator

An LDO (low drop out) regulator is just a linear regulator that is designed to keep output at the desired voltage even when the input voltage gets close to the output. So while a standard regulator might only be able to supply 5V if the input is above 6V, an LDO can supply 5V even if the input is only 5.25V. It’s the same idea with different marketing.

Many hobbyist boards use some version of the 1117 linear regulator, and for good reason. The 1117 will give you a steady 5V output at up to 1.3A from input voltages up to 15V. It comes in a cheap, through-hole package that can be slapped right into a breadboard. Add two capacitors (one input, one output) and you have a rock steady voltage output, even as the battery voltage changes. Unfortunately, a linear regulator is really just a glorified resistor divider and is really designed to regulate voltages fairly similar to the desired output. It is slightly more efficient than the aforementioned 4W resistors, but will still burn quite a bit of heat if you are dropping from 9V to 5V. 

The Breakdown:

Pros: It’s cheap, easy, and the output doesn’t change as battery discharges.

Cons: It’s still very inefficient and it requires heat management.

See related product

LD1117V50

STMicroelectronics Linear Regulators View

DC/DC Power Converter: Most Efficient Solution

The most efficient way to get power to your Pi is with the use of a switching regulator. Stay tuned for more information on how to design your own circuit, but in the meantime, use a pre-designed DC/DC module like the CC6-1205SF-E from TDK-Lambda. It requires no external components, pops into a breadboard, and will give you efficiencies closer to 80% than the 50% or worse we were seeing with more primitive methods.

See related product

CC6-1205SF-E

TDK-Lambda DC to DC Converter and Switching Regulator Module View

The Breakdown:

Pros: It’s efficient, has no external components, and is truly plug and play.

Cons: It’s the most expensive solution.

If you’re wondering how to get the regulated 5V into the USB port, just buy a micro USB cable like the 687840002 from Molex, snip off the non-micro end, and connect your 5V to the correct power and ground wires. Leave the other wires unconnected and unstripped.

If you’re looking to battery power your Pi, you do have options. So long as you choose the method that works best for you and take the right precautions, you can power your design anywhere. 

Latest News

Sorry, your filter selection returned no results.

We've updated our privacy policy. Please take a moment to review these changes. By clicking I Agree to Arrow Electronics Terms Of Use  and have read and understand the Privacy Policy and Cookie Policy.

Our website places cookies on your device to improve your experience and to improve our site. Read more about the cookies we use and how to disable them here. Cookies and tracking technologies may be used for marketing purposes.
By clicking “Accept”, you are consenting to placement of cookies on your device and to our use of tracking technologies. Click “Read More” below for more information and instructions on how to disable cookies and tracking technologies. While acceptance of cookies and tracking technologies is voluntary, disabling them may result in the website not working properly, and certain advertisements may be less relevant to you.
We respect your privacy. Read our privacy policy here