Checking clock accuracy

This T&T explains how to check the accuracy of a Real Time Clock (RTC). Lets make it a little bit harder and say that you do not have access to the Internet…

Checking a RTC requires a highly accurate reference time base which can be read from a radio signal. Starting from there, two options are available: read the DCF77 radio signal, or the time stamps from a GPS receiver !

DCF77 is a German longwave time signal and standard-frequency radio station delivering a timestamp sent Coordinated Universal Time (UTC)+1 or UTC+2 depending on daylight saving time. Many, not to say most synchronized clocks and even watches read the DCF77 frames. The DCF77 frames feature:

  • Current date and time bits
  • Leap second warning bit
  • Imminent change of CET to CEST, or vice versa, Announcement bit
  • Central European Time (CET) / Central European Summer Time (CEST) bit
  • Abnormal transmitter operation identification bit
  • Several parity bits

Some restrictions must be taken into account: the radio signal may be disturbed and the emitter experiences some downtime over time (0.05 % downtime).

Many cheap (< 10€) receivers are available on the market such as this one below

As usual, the arduino community makes some nice code available

An alternate option consists in reading the time stamps from a GPS receiver. GPS receivers output a 1PPS (1 pulse per sec) signal which is to be used for synchronizing the timestamps readings using the BWC, GAG, GLL or the RMC sentences from the NMEA standards. Use the ZDA sentence to get the local time. The GPS time is as accurate as 40 ns, which far enough for my own needs.

I built a simplistic prototype to evaluate the Maxim-Dallas DS3231 RTC (datasheet).

After 4 months of continuous operation, after exposing the prototype to marge temperature changes (up to 20°C), I have been able to notice a 3 seconds shift which is better than the specification of the RTC (2 ppm @ >0°C and <40°C). which turns to less or equal 1 minute per year. In this way I managed to get a rough idea about the drift over 2, 5 or 10 years which represent the typical time scales for the IoT projects.


Leave a Reply

You must be logged in to post a comment.