Benchmarks: Real Time Clocks – Results for Raspberry Pi/Arduino
We 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, graphs and software will be published in an upcoming issue of Raspberry Pi Geek magazine.
An early quick review of all the devices was published earlier.
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:
The jagged lines are on the graph because I am 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.
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 |
We hand built a test jig to test all of the RTCs.
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. I use the NTP to update the Raspberry Pi so I can use it to estimate the error rates of the RTCs.
Thanks for running these tests, really great results. I’ve been producing the ChronoDot (DS3231 module) for some years now, and tried to set up a similar test bench…I didn’t process the data correctly though. I was testing against a DS1307 and it ended up looking like a near-vertical error line with completely flat error line! Very glad to see some well-presented test data on this.
thanks garrett!
Take a look in the latest issue of Raspberry Pi Geek magazine for the full analysis.
John
What was the range of ambient temperatures during these tests?
Peter,
These tests were all run at room temperature. There is a plan to run a cold and hot test (same devices and parameters) in the future.