# how do energy consumption (Ah, kWh) meters work?

How do devices which measure energy consumed work? For example the ones in solar regulators/chargers which display how many Ah went into the battery and how many went out?

Do they just measure the current for example every second and a microprocessor constantly adds up the measurements, assuming that the current 0.5s before and after each measurement is the same as while they take the current measurement, or do they have a way of really measuring how much energy went through, without referring to such, possibly inaccurate approximation?

• – Toby Jaffey Nov 5 '10 at 12:14

An MCU is not required to perform this sort of measurement. The STC3100 is a simple I2C interfaced coulomb counter that measures the charge state of a battery. It works by integrating the measured current into/out of the battery over time and providing the result in a form that can be read by the processor.

I have used this device on a couple of products and find the results better than I would have thought bearing in mind the large variations in the load current that can be seen, in my case the load current varies over at least 4 orders of magnitude. The errors due to the sampling of the varying current seem to cancel out over time.

Ah would be measured with a coulomb counter - basically what you said, measuring current and numerically integrating this over time.

As for kWh, you could measure current and voltage, multiply them together to get power, then again, numerically integrate this over time to get kWh

Mechanical wattmeter is essentially a motor with voltage and current sense windings. The velocity of motor is proportional to multiplication of voltage by current. In case if the multiplication gives negative result, the motor will rotate backwards.

In practice, yes an MCU will be doing individual measurements of current and voltage and assuming an average over the time period.

Depending on the frequency of the measurements and how the voltages are filtered before digitizing you will get something that's very, very close to the truth.

• I used to work in industrial power electronics; you have to sample voltage and current simultaneously in order to get "real power" -- the current and voltage can be out of phase and if you make assumptions or don't sample them at the same time you can skew your results considerably. Another thing that must be taken into account is crest factor. You alluded to it by talking about the frequency of measurements but if you have strong harmonic currents you must be able to capture these waveforms or your measurements again can be considerably far from reality. – akohlsmith Nov 5 '10 at 12:38

DC Energy consumption is fairly simple, as others have stated. You sample the voltage and current at regular intervals, interpolate, and integrate for total power consumption.

AC power meters like the Kill-A-Watt have to do a bit more, because with AC systems
current * voltage != power for reactive loads.

Basically, what the device has to do is sample at a frequency much higher than the AC carrier for a short period of time, and integrate the product of the voltage * current for that period. This enables the device to account for any phase difference between the current and voltage.

The Tweet-a-Watt project has more info, though it is not a great example, as they are sampling at too slow a frequency to get highly accurate results.

Energy consumed by the electrical loads or appliances can be measured by the Induction type energy meter. The basic principle governing the working of the energy meter is same as that of wattmeter (power measuring instruments) except that in an energy meter a counting or registering mechanism is used which accounts for time interval over which the meter is being used, i. e, power integrated over a
time which gives the energy consumed. In energy meter we have a rotating Aluminum disc which rotates due to the torque exerted on it (the torque is produced due to the interaction between the flux and the eddy current induced in the disc) .The rotating torque is proportional to the power consumed, To have a constant speed of rotation a braking magnet is installed which enables the disc to rotate with a constant speed which is directly proportional to the power consumed. Since a recording mechanism is used(consisting of gears and racks and pinions arranement), which gives integral of Pdt, i. e the energy consumed which is equal to the total number of revolutions(integral of No. Of revolutions × dt). Hence by knowing the number of revolutions and the meter energy constant we can calculate the energy consumed.