My own smart meter ?

No, that is the instruction to take the reading over 20 mains cycles (400 mSec), with a timeout of up to two seconds. The code starts by waiting for a zero crossing in the voltage waveform before going any further - hence there is the risk that if you made the call but the hardware was not connected to a AC voltage source it would hang at that point, waiting for a zero crossing that never comes. (it would not be an issue in this particular application, but could be in some - it is a general purpose library)

You could make the call and ask for a reading over 100 cycles... that would amount to 2 secs worth of mains cycles. However the result would still be computed on the cumulative effect summed from many instantaneous voltage and current readings taken per cycle. So the result would be an average of two seconds worth of consumption taking into account the pf (both conventional and harmonic). Depending on the nature of the load that may differ (with a lower real power reading) from the simple multiple of average RMS voltage and average RMS current.

Well if they are lit during the sample time, they will be counted! :-)

Reply to
John Rumm
Loading thread data ...

Thanks for taking the time.

One tiny point: I arrived at 0.2 seconds from the comment in your code "No.of half wavelengths (crossings)" assuming 20/(2 x 50).

Reply to
Robin

Yes good point and well made :-)

You are right it counts crossings and not whole cycles.

Reply to
John Rumm

HomeOwnersHub website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.