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