Working out mAh from current and time

If I know how many millamps I'm drawing, and also for how many milliseconds, how do I calculate this to mAh consumed?

-

3 Answers

There are 1000 milliseconds in 1 second. There are 3600 seconds in 1 hour. That gives us 3600000 milliseconds in hour.

Consumed charge will be:

C = I * t / 3600000

where [C] is charge in [mAh] and [I] is current in [mA], and [t] is time in [ms]

If you want to calculate/estimate battery life - keep in mind, that nominal battery capacity applies to some nominal current / load. If your device draws small current - you will have more available capacity, and if current is large - you may get less mAh than nominal capacity.

Battery discharging with pulses may also affect "available" energy.

See battery documentation for more information.

-
I chose yours as it was easier to understand, having a formula. thanks. – Hayden Thring Apr 18 '14 at 23:10
Erm, 1 mA over one second equals 1mC, not 1C. – Shamtam Apr 18 '14 at 23:39
@Shamtam Right. I removed wrong information. – Kamil Apr 20 '14 at 16:20

That should be easy - each hour lasts 3.6 million milliseconds so each milliampere-hour contains 3.6 million milliampere-milliseconds. You have to multiply the current by the number of milliseconds which will give you milliampere-milliseconds and then divide that by 3.6 million to get milliampere-hours.

-

Integrate the current over time and you have your charge. If you want that in mAh, divide by $3.6 \cdot 10^6$

-