The concept of modern (electronic), electric power meters is very simple. Different power meters have different approaches, so I’ll briefly explain one of the most common and then mention another.

First, meters quickly measure the instantaneous voltage as well as the instantaneous current at a rate of about 1,000 times per second. As an example:

Here is a visual of voltage and current for 50Hz AC. The peak voltage is 0.8 volts and the peak current is 0.6V. The current is slightly behind the voltage. Each sample is shown in circles, and taken every 0.001 second.

The meter calculates for each sample the sampled voltage and the sampled current. The current times voltage equals power. Products are therefore sampling the instantaneous power curve. This is the purple curve in the graph.

The meter multiplies each power sampling by the sample period. In this example, it is 0.001 second. This is a rough estimate of the amount of energy used in this time period. Energy is power times duration. The meter then keeps track of all energy samples. This shows the total energy used over time.

The actual function of the meter is to approximate the area under the power chart, as shown in the chart. This is the exact amount of energy used. The calculated energy of the sample for two samples is shown on the chart at 0.005 and 0.007 seconds. The area of the purple-shaded rectangles to the right of the power samples is the calculated energy. As you can see, the approximations are not important as they are both positive (overestimating the energy for samples at the rising end of the power curve) and negative (underestimating the energy at the fall end of the curve), as shown in the two examples rectangles. They tend to average over time because the AC period and the sample period are not synchronized. This means that the samples are located at different points on each cycle.

The units would be adjusted to display kWh in order to normalize the output. The calculated value is in units of volts multiplied by amps and seconds. This is Watt Seconds. However, Joules are rarely used to represent electricity as a Joule represents a small amount of electricity. To convert to kWh, the meter must divide 1000 Watts per hour by 3,600 seconds. It divides by 3,600,000. There are 3.6 million Watt seconds (Joules).

A few points are worth mentioning. First, this method measures the energy consumed using the first principals, despite its simplicity. This means that the meter works reliably and accurately for the distortions in AC waveforms, and out of phase currents common to modern mains power. The resulting energy can be proved to be the same as A(rms), power factor, and time. This shows that the meter is capable of accurately measuring these values without the need to calculate them in practice. There are power meters that use the rms approach, even though they may need to display current and voltage.

Second, the energy used goes negative when current and voltage are out of phase. This means that some energy is returned to the supplier every cycle when voltage and current are out of phase. This is evident in the chart below, where you can see the grey shading just below the axis. The net energy is the sum of all the energy used and the energy that was returned. This measurement is crucial and is included by the meter. It also takes into account negative energy values that result from samples taken during these periods.