Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

True RMS measurement digitally with PIC

Status
Not open for further replies.

atferrari

Well-Known Member
Most Helpful Member
Considering how to measure / calculate RMS power in an AC line I've got the concept: The rms value results from squaring the values over intervals of time, finding their average value, and taking the square root of it.

Thinking of measuring power used by a common appliance connected to 220 V AC monophasic using a PIC for the measurement and calculation, I understand I should do this:

a - Measure V and simultaneously I (well, as close in time as possible to each other!!).

b - Multiply V * I to get instantaneous value of power.

c - Add succesive instantaneous values of power.

d - Calculate the square root of their sum

e - Repeat the process for the next cycle.

My questions:

1 - How many times per full period (or per second) should I measure instantaneous V and I to make this reasonably precise? I could not find a suggested figure in the so many places talking about true RMS.

2 - Is the zero crossing information a must to start counting the above or could I use a precise timer to trigger the next pair of measurements plus the calculation?

2 - Is it wrong to do this kind of measurement/calculation for one of every two full periods? Am I cheating the reasult in that way?

3 - A 10-digits ADC is it enough if taking the output from current / voltage transformers with adequated down scaling?

4 - Even if the above is a yes, could the 18F452 (which I've just started to work with) be useful here? (Quite an improvement over the 16F877 :!: )
 
You can, but you gotta keep in mind that the PIC would have its ground on neutral instead of earth ground.
The shunt would have to be between the load and the neutral in this strategy, the "low side shunt". That's problematic in some cases.

You don't want any exposed metal surface or interface cables to be exposed to the line's neutral. You can use serial comm and optoisolators to fix this. Once it's opto'ed you could do a high side shunt if you needed to.

1. Depends on how accurate you want to be. Also there's a lot more to power quality than just the power factor.
2. The system may be able to find the zero crossing out of the ADC readings.
3. Probably not, but I don't know why you'd skip periods at all.
4. 10-bit with +/-180v (150v rms) full scale is 350mV resolution, sounds pretty good.
5. Absolutely.

Hey you can also calculate harmonic content of the voltage/current, just look up some source code.
 
atferrari said:
Considering how to measure / calculate RMS power in an AC line I've got the concept: The rms value results from squaring the values over intervals of time, finding their average value, and taking the square root of it.

Mains is sine wave, so there's no need to do complicated RMS conversions, simply read the voltage and current at the peaks of the mains cycles.

Thinking of measuring power used by a common appliance connected to 220 V AC monophasic using a PIC for the measurement and calculation, I understand I should do this:

a - Measure V and simultaneously I (well, as close in time as possible to each other!!).

b - Multiply V * I to get instantaneous value of power.

c - Add succesive instantaneous values of power.

d - Calculate the square root of their sum

e - Repeat the process for the next cycle.

Just do a) and b), and e) of course.

My questions:

1 - How many times per full period (or per second) should I measure instantaneous V and I to make this reasonably precise? I could not find a suggested figure in the so many places talking about true RMS.

2 - Is the zero crossing information a must to start counting the above or could I use a precise timer to trigger the next pair of measurements plus the calculation?

It's a must so you can measure at the peak.

2 - Is it wrong to do this kind of measurement/calculation for one of every two full periods? Am I cheating the reasult in that way?

3 - A 10-digits ADC is it enough if taking the output from current / voltage transformers with adequated down scaling?

More than enough!, 10 bit is 0.1% resolution.

4 - Even if the above is a yes, could the 18F452 (which I've just started to work with) be useful here? (Quite an improvement over the 16F877 :!: )

No difference, the 16F877 is fine, the UK magazine EPE have done two projects like this, the first (about 1998?) used a 16C84 with an external 8 bit A2D - I built this years ago, it works great!. They've recently updated the design using a 16F877, and they use this to give two independent channels, rather than the one of the original.
 
You can get lots of useful information by looking at one of the power measurement IC data sheets. Try the data sheet for the ADE7751.

They have a typical circuit on page 9 that uses a current transformer and a resistive divider for measurement.

Mike.
 
Thanks to you all.

I think I will go the PIC way but first I want to solve my own doubts about the cos fi and related magnitudes.

Not being versed in all this, everything is almost new. :cry:

Gracias again :!:
 
Gracias Motion! :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top