I'm trying to calculate the energy consumption over a period of 1.3 seconds in joules (J).
I have a sample every 100 ms (0.1 second) with the current and voltage (in volts) (in practice, the samples have a much higher granularity, but for the sake of simplicity ;)).
|Time (s)||Current (mA)||Voltage (V)|
How can I calculate the consumed energy consumption in joules over this period of 1.3 seconds?
My idea was to:
- Convert mA to ampere by diving each mA value by 1000: e.g., 30.2, 30, 30.2, 30.1, 30, etc.
- Taking the mean of the current and voltage, 30.09 A and 3.59 V respectively..
- Multiplying these to get the power: 30.09 A * 3.59 V = ~108 W
- Since watt is also joules per second we multiply it by 1.3 to get the total consumed energy of this period in joules: 1.3 s * 108 W = 140.4 J.
Is this correct? Does it make sense? Are there better, more accurate ways to measure the energy consumption in joules over a period?