Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:54 19 Feb 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : mains frequency and cheap but accurate clocks

Author Message
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1459
Posted: 01:39am 17 Feb 2026
Copy link to clipboard 
Print this post

recent discussion on mains frequency and inverter frequency generated by EG8010
has resulted in an update on the mains frequency monitoring I do.
Also, the FeelElec FY6900 function generator can be calibrated with
junk you already have to less than 1ppm.

The mains freq monitor is based on a GPS module, that produces the 1 second pulse
of goodness that over time (1 hour to 1 day) has very high accuracy
I use an arduino Due, which runs at 84Mhz, 9V AC transformer, zener diode, opto coupler
and resistors.
Code running on the Due has an interrupt from the 1Hz pulse, that feeds a PLL
that converges to give me an accurate estimate of the Due clock.

Right now, in my office, the clock/2 is 41,999,477 and is stable within 1
this is short term variation of one part in 42 million.

I feed the 9V AC from mains into a current limited 5V zener, then limit that 5V current
to 10mA to fire the opto. The output is pulled up to 3.3V and the opto
yanks it down at a certain height of the ac waveform.

There is noise in this and uncertainty of measurement of the period is dominated
this by noise.

The setup was tested with a stable function generator and it is accurate to within
1 part in a million with 50Hz frequency.

eg with a clock of 42M, I see a period of 840,000 for 50 Hz and
with the stable test 50Hz input, I see only +/- 1 added to the 800,000
so it's nearly 1ppm

The Fy6900 costs about $100AU from Aliexpress. it has average accuracy
but it seems quite stable. I calibrated it, using the Due to less than 1ppm error
so now I have a very good FG for cheap.
it's specs say +/- 20ppm accuracy with +/- 1ppm stable for 3 hours.
It was in fact 30ppm out when I calibrated it.

I store the measured mains frequency and phase once a second into a database.
check out http://1eq2.cc/f3.html  for a view of what it is at Notting Hill, VIC.
I show a phasor too, which gives an idea of how fast mains frequency phase
changes over time.Green is a fixed reference, Blue is what it was a second ago.

Wiseguy in a recent post wrote about mains freq stability.
another thing I made shows the entire 24 hours of data, you can select recent days.
see http://1eq2.cc/f5.php?ddate=20260128 for instance. it takes 10 seconds to show the data
so give it time.

Today's data will be a bit wobbly due to my calibration and testing, in preparation for this
post here. there will be some spikes and other rubbish in it.

I suspect I could reduce the noise in the frequency data by putting the 9V mains
through a band pass filter. In mains voltage there are significant amounts of 2,3,4th harmonics
and this no doubt alters the timing of the opto coupler output.

here is some "proper" mains freq data, from https://wattclarity.com.au/articles/2026/01/16jan-frequency/



and my data



I wondered what the average frequency for a day is.
I chose Jan 14 2026..

mysql> select avg(fnfreq) as avfreq from freq where ts > 20260114 and ts < 20260115;
+-------------------+
| avfreq            |
+-------------------+
| 49.99938892271266 |
+-------------------+
1 row in set (5.02 sec)

so my measured mains frequency is quite close the day's expected average of 50 Hz.
wronger than a phone book full of wrong phone numbers
 
oreo

Senior Member

Joined: 11/12/2020
Location: Canada
Posts: 127
Posted: 03:41pm 17 Feb 2026
Copy link to clipboard 
Print this post

Nice!

I am also pretty impressed with what the FY6900 will do.  
With shipping the 20mHz version to Canada is about 145aud.
I think I will watch pricing and pick one up if/when pricing looks good.
Greg
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1459
Posted: 04:59am 18 Feb 2026
Copy link to clipboard 
Print this post

the FY6900 is not so good actually.
later FW versions do not allow access to calibration
and my unit forgets the new calibration over a power cycle.
I think if you are really keen on the idea, have a look at this
https://www.youtube.com/watch?v=X_fbDlpxg_M
external reference and mods the PSU for less noise.
wronger than a phone book full of wrong phone numbers
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026