[James] lives in the UK where the frequency of electricity is suppose to be 50Hz, but it tends to fluctuate based on supply and demand. He decided he wanted a display to track this.
Now, the National Grid Website shows a real-time graph of the last 60 minutes. But that’s way too easy. Time to bust out the soldering iron!
Armed with pencil and paper [James] scribbled down some ideas on how to count the frequency — he settled on counting 200 cycles, which means that at 50.000Hz, it would take exactly 4 seconds. The next problem was getting a timing source that was accurate enough for the job. An ATtiny84 wouldn’t do the trick (too inaccurate), nor would an external crystal (too expensive) — But a real-time clock? That’s the ticket! He’s using a DS3231 RTC chip, which at +/- 2ppm 32.768kHz is more than precise enough.
Some math, programming, and soldering later and the display is complete! He’s even added an up/down arrow to show the most recent trend of the electricity.
Nice one [James]! Last year [Ch00f] did a similar project, where he tore down a 194 discrete transistor clock kit to see how it worked — as an aside, he needed to know how accurate the 60Hz coming out of his wall was!