Accuracy of DS1307 Real Time Clock module

I have a couple of these RTC modules based on DS1307 : http://littlebirdelectronics.com/products/real-time-clock-module

I am finding they loose a few seconds every day which is more than I would have expected, enough to cause a problem over time (no pun!). The DS1307 datasheet and AN58 explain that accuracy depends on the crystal qualities and how it is installed - no surprises there.

Curious to hear from others who have noticed similar inaccuracy in this or equivalent RTC modules and how you have handled it. e.g. an option I am considering is to monitor the lost seconds and come up with a correction factor to apply in the sketch once per day, or week.

I have a couple of different circuits based on the 1307. Two boards are different ground plane designs. It doesn't seem to matter. Circuits using either of my two designs either lose 2-3 seconds per day or 2-3 minutes per day. The boards are consistant to whatever their loss is, but I can't seem to predict what loss will be.

After my supply of 1307s run out, I'm done with them. I'm going to use DS3231 moving forward. More expensive, but much more accurate.

The DS1307 is specified for a 32768khz crystal that takes a load capacitance of 12.5pF. However, those crystals are available for various load capacitances values from 6pF to 12.5pF. Maybe they used the wrong crystal. Or maybe they put a ground plane opposite the crystal pads, thereby increasing the load capacitance, which decreases the frequency.

Did they solder the crystal's body to the board?

The datasheets for the crystals I bought said specifically not to do that. The heat of soldering can crack the crystal.

As I recall, the boards I used kapton tape to hold the crystal closer to the board perform slightly better.

The DS1307 and matching crystals are supposed to operate best within a rather narrow range near room temperature. Even the best matched, calibrated DS1307 and crystal will drift when subjected to lower or higher temperatures. That's why the DS3231 is so accurate...not only does it have a built-in, pre-trimmed and calibrated crystal, but it modifies the load capacitance in response to temperature measurements. It also keeps track of how old it is, and applies an aging factor to the load capacitance as well.

I recently did some accuracy testing on a half-dozen DS1307 breakout boards. After letting them run nearly 10e6 seconds, the errors were -44, -30, -28, -20, -7, and 14 ppm. Five of the six had parts I bought from various sources, and while the crystals were not all identical, all had ±20 ppm specs, and I believe all were 12.5pF. The sixth was a kit I purchased, so I'm not sure about that one (the kit had the -30 ppm error).

So pretty disappointing. I'm a fan of the DS3231 too. Simultaneous with the above tests, I checked a Chronodot that had run nearly 1.5e6 seconds, and it was 1 ppm off. Thank you, macegr! XD

Not a scientific test, small sample size, etc. etc., but I still found it interesting.

[quote author=James C4S link=topic=87846.msg659867#msg659867 date=1327017905] Did they solder the crystal's body to the board?

The datasheets for the crystals I bought said specifically not to do that. The heat of soldering can crack the crystal.

As I recall, the boards I used kapton tape to hold the crystal closer to the board perform slightly better. [/quote]

I use a small drop of gel-type super glue to hold the crystal to the board. Then I solder one lead at a time, with a micro alligator clip on the crystal lead as a heat sink, and taking care not to heat it longer than necessary.

[quote author=Jack Christensen link=topic=87846.msg659933#msg659933 date=1327023941] I use a small drop of gel-type super glue to hold the crystal to the board. Then I solder one lead at a time, with a micro alligator clip on the crystal lead as a heat sink, and taking care not to heat it longer than necessary.[/quote]

This sounds like a reasonable (and effective) installation method.

[quote author=James C4S link=topic=87846.msg659937#msg659937 date=1327024351] This sounds like a reasonable (and effective) installation method. [/quote]

So I thought. Lot of good it seems to have done for accuracy! :P

But here is a very tempting solution!

http://www.ebay.com/itm/Original-FE-5680A-10MHz-Out-Rubidium-Atomic-Frequency-Standard-/250921757978?pt=LH_DefaultDomain_0&hash=item3a6c1a2d1a

After my supply of 1307s run out, I'm done with them. I'm going to use DS3231 moving forward.

I echo this. The ds3231 can use the 1307 library without modification so it's easy to use. I've had a 1307 project running since October and it's about 5 minutes off now. Another project with a 3231 has been on since mid December and is still within 1 second of my computer's clock.

Can always go extreme and add GPS time ... http://www.dipmicro.com/store/DSSC-0104

The DS3231 looks like a good alternative to the DS1307, especially as it can operate at 3.3V and 5V, but SOIC package only it seems. I have a project where I really want to avoid using SM devices as other people will be building them. Are there any alternatives to the DS1307 that operate at both 3.3V and 5V and are available in a through-hole package?

good info all round, thanks !

stevemarple: Are there any alternatives to the DS1307 that operate at both 3.3V and 5V and are available in a through-hole package?

DS1302 is a DIP-8, 3-Wire, RTC. It operates from 2 to 5.5V and as a bonus point it can trickle charge the backup battery or capacitor. A library for arduino IDE is available here

Thanks for the info. The DS1302 doesn't have the SQW output that the DS1307 has, otherwise it might have done. I was planning to feed the 1Hz output from SQW to timer/counter2 in order to wake the Arduino from sleep mode every 20 or 30 seconds.

Any other DIP options?

but SOIC package only it seems. I have a project where I really want to avoid using SM devices as other people will be building them.

Not that I know of. For what its worth I finally caved because more and more parts are SMD only. I use these to prototype

http://www.futurlec.com/SMD_Adapters.shtml

and find that the drag method of soldering SM parts works well once you get the hang of it, even on finer pitch parts like the SSOP FT232RL.

The other thing you can do is buy a presoldered DS3231 like the Chronodot,

Good luck!

The DS3231 is easier to solder than you think...most of the pins are connected to ground. So much good stuff comes in SOIC and smaller, that I think any serious electronics experimenter should have some SMT breakouts and be able to do drag soldering. I actually prefer SMT to through-hole for hand assembly.

"I was planning to feed the 1Hz output from SQW to timer/counter2 in order to wake the Arduino from sleep mode every 20 or 30 seconds."

Won't that wake it every second? Or will you increment a counter every time, and when high enough, then do something?

CrossRoads: "I was planning to feed the 1Hz output from SQW to timer/counter2 in order to wake the Arduino from sleep mode every 20 or 30 seconds."

Won't that wake it every second? Or will you increment a counter every time, and when high enough, then do something?

The latter, it should wake it up whenever the counter reaches a pre-determined value (not overflow). I've not actually tested it waking from sleep but I have successfully tested it generating interrupts. I recently added some examples of how to do this on my Calunium board to the Calunium github repository: https://github.com/stevemarple/Calunium/tree/master/software/examples The examples can probably be made to work on your Bobuino board with just a change on pin number.

Idea: if the Arduino environment had a mapping (in pins_arduino.h) from pin function to pin number then the same sketch would work unchanged on your Bobuino, my Calunium and maniacbug's Mighty-1284P. Something like

#define PIN_TC2 15