MAINS frequency screen

July 24, 2022 0 By bqk

[James] lives in the UK where the frequency of electrical power is expect to be 50Hz, however it has a tendency to vary based on supply and demand. He chose he desired a screen to track this.

Now, the national Grid site shows a real-time graph of the last 60 minutes. however that’s method as well easy. Time to bust out the soldering iron!

Armed with pencil and paper [James] scribbled down some concepts on exactly how to count the frequency — he settled on counting 200 cycles, which implies that at 50.000Hz, it would take precisely 4 seconds. The next issue was getting a timing source that was accurate sufficient for the job. An ATtiny84 wouldn’t do the technique (too inaccurate), nor would an outside crystal (too expensive) — however a real-time clock? That’s the ticket! He’s utilizing a DS3231 RTC chip, which at +/- 2ppm 32.768kHz is much more than accurate enough.

Some math, programming, and soldering later and the screen is complete! He’s even added an up/down arrow to show the most recent pattern of the electricity.

Nice one [James]! Last year [Ch00f] did a similar project, where he tore down a 194 discrete transistor clock set to see exactly how it worked — as an aside, he needed to understand exactly how accurate the 60Hz coming out of his wall was!