The measurement anomalies of the recent experiments are intriguing. I don’t want to just tweak things (well, up to a point) – I also want to explain what’s happening! Several insights came through the comments (keep ‘em coming!).
Let me summarize the measurement algorithm: I measure the < 1 VAC peak-to-peak voltage ≈ 5000 times per second, and keep track of a slow-moving average (by smoothing with a factor of 1/500-th). Then I calculate the arithmetic mean of the absolute difference between each measured value and that average. Results are reported exactly once every second.
- noise should cancel out for both the average and the mean values, when the signal is large
- noise will not cancel out if it is larger than the fluctuation, due to the absolute function
There’s also another problem:
I’m not synchronizing the averaging period to the power-line frequency, nor taking zero crossings into account.
This matters, and would explain up to some 2% variation in the measurement. Here’s why:
- each 1-second sampling period measures about 50 cycles
- let’s assume it’s 49-cycles-and-a bit
- the extra “bit” will be residuals at both ends
- the 49 cycles will be fine, averaged from zero-crossing to zero-crossing
- but the ends may “average” to anything between 0 and 100% of the true average for entire cycles
- so 1 of the 50 cycles may be completely off, i.e. up to 2% error (always too low)
So it looks like there are two measurement issues to deal with: noise and the lack of zero-crossing syncing.
It doesn’t quite explain the extreme values I’ve been seeing so far, but for now I’ll assume that an excessive amount of noise is being picked up in my crude breadboarded circuit and all the little dangling wires.
Shielding, digital noise filtering, and syncing to zero-crossings… quite a few things to try out!