Maker Pro
Maker Pro

Looking for ways to measure AC line voltage with a uP

T

Tom Bruhns

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

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
 
D

Donald

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

Wim Ton

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

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

Wim
 
Donald said:
Looking for ways to measure AC line voltage with a uP.


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

John Larkin

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

Measure its resistance. Measure nominal line voltage. P = e^2/r. It
won't change much.

John
 
J

Jan Panteltje

Jan 1, 1970
0
Measure its resistance. Measure nominal line voltage. P = e^2/r. It
won't change much.

John

The resistance of a light bulb changes a factor 10 between cold and hot,
why should the resistance of a heater wire not change much?
 
J

Jim Thompson

Jan 1, 1970
0
The resistance of a light bulb changes a factor 10 between cold and hot,
why should the resistance of a heater wire not change much?

NiCr has very low TC.

But it'll stretch when it heats up. When I used hot wire
cutting/bending of plexi I used a spring support on one end.

...Jim Thompson
 
J

John Larkin

Jan 1, 1970
0
The resistance of a light bulb changes a factor 10 between cold and hot,
why should the resistance of a heater wire not change much?

Because it runs at a much lower temp and, as Jim says, nichrome has a
low TC. But if that's a concern, measure the running amps.

My point is that there's not a lot of reason to measure the power of a
simple heater load in real time.

John
 
J

Jan Panteltje

Jan 1, 1970
0
NiCr has very low TC.

But it'll stretch when it heats up. When I used hot wire
cutting/bending of plexi I used a spring support on one end.

OK, got it, thank you.
 
M

me

Jan 1, 1970
0
My point is that there's not a lot of reason to measure the power of a
simple heater load in real time.

John

You could just look at the label. The listed wattage should be, on average, quite close.
 
D

Donald

Jan 1, 1970
0
Wim said:
How about an electricity meter IC like the Analog Devices ADE7755 or
ADE7756. They also calculate the power for you!

Wim
I just found this chuip on Analogs web site today. Looks like fun.

Now to get a sample....
 
T

Tom Bruhns

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

No, we're not selling it. I suppose that's a possibility if there was
enough interest.

If your uC has an ADC, one simple way is to just measure the voltage at
the peaks. You can eliminate offsets by taking the difference between
the positive and negative peaks. If you need isolation, you can use a
transformer, but if the line isn't too far off ground (e.g., if it's a
reasonably well balanced 240V), you can just use a one op amp diff amp
to get a low voltage AC waveform to measure. Use something like
4*100kohms (for protection from at least moderate transients) from the
line to each op amp input, and 5.11k or so feedback and from the op amp
noninverting input to your ground reference. No need to muck around
with a rectifier, if you sample on the voltage peaks. A bit of
capacitance across each of the two 5.11k's will give some noise
immunity. If you want RMS voltage, use the uC to sample fairly
frequently and take the square root of the sum of the squares. Square
root is easy if the voltage is within a fairly narrow range:
(1+delta)^2 = 1 + 2*delta + delta^2; and if delta is small, you can
drop the delta^2 term with little loss of accuracy.

Recommend you use a current transformer for measuring the current.
With 1000:1 turns ratio, you should be able to put an appropriate load
on the secondary to get about 2V peak. Then return the secondary to a
voltage equal to the midpoint of the ADC range, and you can get the
current.

If you really want power, you can sample the voltage and current
together--simultaneously, or as nearly so as you can practically
do--and multiply them together and average. Or you could add up all
the V*I samples to get the total energy used.

How many samples per cycle you need to use to get accurate results
depends on the degree to which you are unsure of the waveform. It's
likely not a pure sinewave, but may not be enough different from a sine
to matter to you. Then you would only need to sample the peaks of
voltage and current, and determine the phase difference between them to
calculate true power. Note that the peaks of a sinewave come midway
between zero crossings.

Cheers,
Tom
 
J

Jan Panteltje

Jan 1, 1970
0
You could just look at the label. The listed wattage should be, on average, quite close.

One reason to measure current is to test for a defective heater.
The other reason could be, what I have here, where the PC logs the power
consumption, and the heater has a switch with 3 settings, off, 1kW, and 2kW.
You cannot get the switch status without modifying the heater.
The heater is controlled by the PC via a triac.
You can see the system live here:
http://panteltje.com/panteltje/view_sensors.php
Well 'live' I switched it of in March :)
Winter has not come yet (it is summer temperatures in November here.....)
and the heater is now running on its own thermostat (no PC logging), as I was
afraid to see the real value now the electricity prices went up...
However it seems I needed to pay _less_ while prices went _up_ and I
uesed _more_ kwh, them electrons love me.
 
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.

Use resistor divider to get mains voltage to levels acceptable for the
builtin adc. Add some zener diodes for transient protection.
Then let the pic sample/calculate and send it off via rs232 that is routed
through a optocoupler.

One could extend it by useing another pic to send via rs485 to allow for
multidrop operation. Budget decides I guess ;)
 
Top