# Calculating current consumption

#### lyklaglass

Joined Oct 26, 2021
2
Hi all.

I'm trying to calculate current consumption regarding energy used by a embedded system.

Lets give us the following

The current consumption of an embedded system in work mode x is 10mA.
The current consumption of an embedded system in work mode y is 50mA.

and lets say that the system is 8 hours in work mode x and 12hours in work mode y, and I want to present the total energy used.

Is it wrong to calculate it as follows:

10mA*8h + 50mA*12h= 80mAh+600mAh = 680mAh

thanks!

#### Papabravo

Joined Feb 24, 2006
17,296
Current consumption is expressed in Amperes, not mAh. The average current consumption would be:

680 mAh / 20 hrs = 34 mA

Take the average current consumption and multiply it by your power supply voltage to get average power over the 20 hour period. For example if the embedded has a 3.3 Volt power supply that would be:

34 mA * 3.3 VDC = 112.2 milliwats would be the average power used per hour.

Now you can still multiply that be the 20 hours to get 2.244 Watt hours

It is true that if you multiply 680 mAh by 3.3 VDC you get the same 2.244 Watt hours.
Units are important.

#### dcbingaman

Joined Jun 30, 2021
498
Energy used in any electrical system is measured in joules. To find out how much energy is used in a given period of time simply take the power in watts (joules/sec) and multiply by the number of seconds for total joules used. You need to know the voltage for the system along with the current.

current is just coulombs/second and voltage is just joules/coulomb multiplying the two coulombs cancel giving you joules per second which is watts.

For a given voltage the total energy used in your example would be:
0.01A*V*8Hrs*3600s/hour + 0.05A*V*12Hrs*3600s/hour = (288+2160)*V Joules

Assuming V=3.3V total energy used during this 12+8 hour period (20 hour period) would about:
8,078 Joules

#### dcbingaman

Joined Jun 30, 2021
498
Hi all.

I'm trying to calculate current consumption regarding energy used by a embedded system.

Lets give us the following

The current consumption of an embedded system in work mode x is 10mA.
The current consumption of an embedded system in work mode y is 50mA.

and lets say that the system is 8 hours in work mode x and 12hours in work mode y, and I want to present the total energy used.

Is it wrong to calculate it as follows:

10mA*8h + 50mA*12h= 80mAh+600mAh = 680mAh

thanks!
Did you mean you are trying to calculate the energy used by a system in x amount of time? Is this because you are using a battery and want to calculate battery life? In that case battery life is generally measured in Amp-hours. (or mA-Hours), your original calculation is correct. But if you mean actual energy (work) used, see my other post.

#### MisterBill2

Joined Jan 23, 2018
9,838
Current consumption is expressed in Amperes, not mAh. The average current consumption would be:

680 mAh / 20 hrs = 34 mA

Take the average current consumption and multiply it by your power supply voltage to get average power over the 20 hour period. For example if the embedded has a 3.3 Volt power supply that would be:

34 mA * 3.3 VDC = 112.2 milliwats would be the average power used per hour.

Now you can still multiply that be the 20 hours to get 2.244 Watt hours

It is true that if you multiply 680 mAh by 3.3 VDC you get the same 2.244 Watt hours.
Units are important.
Battery capacity is commonly given in amp hours and milliamp hours and so power is commonly expressed in watt hours. So the power consumed will be the sum of the watt hours consumed in each mode. Converting watt hours of power into units of energy is another step that needs to be done. Usually, if you are running the system on battery power, it is the amphours consumed versus the battery capacity amp hours that is the challenge. But your case may be different

#### lyklaglass

Joined Oct 26, 2021
2
Thank you all for your input!

I'm sorry for the confusion regarding the mixup with the terms energy and current consumption.

What I'm trying to do is show the total current used by the system over time so I can calculate the required battery size.

Thanks,

#### Yaakov

Joined Jan 27, 2019
3,755

#### BobTPH

Joined Jun 5, 2013
4,048
Current already contains the element of time. Total current over time does not make sense.

That would be like asking what the total MPH on a car trip. In both cases, you are want an average.

Bob

#### MisterBill2

Joined Jan 23, 2018
9,838
Given that the TS has already told us the time the system spends in each of the modes, and the current draw in each of those modes, which must certainly be an average, it is simple to determine the number of amp-hours consumed in each mode, and thus the total numbers of amp-hours per day. Given that battery capacities are stated in amp-hours, it seems that the arithmetic will be rather simple. Certainly the stated power draws are already averages, what more could we ask for? And of course there does need to be an adequate margin of capacity because exceptions do happen.