1
\$\begingroup\$

I'm getting measurements from an IoT device.

This measurements are in amps (I get one every 2 min or so).

I know the voltage of the device.

From what I've seen online I can calculate the power in kW doing \$P = I * V / 1000\$

Is there any way from this information for me to calculate the kWh for this device?

I've seen on another platform that to do that with the same data than me, they basically put everything in a graph and calculate the integral on one hour and use that to deduct the power consumption of the device, but it seems wrong instinctively.

I'm not very qualified with this electrical problematic so please keep that in mind.

Example of measurement taken at different times :

  • 11:00 => 19.56 amp => 4.49 kW
  • 12:00 => 20.8 amp => 4.78 kW
  • 13:00 => 21.7 amp => 5 kW
  • 14:00 => 18.2 amp => 4.18 kW
  • 15:00 => 13.04 amp => 3 kW

Would that mean that my power consumption is 4.49 + 4.78 + 5 + 4.18 + 3 = 21.45 kWh ?

\$\endgroup\$
8
  • 1
    \$\begingroup\$ I * V gives instantenous power at any time in watts. So if you accept your measurements are constant all over the time, which will not be, (I * V * time elapsed) could be a good approximation. However, for a realistic approach, you monitor the data for a period, and then integrate the I * V vs time graph to get total energy consumption. The conversions from watts or watt-hours to kilowatt or kilowatt-hours range is just a mathematical modification. Note that, watt(joules per sec) is the unit of power and energy(joules) is just power times the amount of time elapsed. \$\endgroup\$
    – muyustan
    Commented Dec 30, 2019 at 21:44
  • \$\begingroup\$ You're almost there. You've got the power. Now just multiply by the time that power is used. In your example, if your device uses 10 watts for 1 hour, the energy usage 0.01 Kw-hr. That's basically integrating the power (10 watts) over the time (1 hour). \$\endgroup\$
    – SteveSh
    Commented Dec 30, 2019 at 21:45
  • 1
    \$\begingroup\$ If you accept(you should not) the power "4.49kW" constant all over between 11:00 and 12:00 and same for other 1 hour intervals, then your calculation in your example is correct. See, you have power which is a measure of how much joules per one second you consume, then multipliying that power with the time duration of consumption, you get total consumed energy. However, in real cases, the power consumption will be different all the time, which leads, for a better estimation, you have to narrow the time between measurements, as much as possible. As your sampling period approaches to zero,.... \$\endgroup\$
    – muyustan
    Commented Dec 30, 2019 at 22:14
  • 1
    \$\begingroup\$ the summation approaches to what it is known as integration. \$\endgroup\$
    – muyustan
    Commented Dec 30, 2019 at 22:14
  • 2
    \$\begingroup\$ Agree with what muyustan said. What you're doing is just an approximation of the integration function of power over time. If your load (current usage) doesn't vary much with time, and it looks like it doesn't in your example, you're close. \$\endgroup\$
    – SteveSh
    Commented Dec 30, 2019 at 22:30

1 Answer 1

2
\$\begingroup\$

When you calculate kWh you are actually calculating energy, which is indeed the integral of power over time.

When you get discrete measurements of power, the easiest thing to do is to assume that the power remained constant for the entire time period since the previous measurement. So, multiply each power measurement by the time since the last power measurement and you have an estimate of how much energy was consumed since the previous measurement. Just add up these energy estimates for as long as you like, and you have an estimate for the total energy consumed over that period of time.

Be sure to mind the time units when making these calculations. It might be easiest to calculate watts times seconds (which equals joules) at each measurement interval. After you have added the number of joules that were used you can convert to watt-hours by dividing by 3600 (number of seconds in an hour). Divide again by 1000 to get kWh.

\$\endgroup\$
6
  • \$\begingroup\$ Hi, just what I don't understand is when I'm getting a 20 amp measurement for example, and I want to know for an hour, do I assume this 20 amp was for one second ? Why not 1/10 second or less ? \$\endgroup\$
    – Bdloul
    Commented Dec 30, 2019 at 22:09
  • \$\begingroup\$ What I'm really confused about is, if you drive 60km in 30min, you're driving at 120km / hour, but if you consume 30 kW and use your device for 6 hours it's 180kWh ? Does that mean that kWh is not an average the same way speed is ? \$\endgroup\$
    – Bdloul
    Commented Dec 30, 2019 at 22:12
  • \$\begingroup\$ @Bdloul link speed(meter/sec) to power(joules/sec or watts) and displacement(m) to energy consumption(kWh or joules). Actually displacement can be 0 if you start and finish at the same point, which is not the case for power consumption. So better is to think total movement done instead of displacement. \$\endgroup\$
    – muyustan
    Commented Dec 30, 2019 at 22:16
  • 3
    \$\begingroup\$ No, kWh is not an average it is a total. If you make a 20A measurement you should not assume that the current has been 20A for an hour if your measurement 2 minutes ago was 21A. In the simplest assumption, you assume that the current has been constant for the entire time since the last time you measured the current. Then you calculate how much energy was consumed between the two measurements. \$\endgroup\$ Commented Dec 30, 2019 at 22:50
  • \$\begingroup\$ thank you very much, the "per hour" made me thing it was an average, which is why I Could not understand the use of integral and sum here. Thank you very much \$\endgroup\$
    – Bdloul
    Commented Dec 30, 2019 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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