Measuring Power
Electrical Power is a measure of the quantity of energy transfered from one place to another per unit time. Our electricity supply moves energy from the generators to our appliances, another name for the appliances is the load. However some appliances in addition to using electric energy, store and release energy back in to the mains supply.
The portion of the load that uses energy is called a resistive load and the power used by a resistive load is called the real power. An example of a purely resistive load is a heater or incandescent light bulb.
The portion of the load that stores energy and releases it back to the mains is called a reactive load and the power used is called reactive power. Reactive loads are divided into two types capacitative and inductive. An ideal capacitor or inductor (coil) connected as a load will produce only reactive power.
A transformer in a power supply is an example of a combination of both a resistive and a reactive load, the reactive part is due to inductive effects of energy storage in magnetic fields and the resistive part is due to the energy use by the appliance connected.
The sum of real and reactive power is called apparent power.
Real power has units of Watts (W).
Reactive power: volt-amperes reactive (var).
Apparent power: volt-ampere (VA).
So how do we go about finding these quantities?
In a circuit were the voltage and current are constant and the load is resistive we can determine the power by the following equation:

If we look at the units.

Measuring power in a dc circuit is straightforward but if the current and voltage of circuit is continually changing as in mains electricity, measuring power becomes a little more complicated.
To understand mains electricity it is useful to look at a real world example: We have a laptop and a halogen lamp plugged in to a four-bank that's plugged in to the mains wall socket. A voltage sensor is connected between the live and neutral wires in parallel with the loads and a current sensor is connected in the live wire which is in series with the loads (it can also be connected in the neutral wire there's no difference).
If we were to represent the above system as a circuit diagram it would look like this:

If we then get an arduino and a computer to log the readings you would get a graph that looks like this:

Notice something interesting here, the shape of the current is not a nice smooth sine curve. The voltage is a bit better but still not a perfect sine curve.
The peaks in the current values are down to the type of power supply laptops use. They are called switched mode power supplies they switch on only for a brief time when the voltage is at its peak. Switched mode power supplies are more efficient and can be made smaller than their non-switched counterparts.
Have a look at some screen shots of the waveforms in the sampling program
Unlike DC (Direct current) electricity the current and voltage is continually changing and therefore if we use the equation for power above we have to choose a point in time where we take those voltage and current values from, these values are only valid for that small instance due to their changing nature and are therefore called the instantaneous voltage and current. The power value obtained is also valid for this instance only, hence instantaneous power. The graph below on the right is a graph of instantaneous power versus time, the result of multiplying together the voltage and current graphs on the left.

Instantaneous Voltage x Instantaneous Current = Instantaneous Power
Instantaneous power is great but us humans are unable to process information that changes thousands of times a second. We need a more useful value for power.
Calculating Real Power
The portion of power flow that, averaged over a complete cycle of the AC waveform, results in net transfer of energy in one direction is known as real power.
Take the instantaneous power graph above the shape was determined by taking 5000 measurements a second. Each measurement is an instantaneous measurement with a small gap in time before the next instantaneous measurement.

To get the real power all we do is take the average of these values over a second by in this case adding up all 5000 measurements and dividing by 5000.

Calculating Apparent Power

Rms stands for root mean squared, it is a statistical measure of the magnitude of a varying quantity, in this case the quantities are voltage and current.
Instead of calculating a value for power at each measurement as we did for real power we calculate the rms value for the voltage and current separately over a second and then multiply both together.
Any difference in phase between voltage and current caused by a reactive load won't effect the value for apparent power.
To calculate rms Voltage we take the mean of the instantaneous voltages squared and square root it:

and the same for current:

Calculating Power Factor
The ratio between real power and apparent power in a circuit is called the power factor.

In an electric power system, a load with low power factor draws more current than a load with a high power factor for the same amount of useful power transferred. The higher currents increase the energy lost in the distribution system, and require larger wires and other equipment.
The above covers the basics of measuring power and is sufficient for us to understand how an energy monitor measures electrical power.
For more information on AC power wikipedia has a good page here.
i am confused , whether we
i am confused , whether we should take the the instantaneous power measurement for a complete cycle (50hz system) for average power calculation. is there any criteria that governs the no. of sample we take? can u please clear it ? am really confused.
Hello Aneesh I guess 1 cycle
Hello Aneesh
I guess 1 cycle is the minimum however the more cycles you measure over, the more of an average you will get, which will smooth out any short time scale variations which may make your values of Vrms,Irms...etc more useful. Does that answer your question?
I finally get it!
I've been reading about and trying to really understand reactive power and power factor for as long as I can remember. Thanks to your excellent explanation, I finally get it. Thanks!
Re: I finally get it
Thanks Josh! glad I could help