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