http://www.youtube.com/watch?v=_YdMvKDjalU

The Main_Moteino_Tx sketch makes measurements on four analog inputs: the two main voltages and line currents. Each input is sampled at 3 KHz over 30 AC line cycles, resulting in 1500 samples (@60 Hz). The mean, or average, and the standard deviation from the mean, or AC rms, is calculated on each channel, using raw A2D values. The results for each cycle are averaged over 30 cycles. Finally, the Arduino map() function is used to get calibrated volts and amps. Concurrently, true watts is calculated on each pair of voltage and current samples.

The map() function is a linear transform, so the accuracy of the calibration is dependent on the linearity of the measurement hardware. Voltage is nominally 120V, and typically within a few, to at most several, volts. This makes it relatively easy on the hardware. I calibrated at 110V and 130V. Final measurements were made at 110V, 120V, and 130V, and all the readings were within +/- 1 volt. Works for me.

Next up: calibrating current, and power readings.