Re: Questions on interfacing to current sense transformer
- From: John Larkin <jjlarkin@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 Jun 2009 19:42:16 -0700
On Fri, 26 Jun 2009 19:19:58 -0700 (PDT), David Jacobowitz
<david.jacobowitz@xxxxxxxxx> wrote:
Hey group,
I'm thinking of building a homemade power meter. I'm planning on using
an Arduino with ethernet "shield" to allow me to read the power
measurements over the internet. I see simple power meters, like the
ubiquitous Kill-A-Watt, use a calibrated shunt resistor to measure
current, but for isolation, I thought I'd use a current sense
transformer instead. For voltage, I'll use a simple step down voltage
transformer.
I would like to be able to calculate phase difference, real/imaginary
power, etc, so I don't want to rectify to DC; I want to sample the AC
signals and do so frequently enough to be able to estimate the above
parameters.
I think I have most of this figured out the ADs on the Arduino are
only 10b, so this won't be super accurate, but I think it'll work.
The only thing I'm unsure about is how to bias the voltage transformer
and current transformer outputs so that they're suitable for the ADC.
For example, assume I've selected a burden resistor for the current
transformer so that the secondary voltage is 2.5Vp-p at rated input
current, but the ADC wants to see 0-5V.
How do I add the necessary 2.5V?
As a followup to that, how to I determine the zero crossing time(s)
once I've done this biasing?
I've thought that I would determine the time of peak-to-peak time of
the waveforms in software. Something like:
int t = 0;
int curr_sample;
int prev_sample;
int prev_prev_sample;
while (1) {
prev_prev_sample = prev_sample;
prev_sample = curr_sample;
curr_sample = read_adc();
if (curr_sample < prev_sample) && (prev_pre_sample < prev_sample) {
peak_value = prev_sample;
peak_value_time = t-1;
}
t++;
but I'm afraid that with noise, this will only get me close to the
peak. (I can filter, in hardware or software, I suppose)
Anyway, tips are appreciated. This is my first electronics project in
a looooong time.
-- dave j
Bias the low side of both the voltage and current sense transformers
to +2.5 volts DC to keep the ADC happy.
Your software should sample the voltage and current as close to
simultaneously as possible... within 10 usec is OK. Sample fairly
often, but it's not really important. I've done good meters that
sampled as slowly as 27 times a second. Nyquist is not an issue here.
Process the samples as follows:
Average blocks of, say, 1024 samples, and subtract the average from
each sample. That removes the 2.5 volt offsets.
Square and average the volt and amp samples independently (block
average or lowpass filter) and then square root. That gives you true
RMS volts and amps. Multiply them to get KVAs.
Multiply and average (block or lowpass filter) the product of the
voltage and current sample pairs. The result is true power.
You can integrate power to KWH. You can also compute power factor as
true power over KVAs, but you lose the lead/lag sign.
Something like that.
Add some random noise to the analog current signal, a few LSBs maybe,
to smear out the ADC quantization error and extend the low-end
resolution.
John
.
- Follow-Ups:
- Re: Questions on interfacing to current sense transformer
- From: JosephKK
- Re: Questions on interfacing to current sense transformer
- From: MooseFET
- Re: Questions on interfacing to current sense transformer
- From: David Jacobowitz
- Re: Questions on interfacing to current sense transformer
- References:
- Questions on interfacing to current sense transformer
- From: David Jacobowitz
- Questions on interfacing to current sense transformer
- Prev by Date: Re: Excel Problem
- Next by Date: Re: AT&T Usenet Netnews Service Shutting Down
- Previous by thread: Questions on interfacing to current sense transformer
- Next by thread: Re: Questions on interfacing to current sense transformer
- Index(es):
Relevant Pages
|
Loading