# How to calculate average power consumption in mAh?

I'm working on a device that sleeps for most of the time and occasionally wakes up and takes some sensor readings. This device will be battery powered so I'm trying to calculate how long it will run on a 2,000 mAh battery. A typical hour of application looks like this: It's easy for me to calculate how long each stage would take by itself (for example sleep could run for (2,000 mAh/.05 mA) = 40,000 hours) but I'm confused on how I would calculate every stage together and get an accurate calculation of how long the battery would last.

Thanks!

## 4 Answers

how I would calculate every stage together

Using $$1 \text{ mAh} = 1 \text{ mA} \cdot 3600 \text{ sec}$$

you can calculate the average as:

$$0.05 \text{ mA} \cdot 3473 \text{ sec} + 56 \text{ mA} \cdot 120 \text{ sec} + 0.44 \text{ mA} \cdot 6 \text{ sec} = 1.9 \text{ mAh}$$

get an accurate calculation of how long the battery would last

You can only use the number above to make a crude estimation how long the battery will last.
One reason is that for a high amperage the battery life will be shorter than the product mA times supply time.
Another reason is that the battery will self discharge.

Compute energy draw from Energy stored as 1st approximation.

Determine steady start & cutoff voltage e.g. 3.7 & 3.0V then mean voltage = 3.35V * 2.2Ah = 7.37Wh

Then addup consumed energy in Wh per cycle then compute total number of run cycles from ratio is one way.

If ESR rises to become significant with _ Amp current draw pulse then factor low voltage drop = Vbat- ESR*I into end of charge cutoff during tests.

You could compute this the manual way as Huisman notes for most accuracy, or you could use a calculator for rapid iterations.

Microchip makes a nice little tool called NanoWatt XLP BLE (Battery Life Estimator). Of course this is geared towards their products, but with a little fudging it will work to quickly estimate run-time of any system. I think a file can be edited to change the batteries and add new ones. It does not consider power supply loss - will have to de-rate for that: VirusTotal currently shows lone BitDefenderTheta as thinking this version is some obscure malware, but it is not. (Microchip, please digitally sign all installers, this is 2019 after all.)

mAh is not power it is charge. (Q = It)

A current of 1mA flowing for 1 hour conveys 3.6 coulombs.

Power in watts is volts x amps and Energy in joules is power x seconds.

Energy is the integral over time of the average of instantaneous power.