Real Time Clock

Hi
I have put together a 24 hour clock to put in my radio shack with a DMD (dot matrix display) from Freetronics a Uno and a TinyRTC I bought off eBay.
Problem is the clock gains about 1.5 minutes a day. I know its not a lot of gain but I would like to make it as accurate as possible.
I am not sure if its the programming or there is a problem with the RTC.
I have included the sketch if someone would like to have a look and tell me where I have gone wrong.

Any help would be appreciated.

Adrian

_24_hour_clock_v2.ino (12 KB)

I made a search, take a look at those links: http://forum.arduino.cc/index.php?topic=189037.0 http://forum.arduino.cc/index.php?topic=54621.0

I don’t know the answer and I don’t look to the code, but to be a problem only with the RTC it seems to much.

Thanks for the replies.

When I tried to search for help I couldn't come up with anything obviously I typed the wrong search term. I have come to the conclusion that I have purchased a couple faulty RTC's as they both perform the same way that is they both gain time over a 24 hour period.

I have just placed an order for 2 new RTC's from a reputable dealer (not eBay).

Adrian

In that 2 links that zaxarias gives you there are good information, specially in this: http://forum.arduino.cc/index.php?topic=189037.0

Most of the RTC have a pin named SQRT that output a 1Hz square signal with that exact frequency.If you have a scope you could measure it to see if it is exact. If you dont have a scope you could try to use interrupts to sense the signal and measure it using millis() Did you try to change the cr2032 battery?

If it's the DS1307 you are using, it is not a particularly accurate clock and buying 2 more from a different source probably won't help. The DS3231 is considerably more accurate.

Pete

el_supremo: If it's the DS1307 you are using, it is not a particularly accurate clock and buying 2 more from a different source probably won't help. The DS3231 is considerably more accurate.

Pete

Absolutely. Plus the temperature affects the external crystal/capacitors for the oscillator. DS3231 or DS3232 is the go.

It might be that the crystal (which is presumably of the correct frequency) does not have the correct capacitance as required by the 1307.

Tried the lock with another DS1307 and still same problem, from what Ihave been told I will have same problem I matter where I get the RTC soi have bought a DS3231 with temp compensation and see how that goes. In the meantime the lock will be used until I get themes RTC now just have to make a frame to mount everything in :-)

Adrian