## Power Consumption Rate of Pi2 on USB Battery Bank?

Cael
Posts: 86
Joined: Sat Jul 07, 2012 7:08 am

### Power Consumption Rate of Pi2 on USB Battery Bank?

while i know my lil cheapie one wont work w/ the Pi3 (verry unstable/constant reboots.) i've been testing my Pi 2 w/ stock Clockspeeds, using these for headphones: http://www.microcenter.com/product/4396 ... ne_-_Green and a Tenda W311M MicroUSB Wifi N Adapter. (no keyboard or anything else attached.)

it's atm 2:48AM EDT, i started Measuring at 11:45PM EDT 3/17/2016 so sofar lil over 3hrs on WHAT im guessing is an 1850mAh/2600 2.2A USB Power Bank ( its one of these lil things. http://www.dhresource.com/albu_36445068 ... rtable.jpg )

the Battery bank went into "Low Charge" at 1:59AM EDT (blinking Blue LED) still is going at 2:55AM EDT

on an Average USB Power bank of 1850mAh & 2600mAh what would be the runtimes to Expect? (if i could find a power bank that pushed out a solid 2.5/3A i'd look into the PiGRRRL kit but power it w/ one of these. )

mosespi
Posts: 508
Joined: Mon May 12, 2014 3:35 pm
Location: 34,-118
Contact: Website

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Calculate it.. its not very difficult to get a fairly accurate estimate...

from the FAQ https://www.raspberrypi.org/help/faqs/
a Pi 2 at idle takes about 0.22a (I assume at 5v), you can buy cheap inline USB measuring devices online to verify.

To make it easy I suggest you convert everything to watts..

P2 power usage 0.22a x 5v = 1.1w
Approx wifi and other usage estimate = 1.0w
Approx Total 2.1w

1850mAh power bank x 3.7v* = 6.845w
2600mAh power bank x 3.7v* = 9.62w

The powerbank wastes some power generating 5v from 3.7v.. we can assume about 80% efficiency (a good guess).. so the total power available to our Pi then becomes..

1850mAh power bank x 3.7v* = 6.845w x 0.80 = 5.476w
2600mAh power bank x 3.7v* = 9.62w x 0.80 = 7.696w

Then our runtime is..
1850mAh power bank x 3.7v* = 6.845w x 0.80 = 5.476w / 2.1w = 2.61 hours
2600mAh power bank x 3.7v* = 9.62w x 0.80 = 7.696w / 2.1w = 3.67 hours

There you have it, basic USB Powerbank math.

* NOTE: We use 3.7v since almost all powerbanks state the mAh of their battery, which is usually a LI-ION cell at 3.7v

Regards,
-Moses
Power problems? MoPower UPS for the Pi
http://www.allspectrum.com/mopower/

Cael
Posts: 86
Joined: Sat Jul 07, 2012 7:08 am

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

it Just died at 4:20am EDT leaving roughly 4hrs and 35min Runtime. i wonder if a lower clockspeed would have any effect,

blc
Posts: 465
Joined: Mon Sep 05, 2011 9:28 am

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

mosespi wrote:Calculate it.. its not very difficult to get a fairly accurate estimate...

from the FAQ https://www.raspberrypi.org/help/faqs/
a Pi 2 at idle takes about 0.22a (I assume at 5v), you can buy cheap inline USB measuring devices online to verify.

To make it easy I suggest you convert everything to watts..

P2 power usage 0.22a x 5v = 1.1w
Approx wifi and other usage estimate = 1.0w
Approx Total 2.1w

1850mAh power bank x 3.7v* = 6.845w
2600mAh power bank x 3.7v* = 9.62w

The powerbank wastes some power generating 5v from 3.7v.. we can assume about 80% efficiency (a good guess).. so the total power available to our Pi then becomes..

1850mAh power bank x 3.7v* = 6.845w x 0.80 = 5.476w
2600mAh power bank x 3.7v* = 9.62w x 0.80 = 7.696w

Then our runtime is..
1850mAh power bank x 3.7v* = 6.845w x 0.80 = 5.476w / 2.1w = 2.61 hours
2600mAh power bank x 3.7v* = 9.62w x 0.80 = 7.696w / 2.1w = 3.67 hours

There you have it, basic USB Powerbank math.
You missed a bit . If we're talking about LiIon/LiPo cells you need to account for the fact that you can't actually use 100% of the capacity of a cell. There's usually a discharge threshold beyond which the cell will be damaged if you continue to drain it (sometimes leading to "thermal runaway", aka "your cell bursting into flames"). Most protection circuits - such as those present in USB power banks - have a cut-off voltage which is well above the threshold for the cell.

If you really want to calculate this accurately you'll need to know what this threshold voltage is for the cell you're using - typically the data sheet will state the minimum voltage the cell should get to. You'll then need to know what the cut-off voltage of the protection circuit is. Using the discharge curve in the cell data sheet you should be able to estimate how much of the cell's capacity you can actually use before the low voltage cut off kicks in.

Or you can use a rough "rule of thumb" and assume that you can't use more than 70%-80% of the cell capacity. Either way, your calculations now look like this - obviously substitute my capacity/draw numbers for yours:
blc wrote:
1. Adjust for cell characteristics & discharge curve: 2.5Ah * 80% = 2Ah
2. Convert to watt-hours: 2Ah * 3.7v = 7.4Wh
3. Adjust for regulator efficiency: 7.4Wh * 90% = 6.66Wh
4. Calculate load power consumption in watts: 5v * 0.5A = 2.5W
5. Divide cell capacity by power consumption: 6.66Wh / 2.5W = 2.664hr
Total cell capacity: 6.66Wh
System power draw: 2.5W
Estimated runtime: 2.664Hrs

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

You've got me thinking now,
I have a Maplin 6000 Ma power bank, and running a Pi1 with Wifi and a Pi camera making a timelapse video gave me around 8 hours useage before shutdown. Im wondering how long I'll get out of my Zero, Im going to fully charge my power bank tonight and give it a try. I expect to get a lot better than the Pi1, the Zero will just have Wifi for remoting into. It generally does Get_Iplayer and Sabnzbd.

Steve

blc
Posts: 465
Joined: Mon Sep 05, 2011 9:28 am

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

startrek.steve wrote:You've got me thinking now,
I have a Maplin 6000 Ma power bank, and running a Pi1 with Wifi and a Pi camera making a timelapse video gave me around 8 hours useage before shutdown. Im wondering how long I'll get out of my Zero, Im going to fully charge my power bank tonight and give it a try. I expect to get a lot better than the Pi1, the Zero will just have Wifi for remoting into. It generally does Get_Iplayer and Sabnzbd.

Steve
Let's do some maths!

Let's assume that your Zero is running at full tilt for the entire duration and that the USB WiFi draws 150mA (and is also constantly running at full tilt). These are pessimistic estimates, so consider it a "worst case" scenario. These estimates also mean I can use the power consumption numbers that Alex Eames measured for the Zero (here http://raspi.tv/2015/raspberry-pi-zero- ... asurements) and two different USB WiFi dongles (here http://raspi.tv/2014/pihut-wifi-dongle- ... ower-usage).

I'm massively over-estimating the USB WiFi power draw though. Alex measured two specific products, but you might not be using those specific products and you can't always assume that all the bajillion different USB WiFi dongles out there are designed with low power consumption in mind. The Pi Zero however is far easier to quantify: there's only one version of it out there!
• Power Bank Capacity: 6Ah
• Usable Cell Capacity: 70% - a pure estimate, since we'll probably never find the cell data sheet
• Regulator Efficieny: 80% - another estimate, since you won't find the data sheet for the charging IC unless you rip apart the power bank
• Adjusted Power Bank Capacity: 12.432Wh - ((6Ah * 70%) * 3.7v) * 80%
• Pi Zero Power Consumption: 0.14A
• USB Wifi Power Consumption: 0.15A
• Total Power Consumption: 1.45W - (0.14A + 0.15A) * 5v
Therefore....

Estimated runtime: 8.573793Hrs (12.432Wh / 1.45W)

As I said though, this is probably a worst-case scenario. To get a more accurate estimate you'd have to measure everything: cell voltage when the power bank is "empty" (to measure the usable capacity of the cell); efficiency of the voltage regulator in the power bank; actual current consumption of your load; etc...

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Hmm yes, I was thinking more in the area of 24 hours...
We'll see at the weekend eh?

Steve

blc
Posts: 465
Joined: Mon Sep 05, 2011 9:28 am

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

startrek.steve wrote:Hmm yes, I was thinking more in the area of 24 hours...
We'll see at the weekend eh?

Steve
I did say it was probably "worst case" numbers. If you want a more accurate estimate then you have to measure (or test) everything.

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

You don't need to adjust cell capacity because of the cutoff voltage, the capacity rating is from full charge (4.2V) to cutoff voltage for the cell at a 1C discharge rate.

If you put a fully charged 1800mAh cell on a discharger/tester and set it for a constant current discharge at 1C (1.8A) you'll get about 1800mAh by the time it reaches cut-off voltage. And since you're discharging at a fixed 1C rate that will take about an hour.

If you want to be precise in the calculations you do need to adjust the mAh the cell will actually provide, since the cells rating is at 3.7V and you're boosting it to 5V.
3.7 x 1800 = 6660 watt hours. 6660 / 5 = 1332. So an 1800mAh cell is only going to provide 1332mAh capacity at 5V.

That's the reason for the "lost" capacity. It's not because you can't discharge the cell all the way down to get the rated capacity, it's because you're using a 3.7V cell to produce 5V, and power in always has to equal power out, less losses.

blc
Posts: 465
Joined: Mon Sep 05, 2011 9:28 am

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

JimmyN wrote:You don't need to adjust cell capacity because of the cutoff voltage, the capacity rating is from full charge (4.2V) to cutoff voltage for the cell at a 1C discharge rate.

If you put a fully charged 1800mAh cell on a discharger/tester and set it for a constant current discharge at 1C (1.8A) you'll get about 1800mAh by the time it reaches cut-off voltage. And since you're discharging at a fixed 1C rate that will take about an hour.

If you want to be precise in the calculations you do need to adjust the mAh the cell will actually provide, since the cells rating is at 3.7V and you're boosting it to 5V.
3.7 x 1800 = 6660 watt hours. 6660 / 5 = 1332. So an 1800mAh cell is only going to provide 1332mAh capacity at 5V.

That's the reason for the "lost" capacity. It's not because you can't discharge the cell all the way down to get the rated capacity, it's because you're using a 3.7V cell to produce 5V, and power in always has to equal power out, less losses.
Surely this is going to be dependant on the individual cell, and how the manufacturers/OEMs report that capacity? The OEM might simply see "2Ah capacity" in the data sheet and market their product as having a 2Ah capacity, when in fact the true nominal capacity might only be 1.8Ah. Isn't it better to have a rough margin as a rule of thumb rather than underestimating and leaving yourself short? Or I could indeed be way off and it could be the case that the capacity reported is the actual usable capacity of the cell - in which case, given the number of different manufacturers out there, I wouldn't trust that every single one is reporting their numbers accurately, and I'd want to see the data sheet. There's marketing involved here; I trust marketing about as far as I'd trust a clingfilm teapot.

Also, you're not accounting for regulator efficiency. No voltage converter/regulator can be 100% efficient, because physics. Even if we don't account for cell discharge curves, you still can't say that a 3.7v 1.8Ah cell will provide 6.66Wh total capacity - you have to account for the fact that energy will be lost in the conversion from 3.7v to 5v. Since we probably won't know the actual efficiency of the regulartor circuit used in a USB power bank without ripping the product apart (or inferring it via extensive testing), it's reasonable to apply a "rule of thumb" estimate. Efficiencies of 90%-95% are easily achievable, but we can't always assume that such high quality products/circuits/ICs will be used - and it's going to depend on how the circuit is designed, the quality of the materials/components used, etc... So knock that top-end efficiency rating down some - I don't think 80% is an unreasonable figure. If anything I think that's rather optimistic, if you pick up one of those cheap boost converters doing the rounds on Amazon or fleaBay and test it I'd be willing to bet it doesn't even get 70% efficiency.

Like I said in my earlier post though, if you want more accuracy than "rule of thumb" estimates then you have to measure everything:

If you don't know the actual capacity of the cell when discharged at 1C then measure it.
If you don't know the efficiency of the regulator then measure it - use a known current load, such as a dummy load, and at the same time measure the current going from the cell to the regulator and from the regulator to your load (i.e., before and after current conversion).
If you don't know the actual power consumption of your load then measure it - in the case of a Raspberry Pi if you test it at idle and under full load and then estimate how long your load will spend in each of these states then you can arrive at a nominal power draw and get an even more accurate estimate.

EDIT: Also, it's far easier to work in watts/watt-hours when you're dealing with different voltage levels.

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Well that was a miserable failure!
My system requires a USB stick to store data on, so I had to use an unpowered hub for that and the Wifi dongle. All started well, but after 3 hours 50 mins, the Wifi dongle powered down, the pi seemed powered up (its headless) but as the only way I could see what was going on was with SSH, I couldnt verify this. When I power cycled, it came back up still on battery. I put the max usb setting in config.txt, but havent tried again yet. Maybe If I could display the uptime info every minute or so & plug into hdmi I could view status without wifi. Any Ideas?

Steve

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Do you have spare GPIOs?

Add an LED matrix display and a pushbutton (to activate the display).

Push the button to display the uptime.
Doug.
Building Management Systems Engineer.

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Im going to have a script run every 2 minutes appending the uptime to a txt file. See how that goes.

Steve

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

BMS Doug wrote:Do you have spare GPIOs?

Add an LED matrix display and a pushbutton (to activate the display).

Push the button to display the uptime.
Wouldnt that use a lot more power? Im trying to get a long uptime on battery.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

startrek.steve wrote:
BMS Doug wrote:Do you have spare GPIOs?

Add an LED matrix display and a pushbutton (to activate the display).

Push the button to display the uptime.
Wouldnt that use a lot more power? Im trying to get a long uptime on battery.
A display like this one (below) would use a small amount when you push the button, otherwise it shouldn't use any.

(whereas a backlit LCD screen would consume power all the time).
Doug.
Building Management Systems Engineer.

Koeshi
Posts: 228
Joined: Sun Mar 20, 2016 11:16 am

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

blc wrote: Surely this is going to be dependant on the individual cell, and how the manufacturers/OEMs report that capacity? The OEM might simply see "2Ah capacity" in the data sheet and market their product as having a 2Ah capacity, when in fact the true nominal capacity might only be 1.8Ah. Isn't it better to have a rough margin as a rule of thumb rather than underestimating and leaving yourself short? Or I could indeed be way off and it could be the case that the capacity reported is the actual usable capacity of the cell - in which case, given the number of different manufacturers out there, I wouldn't trust that every single one is reporting their numbers accurately, and I'd want to see the data sheet. There's marketing involved here; I trust marketing about as far as I'd trust a clingfilm teapot.
As standard Li-ion battery life is given for the time between 4.2V and 3.2V, hence why the batteries are rated as 3.7V because it is there middle ground. If you are getting batteries from a reputable company such as Samsung or LG then the battery specs reported will likely be very accurate, admittedly tested under ideal conditions. You will also likely be able to find the spec sheets with relative ease. If you can't find it yourself try looking on vaping forums, they love 18650 batteries. Buying batteries from less reputable sources such as TrustFire mean you accept the risk of an explosion, particularly if you are running them at high amperage. If you want to learn more about batteries this is a great place to look: http://batteryuniversity.com/learn/

If you are looking for reviews of specific batteries try here: http://www.torchythebatteryboy.com/p/18 ... rgers.html

blc
Posts: 465
Joined: Mon Sep 05, 2011 9:28 am

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Koeshi wrote:As standard Li-ion battery life is given for the time between 4.2V and 3.2V, hence why the batteries are rated as 3.7V because it is there middle ground. If you are getting batteries from a reputable company such as Samsung or LG then the battery specs reported will likely be very accurate, admittedly tested under ideal conditions. You will also likely be able to find the spec sheets with relative ease. If you can't find it yourself try looking on vaping forums, they love 18650 batteries. Buying batteries from less reputable sources such as TrustFire mean you accept the risk of an explosion, particularly if you are running them at high amperage. If you want to learn more about batteries this is a great place to look: http://batteryuniversity.com/learn/

If you are looking for reviews of specific batteries try here: http://www.torchythebatteryboy.com/p/18 ... rgers.html
I know all this, it's kinda my point: you can make general assumptions, but if you really want to make accurate estimates then you need the data sheets .

EDIT: In fact, one of Torchy's discharge curves proves the point:

If your protection circuit cuts off at 3.2v, then the relatively high-quality Torchy cell had only discharged 85% of its nominal capacity. Torchy discharged them to 2.75v but even then it only got to 95% of the capacity. Sure that's pretty high, but it's still not 100% and generally you wouldn't go down to 2.75v in consumer gear.

It kinda makes my point for me: rules of thumb are good for estimates, but to get an accurate estimate you have to go to a data sheet; if you want to get solid numbers then you have to test it .

Koeshi
Posts: 228
Joined: Sun Mar 20, 2016 11:16 am

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

blc wrote:
Koeshi wrote:As standard Li-ion battery life is given for the time between 4.2V and 3.2V, hence why the batteries are rated as 3.7V because it is there middle ground. If you are getting batteries from a reputable company such as Samsung or LG then the battery specs reported will likely be very accurate, admittedly tested under ideal conditions. You will also likely be able to find the spec sheets with relative ease. If you can't find it yourself try looking on vaping forums, they love 18650 batteries. Buying batteries from less reputable sources such as TrustFire mean you accept the risk of an explosion, particularly if you are running them at high amperage. If you want to learn more about batteries this is a great place to look: http://batteryuniversity.com/learn/

If you are looking for reviews of specific batteries try here: http://www.torchythebatteryboy.com/p/18 ... rgers.html
I know all this, it's kinda my point: you can make general assumptions, but if you really want to make accurate estimates then you need the data sheets .

EDIT: In fact, one of Torchy's discharge curves proves the point:

If your protection circuit cuts off at 3.2v, then the relatively high-quality Torchy cell had only discharged 85% of its nominal capacity. Torchy discharged them to 2.75v but even then it only got to 95% of the capacity. Sure that's pretty high, but it's still not 100% and generally you wouldn't go down to 2.75v in consumer gear.

It kinda makes my point for me: rules of thumb are good for estimates, but to get an accurate estimate you have to go to a data sheet; if you want to get solid numbers then you have to test it .
I think in Torchy's case he was using IMR batteries so there was no protection circuitry. So yes you are right you would not normally go that low, though that said if you are willing to sacrifice the battery you can just keep draining it until there is no voltage left or it vents.

But really part of what I was trying to say is that the data sheets are available normally, they are just a bit difficult to dredge up because not many people take an interest in them.

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Ok,
ran the test last night,
Zero with unpowered USB hub connected to WiFi Dongle and 8GB usb stick - 11 hours 51 minutes,
didnt quite make the 12 hour mark. The Wifi kept dropping and reconnecting, and the USB stick dismounted after around six hours. I going to do a bare installation and run that with no peripherals. I reckon I can get maybe 16 hours with that setup.
Steve
Last edited by startrek.steve on Fri Apr 01, 2016 11:28 am, edited 1 time in total.

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Bare Zero with no peripherals, now running uptime of 16 hours 35 mins. Still powered up!

Steve

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

As of 7:30 this morning, 36 hours and still running!

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

OK, Zero with no WiFi on a 6000 MA power pack
final time:
42 hours, 29 minutes

Next test
(When I recharge the power pack),
the same with WiFi plugged in.

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Started latest power test:
Pi Zero with WiFi dongle connected and functional.
Latest uptime:
13 hours 30 minutes...
still running..

Steve

startrek.steve
Posts: 383
Joined: Thu Aug 30, 2012 7:19 pm

### Re: Power Consumption Rate of Pi2 on USB Battery Bank?

Final result:
Pi Zero with WiFi
6000 mA Power Pack
21 hours 58 minutes.
Interesting, almost exactly half of the same test without Wifi. I wonder how it would do with a USB to RJ45 network adapter?

Steve