Maker Pro
Maker Pro

Looking for ways to measure AC line voltage with a uP

D

Donald

Jan 1, 1970
0
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
 
G

Glenn Gundlach

Jan 1, 1970
0
Donald said:
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

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
 
D

Donald

Jan 1, 1970
0
Glenn said:
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
That would add a large cost to the project.

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

donald
 
D

Donald

Jan 1, 1970
0
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
 
J

John Larkin

Jan 1, 1970
0
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

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
 
D

Donald

Jan 1, 1970
0
John said:
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

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
 
T

Tim Shoppa

Jan 1, 1970
0
Donald said:
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.

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.
 
E

Eeyore

Jan 1, 1970
0
Donald said:
Looking for ways to measure AC line voltage with a uP.

The uP would connect to a PC serial port.

Are you sure you want to use a serial port ? They're becoming rare these days. A
very silly move imho btw.

Graham
 
D

Donald

Jan 1, 1970
0
Eeyore said:
Donald wrote:




Are you sure you want to use a serial port ? They're becoming rare these days. A
very silly move imho btw.

True enough, but my old PC has a serial port.
I already have a uP onsite measuring temperature.

Voltage and current are next.

donald
 
J

Jan Panteltje

Jan 1, 1970
0
True enough, but my old PC has a serial port.

I already have a uP onsite measuring temperature.

Voltage and current are next.

donald

I have a simple current system in use that uses an old tape recorder
playback head glued against one of the main leads, followed by a peak
detector.
You likely need no RMS, but if you use a 50Hz (or 60Hz US) lowpass, and
use a PIC with a ADC, you will have several channels analog input, and you
could take a lot of samples and get peak-to-peak value, and calibrate once
against a real meter (So 110V would be 110 x 2 x sqrt(2) = 311V,
100x attenuator gives 3.11V peak peak on the ADC).
The PIC will have RS232 or you can do it in software, add a MAX232.
You could even FM modulate that signal and send it via the mains.
As you already have temp, you maybe already have the ADC, and maybe enough
channels, else multiplex with some 74HC405x CMOS switch.
Main isolation, well you likely already have a transformer, grab and measure
the secondary for voltage, if no transformer and powered by for example RTG
or polonium 210, you could generate current for an optocoupler via capacitive
coupling if you want o be exotic, and the current in the photo-transistor
at the other end of the optocoupler would be proportional to the input mains
voltage.
Or buy a transformer.
There are many other ways I will not discuss these in this limited space as I
am watching telly on this PC now, and looks like I have to zap again.
If you made it this far thank you for your attention span.
 
J

John Larkin

Jan 1, 1970
0
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

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
 
R

Rich Grise

Jan 1, 1970
0
That would add a large cost to the project.

Nowhere near as much as designing and building from scratch.

Good Luck!
Rich
 
R

Rich Grise

Jan 1, 1970
0
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.

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
 
Donald said:
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

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.
 
D

DaveM

Jan 1, 1970
0
Donald said:
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

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
address)

Some days you're the dog, some days the hydrant.
 
H

Homer J Simpson

Jan 1, 1970
0
Are you sure you want to use a serial port ? They're becoming rare these
days. A
very silly move imho btw.

USB - serial isn't bad. Or add a serial card - very cheap.
 
J

John Larkin

Jan 1, 1970
0
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.


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

John
 
J

Jan Panteltje

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

John

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.
 
D

Donald

Jan 1, 1970
0
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
 
Top