# Power monitoring 240VAC devices

I'd like to monitor the power usage of a number of single phase mains devices (0-10A). The system is to be added to an industrial automation system (on DIN rail), and should be able to talk to a microcontroller (analogue or digitally).

It can be installed inline or around the cable (ie clamped). What are the advantages of each?

I'd like to know about the method used for current/power measurement, the accuracy (for a 0-10A range), a suitable off the shelf system/parts, and a rough cost.

To clarify:

I'm interested in using an off-the-shelf system if at all possible. If there's an existing solution that suits my needs, I'd love to hear about it (and answers to the questions above - how it works, accuracy, cost). There's no sense redesigning the wheel here, it's not an academic exercise.

-
RMS is not meaningful applied to power, so your question is meaningless. –  Olin Lathrop Feb 11 '12 at 16:43
@Olin My apologies, I've updated the question –  Alex L Feb 11 '12 at 17:37

For something fast and simple, you can try the open energy platform.

It's an Arduino based power monitoring system, complete with GLCD display if you will. It comes with open source arduino sketch for relatively accurate energy meansurement, implementing the above formulars, and the site details the design and the energy measurement method used as well.

the use a simple AC-AC adaptor to set down the voltage, and a Current Transformer for the current that snaps onto the mains line.

the design is very simple, and can be easily modified to send the calculated Vrms and Irms values to another systems via any communication medium like RS232, I2C, etc.

You could also use AFEs (Analog Front End) chips from Microchip, Maxim or Cyrus Logic, however these will require alot more programming expertise.

-

off-the-shelf devices

Many off-the-shelf power monitoring devices do most of what you want to do. I wouldn't be surprised if several companies sell industrial versions on DIN rail mounts -- please tell us if you find any. If you can't find any, perhaps you could use commercial versions:

They use a variety of current sense techniques and communication protocols.

unnecessarily cranky response to other "answers":

A typical power monitoring device measures the instantaneous current and voltage many times per second. From those numbers, it calculates the instantaneous real power, and from the instantaneous real power it can calculate the average real power RealP over one or more full power cycles.

Also from that data the device can calculate the power factor Pf over one or more full power cycles with

Pf := RealP / (Vrms * Irms) -- by definition


Some textbooks imply that the power factor is the cosine of something, perhaps something related to zero-crossings. That's doing it wrong. It may happen to give the currect result for perfectly linear loads with ideal sine-wave power, but not for nonlinear loads, or linear loads with our less-than-ideal not-exactly-sine-wave power. Instead, good power monitoring devices use the above equation, which gives the correct power factor even with nonlinear loads or non-sine-wave power or both.

Some textbooks imply that one can calculate the real power by multiplying the power factor times something. That's doing it wrong. It is an unnecessarily round-about method of getting the real power, since the device must have already calculated the real power in order to get the power factor.

-
+1 for a Kill-A-Watt one. It is sort of popular for some reason –  user924 Jun 22 '12 at 23:47

For power measurments : You will need to Claculate VRMS, IRMS ,Power factor & Power

Power (real power ) =VRMS * IRMS * PF

There's 3 methods for current sensing "Shunt resistance , Rogowski coil & hall effect " to know which one to choose see this question Shunt Vs Rogowski Also for shunt resistance connection & circuitry check this Shunt structure ,any way whether you used shunt or Rogowski , you will take the output of this sensor into an ADC , the ADC will give you samples , in your MCU you will make an equation that transform the ADC reading into a real signal , i.e if the reading was X=0.5 then it will match a Y= 7 Ampere at the real signal Then for finding the IRMS , you will collect those reading in a buffer say buffer length [64] sample , after the buffer is full sum (sample * sample) "Square & sum them" , then divide them by their number (64) , later take the root mean square So IRMS= Sqrt(Sum(Sample*Sample)/No of samples) The more samples you take the more accurate result you will obtain, Also this topic will explain another method for it "Ac measurements "

Now lets move to voltage: For voltage measuring , you will need a simple voltage divider & then take the ouput signal to a ADC , do the same calculations you as you did in IRMS to find the VRMS So VRMS= Sqrt(Sum(Sample*Sample)/No of samples)

After you done now you have VRMS & IRMS .

SO we need to find P(average power = real power ) P= VRMS * IRMS * PF

, so we need the power factor

For power factor you will have to detect the zero crossing of current or voltage , then after you detect it , use a timer in the MCU to count how many "usec" between the voltage & current zero crossing , Now you have the difference between them , use math & you will have PF

So , finally you can calculate Power ,

For power :- You will accumulate them & divide by number to get KWH & so on .

It happened I've been building a system like this & asked a lot here in stack , so this what I got till now .

The reason why I didn't mention Hall effect sensor that it is expensive .

A simple algorithm to find VRMS or IRMS :- 1-X = function(ADC_Reading) ; // Equation to take back the reading to original 2-Sum+=X*X; 3-Is this sample number (64,128...) if yes go to 4, if not go to 1 4-Y=sum/(64,128,...) 5-IRMS or VRMS= sqrt(Y) 6-Reset All & repeat

Further step in your system , you will have to make a calibration because you want less error in reading & so on to achieve a better accuracy , it happened I asked for this on stack to Calibration

-
That covers the single phase systems. If you have a multiphase system (e.g. 3 phases) you should be aware that there are line and phase currents and voltages. Furthermore you will need to multiply by $\sqrt 3$ or 3... depending on which you measure... –  Count Zero Feb 11 '12 at 11:36
-1: I suggest you never use zero crossings in any practical system. They are prone to errors due to noise and distortion. Also VRMS*IRMS*PF is a very roundabout way to calculate power. –  Jason S Feb 11 '12 at 13:27
How do digital power meters taking their readings? Like the ones that power companies use at the house. –  Kellenjb Feb 11 '12 at 14:05
Yes, just multiply input voltage times input current and integrate over time. It's simple and less prone to errors in any single measurement. –  Jason S Feb 11 '12 at 22:01
@Jason - "They are prone to errors due to noise and distortion." With the right software, there's no reason why you shouldn't be able to solve that. A colleague of mine designs intelligent dimmers, which have less than 0.1% phase error on the zero-crossing, no matter what trash you add to the signal. –  stevenvh Jun 18 '12 at 13:53
show 1 more comment

There are many energy measurement solutions.

10A @ 240V is about 24 Ohms. You can get you a precision 0.1Ohm resistor(or lower) and simply use an ADC from a uC to measure the voltage across the resistor.

The current through the resistor is then simply I = 10 V where V is the voltage across the resistor which is in the range about 1Vrms.

Because P_tot = P_S + P_L where P_S = power dissipated in sense resistor and P_L is power in load(what your trying to find), and

P_tot = 240*I = 240*10*V = 2400*V

P_L = 2400*V - P_S = 2400*V - 10*V^2

So simply knowing V is enough to compute the power in the load.

If your power source is not constant you can use another ADC to monitor the voltage across the sense and load and use that instead of 240.

This is the easiest and cheapest way in general(it can scale much better since you can probably use one cheap PIC and a few sensing resistors).

Anyways, I can't do all your homework for you ;)

-
OP wants to measure loads in the 0..10A range, not just a fixed 10A load. Overmore, the 10A will most likely vary with mains voltage, and not necessarily in a linear way. You need to measure both current and voltage. –  stevenvh Feb 11 '12 at 8:30
I do not make any assumptions about the current being fixed. Duh. Show me where I fix the current at 10A? I fixed the max current at 10A to limit the full scale range fed into the ADC to be 1V rms max. Also, I did say one can measure the voltage across the load + sense resistor. You should read and think about what is posted before posting. –  Uiy Feb 11 '12 at 15:09
You claim that measuring the voltage is sufficient to calculate the power. If the load isn't purely resistive this is not true. –  stevenvh Feb 11 '12 at 15:18
Yes, there is a power factor involved. But If you measure voltage across the load + sense and know the current going through the resistor then you can easily compute the true RMS in a uC. Just replace 240 with this voltage then compute the trueRMS by integrating it appropriately. He didn't mention the type of load and I should have pointed it out but xsari3 has taken care mentioning it. I wasn't trying to completely solve his problem(I'm not getting paid for doing his work, he is) but point him in the right direction. –  Uiy Feb 11 '12 at 15:36