Benchmarks: RealTime Clocks – DS3231 / PCF8563 / MCP79400 / DS1307

Real Time Clocks
3.4 Million Second Test - PPM

Benchmarks: Real Time Clocks –  Results for Raspberry Pi/Arduino – DS3231 / PCF8563 / MCP79400 / DS1307

SwitchDoc Labs is pleased to announce the addition of the DS3231/AT24C32 Module to DS3231the SwitchDoc Store.  You can read about the module here..

The software drivers for the DS3231/AT24C32 module now include the eeprom drivers and the ability to read temperature.

Benchmark Results – DS3231 Wins

SwitchDoc Labs recently completed a 3.4 Million Second test run on a Raspberry Pi on three different Real Time Clocks(RTCs).  These results are also valid for an Arduino based system.

A shorter test (300,000 seconds) was performed on the DS1307.  The complete analysis, KeepingTimegraphs and software was published in issue 7 and 8 of Raspberry Pi Geek magazine.

An early quick review of all the devices was published earlier as well as drivers for all of the real time clocks.

The Results

We are measuring the results in PPM (Parts Per Million).  For example, losing 1 second per day is a drift of 11.5 PPM while 1 PPM is a drift of 0.0864 seconds per day.  The PPM (Parts Per Million) measured error is shown on the graph below:

Real Time Clocks DS3231
3.4 Million Second Test – PPM

 

 

 

 

The graph below shows the cumulative error for each of the three RTCs under test.  Again, the DS3231 was the clear winner.  However, note that all of these lines look very straight.  What that means is with adjustments the PCF856 and MCP79400 can be improved.
Seconds ErrorThe jagged lines are on the graph because we are only able to detect integer second errors because all three real time clocks only show seconds.  The Raspberry Pi has better resolution, but we round it off in order to do reasonable comparisons with the RTC data.

Real Time Clocks
The Four Real Time Clocks Used in the Test
RasPiConnect Project Curacao
RasPiConnect Solar Panel Status Screen

 

 

 

 

 

 

 

The PPM Chart was produced by using MatPlotLib on a Raspberry Pi.  A tutorial on how to do this is shown here.  Putting the graph up on your iPad using RasPiConnect is also here.  Above you can see what a MatPlotLib graph looks like on an iPad.

Accuracy Results

The table of results is below:

Device Test Length (Seconds) Measured PPM Specification PPM
DS1307 292,869 15 PPM 23 PPM
DS3231 3,432,851 < 0.3 PPM 2 PPM
PCF8563 3,432,851 24 PPM 29 PPM
MCP79400 3,432,851 4 PPM Not given directly

 

Real Time Clocks
RTC Test Jig

Why Use a Real Time Clock?

A realtime clock is necessary for any project requiring accurate time keeping especially when you don’t always have an Internet connection. For example, a Raspberry Pi being sent up in a balloon or a Pi working in the remote caribbean, like Project Curacao. The Raspberry Pi keeps pretty good time, but only if it is connected to the Internet.  The Pi uses an Internet service called NTP to set the clock on power up if the Internet is available. It then calls the NTP servers (some are actually hosted by the National Institute of Standards and Technology (NIST) and linked to their atomic clocks). You aren’t going to get atomic clock accuracy using  NTP, but it is pretty good. We use the NTP to update the Raspberry Pi so we can use it to estimate the error rates of the RTCs.