What voltage range can it accept? What sort of batteries are appropriate?
-
2Do you consider this question to be unanswered? If so, could you tell me how to improve what I've contributed?– Andrew LarssonCommented Jun 29, 2012 at 16:22
-
1@AndrewLarsson, I was hoping for some concrete information about the acceptable voltage range. I know this has been asked elsewhere too though, and remains unanswered: raspberrypi.stackexchange.com/q/341/68 Until that question is answered, I don't really think this one should be finalised.– Highly IrregularCommented Jun 29, 2012 at 22:14
10 Answers
Standard USB uses 5V, and the Model B Pi claims to need 700mA. Taken from the Raspberry Pi FAQs:
The device should run well off 4 x AA cells.
If you were using 1.5V alkaline batteries, you would be oversupplying the board. As with most SoC-based computers, you should use NiMH batteries, as they supply an average 1.25V. This would leave your board at a safe, more controlled, 5V. The Pi will draw the correct amount of Amps it requires from the batteries, so you don't need worry there.
-
3NiMH batteries when freshly charged give an output of roughly 1.4V I think, and it drops to 1.2V after some use... will this be harmful? Commented Jun 12, 2012 at 21:06
-
@HighlyIrregular Most of them max out at 1.3V at full capacity and go down to 1.2V when needing to be charged. This won't be harmful. In fact, you may experience a slight performance boost when they're fresh off the charger. Commented Jun 12, 2012 at 21:09
-
1In my understanding, alkaline batteries have a high internal resistance so aren't suitable for devices drawing substantial current. This is why they aren't very suitable for digital cameras. I don't know whether they would be adequate for a Raspberry Pi or not though. Commented Jun 13, 2012 at 1:29
-
1They will work. They just won't last long (a little over 4 hours at 1000mAh each). Commented Jun 13, 2012 at 16:07
-
3I'd suggest using 5 batteries (7.5V alkaline, or ~6V NiMH) and a 5V LDO regulator. Of course, if you want longer runtimes, use larger batteries (like "C" cells) or hook more up in parallel!– Doktor JCommented Jul 31, 2012 at 19:28
Here's some comparison of various cheap options for battery power, that will all supply the Pi well within its specs: Running a Raspberry Pi from batteries [This link is actually dead -- and searching the domain for "raspberry batteries" fails -- but Pikamander2 suggested the below as edit which supposedly contains the original content(??). Hopefully this can be considered public domain. -> goldilocks]
Including content below:
Running a Raspberry Pi from batteries
One of the essential properties of a mobile, Raspberry Pi-based robot is that it needs to run on battery power - trailing a power cord around is not much use.
The problem is that the Pi takes an appreciable amount of current (say 500mA, depending on activity and attached peripherals), and needs a pretty narrow input voltage range (5V +/- 0.25V, or so). Because battery voltage varies pretty wildly depending on the current charge level, running directly from a battery is not really sensible.
So, I set about looking into various options for converting standard battery voltages into something suitable for the Pi.
Using a linear regulator
The traditional approach, back when I was first tinkering with electronics about 30 years ago, would be to put together enough batteries to get a significantly higher voltage than 5V (say, 4x non-rechargeable AA to get 6V, or 6x rechargeable AA for 7.2V), and then run that through a linear regulator (e.g. 7805-series IC) to get a steady 5V.
There are 2 main problems with this approach.
- Linear regulators are inefficient, and effectively burn off the excess voltage as heat. That means that you're just wasting battery life, and also probably have to deal with dissipating that heat with a heatsink.
- The Pi draws quite a lot of current, so it would need quite a large regulator, along with a large heatsink.
Fortunately, there are much better approaches nowadays, in the form of switched-mode regulators, which are much much more efficient, even at high currents.
Using an RC-model UBEC
Decent radio-controlled models, especially aircraft, often need an efficient, stable-voltage power supply running from a small, light battery. The standard approach for this is to use a rechargeable battery linked through a device known as a UBEC (Ultimate Battery Eliminator Circuit), which takes a higher voltage than the required output, and very efficiently down-converts it. Whereas a linear regulator feeding 500mA output from a 6V input would draw 500mA (leading to wasted power of (6-5)x0.5 = 0.5W), a UBEC will not need to draw the full 500mA from the input battery, and so wastes very little power.
Because UBECs are so commonly used for RC models, you can pick them up very cheaply, and they can generally handle some pretty high currents. For instance, I found a 4A model on eBay for about £1.50 including postage.
The drawback is that you need to supply more input voltage than the desired output voltage, which means you may need a lot of cells in the battery pack. Still, this is a very cheap option and works well.
Using a DC-DC converter
If weight is a priority, then keeping the number of battery cells to a minimum is important. Fortunately, there's a device called a DC-DC converter that works in a very similar way to a UBEC, but can work from an input voltage that's lower than the required output voltage. These are also typically really tiny.
Looking on eBay again, I found some really nice ones, which include a female USB-A socket. This means that you can use the same USB lead that you're probably using to power your Raspberry Pi, without any modifications. The price here was around £2.50, with free postage. Input voltage is 3-5V (ideal for 3x rechargeable AA), and output current is up to 1A, which should be plenty.
Using an integrated battery box
Finally, there are various solutions available which use rechargeable batteries plus a DC-DC converter, in a dedicated housing. These can be pretty nice, because they don't require any specialist assembly (e.g. soldering) - some even have the batteries already built in. The option I chose uses high capacity "18650" Lithium Ion cells (e.g. these, around £10 for a pair from eBay), and cost around £8 including postage. It can supply up to 2.5A, which is more than enough, and again has a built-in USB-B socket for easy connection, as well as a convenient USB-miniA socket for easy charging. Another nice feature of this type of box is that you can stick in anything from 1-4 cells, depending on how much battery life you need.
A drawback is that these boxes can be quite large. The one I chose is about the same size as the box that my Pi came in from Farnell.
If you do go for the 18650 option, then it's worth shopping around carefully. Some brands, most notably Ultrafire, have a poor reputation for quality and don't seem to live up to their rated capacities. These types of batteries are also prone to fire or explosion if used improperly - so you'll want to be very careful to look after them, and it's worth making sure that you're not using a dodgy brand.
Battery life calculations
I haven't experimentally verified any battery life figures for any of these options yet, although I have tested that my Pi runs happily from each of them (except, so far, for the UBEC).
When calculating theoretical battery life, because you're converting voltages, you can't go simply by the milliamp-hour (mAh) ratings printed on the battery. It's simplest to convert to watt-hours, which is simply voltage multiplied by the mAh figure. The RasPi needs approx 500mA at 5V, which is 0.5 x 5 = 2.5 watts. Assuming perfect efficiency in the converter (they're usually at least 90% efficient), a 1.5V AA cell with 1000mAh capacity would be able to supply 1.5Wh - i.e. run a RasPi for approx 1.5 / 2.5 = 0.6 hours (or 36 mins) on its own. With a switched-mode converter (i.e. any of the last 3 options), it doesn't really matter whether you connect multiple cells in series or in parallel - in each case, you're roughly multiplying the available capacity by the number of cells used.
Here's an easy side-by-side comparison of the options listed above. I hope it helps you to figure out an appropriate battery power solution for your Pi project.
Monitoring charge level
When running from batteries, it's wise to try to monitor the current charge level, so that you can estimate the battery life remaining. You can do this by observing the voltage across the battery - this will fall as the battery discharges. Apart from allowing for non-linear discharge curves (each cell type behaves differently, and has a different voltage range), there are two main difficulties with this when running a Pi from a voltage convertor.
- The input voltage at the Pi is always going to be a steady 5V, by design. So you need to connect wires from the input battery to your charge monitoring circuit, rather than being able to measure the voltage at the input to the Pi. For integrated battery boxes, this requires drilling some holes in the box to access the battery.
- The Pi does not have an analogue-to-digital convertor built in, so you can't directly measure the voltage using the Pi. You can get small, cheap, standalone ADC chips that are accessible using the Pi's GPIO pins (e.g. using I2C), which is probably the cheapest option. Personally, I have a lot of ATTiny85 microcontrollers lying around (essentially a mini-Arduino), and I'll probably look at using one of those to measure the analogue voltage, convert to a percentage remaining indication using software on the ATTiny, and then communicate that level to the Pi over I2C.
Unfortunately, you can't properly power down the Pi purely from software, so there's also a potential mini-project to provide a software-controllable, latching off-switch. Personally, I expect to just use the manual off-switch built into the battery box. If you're using Li 18650 cells, then it's worth getting the 'protected' type, as these automatically cut out at low voltages.
-
8Looks like some great info, @Fanjita. To avoid link rot, summarising it in a post is considered important though. Commented Jul 3, 2012 at 20:15
-
-
@Greenonline your cut and paste does not respect the original author's copyright. A summary is OK a complete copying is probably a bad idea. Commented Feb 25, 2015 at 3:36
-
2
-
1As original author of the content, I'll just confirm that I'm happy for the full quotation above to be preserved here. When I first posted, I thought that my personal blog would be immune to link rot - but then I had some hosting problems and haven't got around to restoring the domain. I guess I just learnt that you can't reliably predict the future!– FanjitaCommented Jan 18, 2016 at 12:05
It is inadvisable to run the RPi on batteries, as it has been designed to be powered by USB; USB power is regulated and accurately 5V. Most USB ports can supply ~500mA, whereas most USB chargers are designed to supply 1A. The RPi requires a minimum supply capable of 700mA, otherwise it may not boot properly.
It would be advisable instead to use a battery powered, emergency USB phone charger or wait for a LiPo shield, which will undoubtedly be developed.
-
My understanding of cellphones is that they'll accept a range of voltages... I guess this would mean I'd need to look for an emergency USB phone charger that regulates the voltage Commented Jun 12, 2012 at 21:24
-
Yes, maybe I should remove that hint or find an example? Commented Jun 12, 2012 at 21:25
-
While it is purely anecdotal evidence every USB charger I've seen is regulated so should be pretty good for running a RPI from. Probably better than a PC's USB power as the PC's has lots more devices causing noise on the +5V rail.– LovesThaCommented Jun 12, 2012 at 22:34
-
-
1
I got this battery powered USB cell phone charger, and a couple of lithium 18650 batteries. It did a pretty good job and ran for 5.5 hours when idle and over 4 hours when running a Quake 3 demo loop. You can read about my testing methodology here. These 18650 lithim batteries work great because they are high enough voltage that just 2 batteries will easily do the job, and they are also rechargeable. They also provide quite a bit of power and allow you to use the Pi for many hours even under full load. I would think that these batteries would be a good choice for anybody looking to power their Raspberry Pi from batteries.
-
I tried exactly the same setup and my LCD screen was blinking (and the pi was not starting) and then the phone charger broke: some smoke and it was gone. Commented Sep 4, 2015 at 9:43
http://elinux.org/R-Pi_Troubleshooting#Troubleshooting_power_problems suggests that the voltage needs to be between 4.75 and 5.25 V, suggesting that 4 NiMh batteries at 1.2V each should be 4.8V, within range. However, fully-charged NiMH batteries can go up to 1.4V * 4 = 5.6V, well over the maximum. If you test your batteries and find that they only go as high as 1.3V when fully-charged, they should be OK. The best solution is probably to use a switching DC-DC converter to convert from whatever your batteries put out to 5V.
-
Have you got a particular DC-DC converter in mind? Or maybe, a specific circuit? Commented Jul 4, 2012 at 6:34
Here is what I did and it seems to work well: You will need a 8xAA battery pack with a 9v battery like power connector. A 2Amp USB car adapter Optional - A plug to plug into the car adapter, otherwise just take the adapter apart.
Solder the center pin on the car adapter to the positive from the battery pack, or if you used the cable the appropriate wire. And solder the negative to the outer on the adapter
I then got 8xAA 2500mAh rechargable NiMH for a total possible of 24wH's. This should be good for a while.
I am measuring a steady 5.08v on the usb plug from the adapter. This will depend on the quality of the one you buy/have. I used a rayovac adapter.
The batteries will put out around 10-11V before the adapter.
The pi needs 5V if not a little more. The adafruit adapter is 5.25V
http://elinux.org/RPi_5V_PSU_construction is helpfull too.
I also measured the current draw from the battery pack when it was 10V at 0.54A. The device had a hub, Logitech Quickcam 9000, Netgear N150, and a USB2Serial adapter and the CPU was at 70-100%. At idle it was 0.38A. At poweroff it measured 0.14A. With only the Pi it idled at 0.24A. Under Load at 900Mhz, it only used 0.27A. When the device is idle it clocks down to 250Mhz. It does not look like the clock speed makes much difference or the cpu load.
So at 5W with all devices I should get about 4-5hrs, give or take, but 8-9hrs with just the Pi and ethernet.
-
I forgot to mention. This also powers my USB2 hub which has a serial to usb adapter, a web cam, and a 802.11N adapter.– BeachedCommented Dec 1, 2012 at 5:10
-
1
-
2I'd like to pick a nit here if I may. If you arrange the batteries in series, the current capacity of the assembly is the same as that of one battery, not the sum of the capacities of the individual batteries. However, for a parallel arrangement, the capacity would be the sum. Think of it this way. If one battery can supply 1.5v x 2500mAh = 3750mWh, 8 (in any arrangement) can provide 30000mWh. 30000mWh / (8 x 1.5v) = 2500mAh. For the parallel assembly, 30000mWh / 1.5v = 20000mAh. 20000mAh / 8 = 2500mAh. QED– CPRitterCommented Dec 2, 2012 at 12:49
-
1I wonder if the car adapter would supply the required 5v if it itself were fed with less than the 10v or so in your rig-up. Have you tried it with fewer batteries? It may result in less waste heat which in turn would retard global warming, the inexorable increase of entropy and the Universe's march to its own heat death.– CPRitterCommented Dec 2, 2012 at 13:15
-
1Crap, you're correct. I'll update. It's only going to be about 5hrs. I measured the current @10V to be 500mA. So 5W of power are needed. 1.2V(The rechargeable) x 8 will give 24wH, so 4.8hrs. Either way, if you want to use a AA battery pack, it will probably be 8 batteries.– BeachedCommented Dec 8, 2012 at 0:11
I am using Rpi with cheap DC-DC converter. Used it with airsoft batteries and RC models batteries (7.2V and 11.8V). Works as a charm. Look like my 5000mah 11.6V battery can power it for days.
Just be careful to configure it prior to using. I am testing it with every new battery before connecting to Rpi.
I see at least 2 points to consider.
1. Efficiency of power regulator
If you are using battteries, you are probably worrying about power consumption of your Rpi. Rpi uses unefficient linear regulator (typical power efficiency of those are around 30-50%. But I am not sure for Rpi lin. regulator!). Linear regulator dissipates energy as heat to obtain desired voltage rail, i.e. 3.3V. The general rule regarding power line translation, e.g. USB@5V -> [email protected], is: the larger the input voltage, the larger is the dissipation on regulator for same working conditions. On the other hand, swithing regulator provides higher efficiency, typ. 80-85%, even up to 97%(LM2651). And it is more suitable (but also more expensive!), when you have need for larger voltage drop, e.g. battery pack's 12V or 24V to 5V.
You can find lots of tutorials to replace the original Rpi regulator on the Internet.
2. Battery type
You can make your own battery array using LiPo batteries to suite your project and then you can adjust dimensions, capacity, min. voltage and current specs, etc. You can purchase different types of LiPoly on frequently used e-markets, like eBay or similar. In addition to capacity, you should be careful about max. and standard dicharge current(needed if using high-power devices along Raspberry like UMTS modems), cycle life(typically 200-1000 for cheap LiPoly) and safety and protection specs(discarge, short circuit, overvoltage, undervoltage, etc.). I used LiPoly batteries in many projects due to good availability and performance vs. price ratio.
You can read more about LiPoly on RC forums.
This is a rather expensive USB battery pack, but its very versatile, and you will find several uses from it, other than a battery-backup for your pi.
This is probably wrong but have you tried getting 2 batteries then snipping the wire off then attaching it to 4 batteries.
-
1Snipping what wire off? Batteries don't usually have wire attached Commented Jul 4, 2013 at 4:26
-
1Try and improve your answer by describing what you mean by using a diagram or a picture. I am not sure what you are trying to say here. Commented Jul 4, 2013 at 10:09