Looking for ways to measure AC line voltage with a uP

Looking for ways to measure AC line voltage with a uP.

The uP would connect to a PC serial port.

Also measuring AC line current would be useful.

thank you

donald

Reply to
Donald
Loading thread data ...

Donald wrote: > Looking for ways to measure AC line voltage with a uP. >

How about a DMM with an RS-232 port ? Lots of meters available. "dmm rs232" came up with 27000 hits on the Yahoo search.

GG

Reply to
Glenn Gundlach

That would add a large cost to the project.

I try ggogle/yahoo for "dmm rs232" and see what may turn up.

donald

Reply to
Donald

I would like to measure the AC line on a remote heater and water pump.

I can run a RS-485 to the site, but measuring the AC side is where I am having to be creative.

My idea is to isolate the line measuring side from the uP.

What do you mean by "make accuracy expensive" ?

This is a one off project, for our hot tub. :-)

donald

Reply to
Donald

How about a voltage stepdown transformer and a current transformer, both running into a sound card?

Somebody must have done this by now; ask Google.

John

Reply to
John Larkin

Good idea, if the site was closer. The RS-485 line is already 200Ft.

I have a uP already on-site measuring temperature.

Voltage and current are next.

donald

Reply to
Donald

Do you care about peak or RMS? The lowest-end meters don't really do RMS.

There are numerous voltmeters out there with serial, USB, GPIB, and other interfaces. If you want current, get one with a current probe. They solve the isolation, reference, measurement, interface, and RMS (except on the cheapest) for you.

Most scopemeters can be put into chart-recorder mode and log AC voltages for you.

There are commercial recorders that monitor power-line quality every-which-way-from-Sunday (peaks, noise, harmonics, frequency, you name it) if that's what you want.

I'm sure there's some way to do it with a uP... put 120VAC across a uP, count how many pieces it explodes into,... etc. If you get the idea that the microprocessor is only a small part of the solution then you're getting the story.

Tim.

Reply to
Tim Shoppa

OK, scale the AC voltage and current to managable values and feed them into ADC channels on your uP. If the ADC is unipolar, bias them to about midscale. Now and then sample the voltage and current signals as a pair of E:I values, as close to simultaneously as you can manage.

Then

Autozero out the longterm average value of each, to remove any DC components.

Multiply the E:I numbers to get power samples.

Lowpass filter or group average those products to get realtime power.

Integrate that to KWH, or just integrate the sample products if you're not interested in realtime power.

You can also do true RMS calcs on the separate E and I samples, to get true rms voltage and current. Multiply those to get KVAs, and divide true power by KVAs to get power factor.

Easy.

John

Reply to
John Larkin

Nowhere near as much as designing and building from scratch.

Good Luck! Rich

Reply to
Rich Grise

Then, just use an ordinary voltage divider, maybe a buffer or precision rectifier to get it into the uP, and either a current transformer or shunt for the current, suitably buffered.

What's the real problem?

Thanks, Rich

Reply to
Rich Grise

This is what I would do: use a bridge rectifier along with a voltage divider, feed that into your uP, take lots of A/D samples and look for the peaks. Calculate RMS from that value. I'm assuming your input AC is still a nice sinewave.

For current, use one of the Allegro Hall effect current sensors. 50 or

100A capacity, totally isolated, 0-5V output. Again, look for the peaks.
Reply to
hondgm

Not really such a good idea... The gain through a sound card is very uncalibrated, and controlled by the volume slider in the sound mixer (assuming Windows OS). The gain changes each time you adjust the volume of your favorite CD track. So unpredictable as to be useless in this situation, unless you provide (programmatically) some means of presetting the calibration.

--
Dave M
MasonDG44 at comcast dot net  (Just substitute the appropriate characters in the 
 Click to see the full signature
Reply to
DaveM

Then your development costs will exceed the cost of buying a DMM with RS232.

formatting link

Reply to
Homer J Simpson

Just set up the sound card gains and such when you use it. Heck, you can do that in PowerBasic.

John

Reply to
John Larkin

On a sunny day (Fri, 24 Nov 2006 16:31:15 -0800) it happened John Larkin wrote in :

favorite

My PC is playing background music all day.... sound card 1 occupied. For web video and TV soundcard 2 is used... different speaker (or headphone). He may need that soundcard. Soundcard 1 is also used for net2phone, skype etc. Or was it 2?

2 soundcards is not even enough.
Reply to
Jan Panteltje

Thanks to all who responded to my questions.

I am looking at opto-isolating an serial ADC.

Running the ADC with a battery would power the circuit.

Dropping the line voltage with a resistor divider to 2 volts and measure.

I have some serial ADCs on hand (just need to find them).

I need to locate some current monitors.

I want to calulate the power used by the heater.

donald

Reply to
Donald

If you'd like to also measure frequency, I have just the ticket. In fact, the boards we made have RS-485 interface built in, and have optoisolated outputs that control onboard small triacs, for controlling power contactors. This was for the load control system at Holden Village. Uses a PIC processor.

Cheers, Tom

Reply to
Tom Bruhns

Are you selling this as a product or hobby interest.

Do you have a web site on what this thing is ?

Thanks for any information.

If I missed saying, mine is a one off device to measure voltage and current in my hot tub heater.

I already have a micro (Atmega8) with RS-485 measuring temperature.

donald

Reply to
Donald

How about an electricity meter IC like the Analog Devices ADE7755 or ADE7756. They also calculate the power for you!

Wim

Reply to
Wim Ton

There are lots of ways to sense and/or condition the voltage and current, but if you just want average AC voltage (like a cheap multimeter), I'd recommend using some analog circuitry to rectify and average the AC (as simple as a resistor divider, some diodes, and an op amp connected as an integrator), then convert that to a frequency signal (use a '555 with capacitor and diodes to make a charge pump, free-running, and pump the charge out of the integrator capacitor until the integrator hits a threshold voltage, then inhibit the '555 until it goes above the threshold). You can easily use an optoisolator to get the output into your PIC with the serial port. Either use a counter module in the PIC, or an interrupt, or even polled monitoring of the frequency signal. To get high accuracy averages, leave the counter active for a longer time, or get quick readout of just-the-last-second values.

You can get temperature measurement with a '555 oscillator with a resistor of known high temperature coefficient, or (better) with current-source temperature sensors (AD590) which are easily transformed to frequency output.

The benefit of the frequency-analog signal is that it is easy to couple through a transformer or optoisolator for safety.

Reply to
whit3rd

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.