For my data logger project, I used a Raspberry Pi 2 Model B to log the temperature and humidity in a room. To run the Pi, I used a 10000 mAh power bank and I wanted to test how long the Pi could operate and the current usage of the Pi. Below are my calculations after running the Pi while it's logging data until it ceased to operate.

From the log file inside my Pi, the amount of time the Pi operates is:

27.721 hours.

The power bank has a capacity of:

10 Ah * 3.7 V = 37 Wh

Power consumption of the Pi:

37 Wh / 27.721 h = 1.335 W

Current consumption:

1.335 W / 5 V = 267 mA

Is my understanding and calculation, in this case, correct?

  • 1
    In my experience the reality WRT to Pis and powerbanks is disappointing -- you'll probably find it will not last half as long as your calculations predict. I think part of the issue is that powerbanks are intended for recharging, which is a scenario opposite that of actively powering something in terms of responding to rapid fluctuations in current draw. Once the battery gets down to a certain point it will not respond well enough and the pi will die. This is significant enough that people have reported undervoltage warnings using the (greedier) Pi 3, even with the battery fully charged. – goldilocks Jun 19 '17 at 14:56

You are working on an assumption that the current draw is constant so you have calculated the average current draw. Looking at your calculations they do look correct.

If you look through the official documentation, you will note the idle current draw is 0.22A for a Pi 2 B. So your calculated value is certainly in the right place. A better way to measure the power usage of the Pi is to use some kind Watt-meter or data logger to give more accurate numbers. The benefit of such a device is being able to look over how the power usage changed over time.

I'm not sure you need that kind of accuracy using the data you collected a sensible suggestion would be to say the max time is 25 hours to give yourself some headroom.


Indeed, your calculus seems legitimate. Of course, it doesn't care about the fact that the RPi power consumption is not linear, as it depends of the CPU and external device usage, but your result will be enough to estimate how long your RPi will run on different batteries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.