Here’s a similar output from IoTaWatt with 20 samples per second. The data varies by less than .5% over the 3 seconds. Each sample is one AC cycle. It is measured at 60Hz, so at 50Hz the sample count would be more like 16+.
When I say one AC cycle, I mean exactly one AC cycle +/- about 0.1% of the cycle. I think the math for jumping in arbitrarily and sampling for a fixed period of time is flawed for two reasons:
-
The frequency varies too much to reliably predict when a whole number of cycles has been sampled. UK frequency for the last hour
-
It matters where you jump in. If you jump in at a peak of the cycle, any short/extra samples due to frequency/sample-rate calibration will result in a much larger error than if the timed sample period begins on or near the zero crossing.
So this data was generated by literally adding one printf statement to the IoTaWatt firmware. Although I output real power and rms voltage, power factor, rms current and of course apparent power are also available to be included in the print statement.
These values are also ms-time-weighted and accumulated, so that the average over any interval, measured in ms, can be easily obtained.
There is a process that already outputs to influxDB - with timestamps.
You may have noticed that I posted this output without explanation. Just to pique your interest. But the moderators insisted on this explanation. Hope it widens the scope of your project.
Seconds: 11, real power: 123.5, vrms 118.0
Seconds: 11, real power: 123.8, vrms 118.1
Seconds: 11, real power: 123.5, vrms 118.0
Seconds: 11, real power: 123.4, vrms 118.0
Seconds: 11, real power: 123.4, vrms 118.0
Seconds: 11, real power: 123.5, vrms 118.0
Seconds: 11, real power: 123.5, vrms 118.0
Seconds: 11, real power: 123.5, vrms 118.0
Seconds: 11, real power: 123.6, vrms 118.0
Seconds: 11, real power: 123.4, vrms 118.0
Seconds: 11, real power: 123.4, vrms 118.0
Seconds: 11, real power: 123.5, vrms 118.0
Seconds: 11, real power: 123.7, vrms 118.0
Seconds: 11, real power: 123.5, vrms 118.0
Seconds: 11, real power: 123.6, vrms 117.9
Seconds: 11, real power: 123.5, vrms 118.0
Seconds: 11, real power: 123.5, vrms 118.0
Seconds: 11, real power: 123.4, vrms 118.0
Seconds: 11, real power: 123.3, vrms 117.9
Seconds: 11, real power: 123.3, vrms 117.9
Seconds: 12, real power: 123.6, vrms 118.0
Seconds: 12, real power: 123.3, vrms 117.9
Seconds: 12, real power: 123.3, vrms 117.7
Seconds: 12, real power: 123.3, vrms 117.9
Seconds: 12, real power: 123.7, vrms 118.1
Seconds: 12, real power: 123.4, vrms 118.0
Seconds: 12, real power: 123.3, vrms 118.0
Seconds: 12, real power: 123.5, vrms 118.0
Seconds: 12, real power: 123.5, vrms 118.0
Seconds: 12, real power: 123.5, vrms 118.0
Seconds: 12, real power: 123.4, vrms 118.0
Seconds: 12, real power: 123.5, vrms 118.0
Seconds: 12, real power: 123.5, vrms 118.0
Seconds: 12, real power: 123.5, vrms 118.0
Seconds: 12, real power: 122.9, vrms 118.2
Seconds: 12, real power: 123.4, vrms 117.9
Seconds: 12, real power: 123.5, vrms 118.1
Seconds: 12, real power: 123.4, vrms 118.0
Seconds: 12, real power: 123.7, vrms 118.1
Seconds: 12, real power: 123.7, vrms 118.1
Seconds: 13, real power: 123.9, vrms 118.0
Seconds: 13, real power: 123.7, vrms 118.1
Seconds: 13, real power: 123.6, vrms 118.1
Seconds: 13, real power: 123.5, vrms 118.0
Seconds: 13, real power: 123.7, vrms 118.1
Seconds: 13, real power: 123.5, vrms 118.0
Seconds: 13, real power: 123.5, vrms 118.0
Seconds: 13, real power: 123.7, vrms 118.1
Seconds: 13, real power: 123.4, vrms 117.9
Seconds: 13, real power: 123.3, vrms 118.0
Seconds: 13, real power: 123.6, vrms 118.0
Seconds: 13, real power: 123.7, vrms 118.1
Seconds: 13, real power: 123.6, vrms 118.1
Seconds: 13, real power: 123.6, vrms 118.1
Seconds: 13, real power: 123.6, vrms 118.1
Seconds: 13, real power: 123.7, vrms 118.2
Seconds: 13, real power: 123.6, vrms 118.1
Seconds: 13, real power: 123.5, vrms 118.0
Seconds: 13, real power: 123.7, vrms 118.1
Seconds: 13, real power: 123.5, vrms 118.0
Seconds: 14, real power: 123.6, vrms 118.1