Ask Hackaday: Is Your Clock Tied to Mains Frequency?

Earlier in March we heard about a quirk of the interconnected continental European electricity grid which caused clocks to lose about six minutes so far this year. This was due to a slight dip in the mains frequency. That dip didn’t put anything out of commission, but clocks that are designed to accumulate the total zero-crossings of the power grid frequency of 50 Hz don’t keep accurate time when that frequency is, say 49.985 Hz for an extended period of time.

An interesting set of conversations popped up from that topic. There were several claims that modern alarm clocks, and most devices connected to mains, no longer get their clock timing from mains frequency. I’ve looked into this a bit which I’ll go into below. But what we really want to know is: are your alarm clocks and other devices keeping time with the grid or with something else?

“The” Alarm Clock Chip

I’m always interested in learning a lot about something I have gotten wrong in my head. In this particular example, I put a picture of this ~30 year old alarm clock I use everyday on Twitter as an example of the mains-frequency clocked device (one of at least five I have in my house). Someone replied that it’s a quartz clock because it’s digital and therefore not getting its timing from mains.

I certainly could have been wrong. I only assumed it was tied to mains frequency but I couldn’t say why I thought that other than having heard that most wall-powered clocks are. In thinking about this I wondered how the clock could have a battery-backup if it is tied to mains? That’s actually a pretty interesting question. Turns out I was not wrong about how this clock works, but I only know that now because I took the thing apart to investigate.

Looking inside the clock there are two distinct parts: the clock module and the radio module. I ignored the radio and looked closely at the clock module for a 32.768 kHz clock crystal which usually show up in the “tuning fork” form factor. I couldn’t find any.

The next thing I looked at is what chip is driving the timekeeping board. It’s marked LM8562 and a quick datasheet search results in a “Bingo”! This part is listed as a “Digital Alarm Clock”. With a bit more internet searching, I think this is the chip that is in the majority of alarm clocks. If you set time and alarms by holding one button and using the fast-up or slow-down buttons to change it I’d wager it’s based around an LM8562.

Ew. 30 years of yuck.

The chip drives the display and has the user input buttons I just mentioned. The key feature I was looking for is listed as follows: “12/24-hour mode, 50/60 Hz selectable (provided that it is impossible to select the combination of 24-hour mode and 60 Hz)”. This chip is indeed tied to mains and the next feature touted in the datasheet answers my question about battery backup: “On-chip CR oscillator for backup use at the time of power failure”. So there’s an RC oscillator built in to run off battery when the power is out. I should do some testing to see how accurate this is. It’s quite likely your time goes off very quickly running from an RC clock source but as long as it doesn’t completely reset the clock it’ll still wake you up in the morning if the power comes back on.

Clocks That Aren’t Tied to Mains

The cheapest built-in microwave I could buy certainly doesn’t have special time keeping.

I’m now operating under a rule of thumb for identifying mains-tied clocks. If it plugs into the wall and doesn’t set itself, it’s likely clocked from grid frequency. Think especially about appliances like microwaves, VCRs, traditional ovens, and non-internet connect timers that have a clock feature like programmable thermostats and light switches. But of course there are exceptions to every rule. If the clock is using a wall wart that converts AC to DC then it is not tied to mains since the DC doesn’t have a zero crossing to count. It’s possible you have a wall-wart that converts AC-AC but unlikely.

You’ll also note that I mentioned the clock shouldn’t set itself. There are some clocks that when powered on (from a plug or batteries) will set their own time and date. In pitching this article to Elliot Williams he mentioned that DCF77 modules are like 1€ apiece and likely clocking most things in Germany. These work by listening for time data from a radio station. There’s a similar standard in the USA called WWVB. My assertion is that if a clock has one of these modules they will set themselves which is an easy way to tell the device is not using mains frequency. But these devices are probably limited to the slightly higher-end: one Euro added to the cost of a competitive consumer good might not be worth it when the same stable timekeeping job is available without it.

Finally, it’s possible you have a clock that uses a very accurate time standard. My absolute favorite example is the DS3232 (you may know it as the Chronodot), which is a temperature controlled oscillator (TCXO) built right into the chip. These things have incredible precision for a single-chip that can run on a coin cell for years. But they’re kind of pricey for consumer goods so I believe you rarely see devices that use them. The Bulbdial clock I have in my living room has one — it’s an add on, but as I said this is my fav time chip.

Tell Us About Your Clocks

So we ask you: how do the clocks around you get their time? We’d love to hear if your clocks are using the LM8562, pulling from a more advanced source like radio signal, or something not covered here at all. Where do your appliances get their time standard?