[time-nuts] measuring the mains frequency

folkert folkert at vanheusden.com
Mon Feb 27 19:23:30 UTC 2023


Hi,

Has anyone experimented with measuring the net frequency? (50Hz in
Europe, 60Hz in the USA)

Me and a friend are trying to do this as accurate and precise as
possible. His solution can do that with only a 0.0006Hz error, mine
sofar does +/- 2Hz.
Deviations of max. 0.150Hz are allowed (according to
https://www.mainsfrequency.com/ ) so 2Hz is useless.

I tried the following:

- use the hardware comparator of an AVR328 (Arduino Nano) together with
  a 10kHz clock-source and then count the number of external clock-ticks
  between 2 falling edges.

- I used something like
  https://www.botnroll.com/en/outros/4301-230vac-voltage-sensor-for-arduino.html
  to make the 230V into a 5V (DC) sine wave and connected that to D6 of
  the Arduino. D7 is connected to a voltage divider to get a 2.5V
  voltage reference (should be the zero-crossing voltage of the 230V
  input).

- connected a PicDiv from Tom (a PD03) to an OXCO and the other end to
  pin D2 (ext interrupt) of the Arduino.

+/- 2Hz (that's 80PPk right?) is way too much. So i'm curious if someone
has a suggestion on how to improve this?



Regards,


Folkert van Heusden.

p.s. the source code is at https://vanheusden.com/permshare/50hz.ino




More information about the Time-nuts_lists.febo.com mailing list