Go Down

Topic: RTC modules - who's is "best"? (Read 6694 times) previous topic - next topic


I only bother to adjust once per day at midnight. Drift is approx 7.5 seconds per day so at midnight I read the time, add 8 seconds, wait 0.5 seconds and then write the time back.

I was looking at adjusting as soon as it was off by a second.  So in your case I would add a second every 3 hours and 12 minutes.  I was also looking at having the clock track it's own error.  If I need to subtract a second after a couple days I might change the interval to 3 hour 12 minute 16 seconds.
It reminds me of the old grandfather clock.  Reset the time and then turn the screw under the pendulum.


I was also looking at having the clock track it's own error

How was you going to do this?

I could adjust the time hourly by reading time, waiting 312ms and writing time but will probably replace the DS1307 with one of my DS3231 chips as drift amount also varies with temperature. The 7.5 seconds was determined during winter/spring but with summer here it's drifting nearer 7.8 seconds per day.


How was you going to do this?

I was thinking, though I haven't done so, of starting off assuming zero drift and having with zero adjustment.  The clock would note the time it started.  At some later point I would check the time and adjust it up or down.  The clock would then take the adjustment amount and the amount of time that had elapsed and calculate a drift value.  It would then apply that drift amount.  At some point later if I needed to adjust the clock again the clock would use the addition adjustment to recalculate the fine tune the drift value.

I guess if I wanted to try and compensate for temperature I would need to add a DS1820 and track that as well but I think I will hold off on that.

It would be interesting to have a contest to see how accurate a clock you could make for under $5.

If power were not an issue, you could make a small oven for the clock or crystal and hold it at 40 degrees C or something.  That way you would not see a drift due to temperature changes.



I am slightly leaning your way to get one of yours.

Try and support people who develop the Arduino.

Looking at it, all looks good, but how do you set the "adderss" of it on the I2C bus?

That isn't mentioned.

I am still having trouble getting my head around that part - see my other post/s on the subject.

Still can't work out how to get the 23017 MCP working.


The address is hardcoded...actually, most of the I2C RTCs use the same address. That's why code designed for the DS1307 will work for the DS323x.

There is a library that makes using RTC modules and doing various timekeeping functions pretty easy. Here's an example I made a while back: http://www.macetech.com/blog/node/115

While I appreciate the sentiment, don't feel too obligated until you check out the relative shipping fees..USPS is killing me here.
Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store


Yeah, thanks,

I posted a bit more in the other thread.

So, the 1307 is "hard coded" - as I just learned.

That is one of two  chips.

How do I get to know the EEPROM's address?

Again, I've looked though the code, but can't resolve where/how it is set/read/defined.

Be it hard coded, or what ever:  Somewhere in the code it should indicate what address it (the program/sketch) expectst the EEPROM to be at.

So then I would put the MCP at the next available address.


To read/write to the DS1307 chip you use the Wire library see http://arduino.cc/en/Reference/Wire The DS1307 memory is not mapped to the MCU memory space so you cannot just read a MCU memory location to get a value from the DS1307. Using the Wire library you tell the DS1307 what memory location you want to read/write on that device (not MCU memory) and how many bytes to read/write and then read/write them.
A poor analogy would be a office filing cabinet. Your sitting at home and and want to access some file from the cabinet in the office at work. You cannot directly access the cabinet but you can phone someone at the office and tell them what file you want to alter and then they read the file to you or you dictate the changes to them.


Hi Riva.

I have the "Cenetipede" library.
(Argh!  I don't mind this autospelling, but when the brain can't get the spelling right, or it is a .....  anyway.)

So I have been told the pins nearly "directly translate" depending on the address pins on the MCP.


I have the "Cenetipede" library.
(Argh!  I don't mind this autospelling, but when the brain can't get the spelling right, or it is a .....  anyway.)

So I have been told the pins nearly "directly translate" depending on the address pins on the MCP.

This sounds like an question for macegr as to whether other devices can co-exist using the I2C interface on the Centipede shield.


The MCP23017 doesn't collide with the DSxxxx RTC modules no matter what the address pins are, they only control the last three bits of the address.

If the MCP23017 address pins are 000, then the Centipede library assigns pins 0 through 15 to that chip (using the library's own <object>.digitalWrite() function).

The documentation page shows everything, there are no hidden tricks to get it to work :) http://docs.macetech.com/doku.php/centipede_shield
Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store



Thanks.  I have the docs but shall have to read them again.
Just now I am working on my next sketch or potted plant watering system.

So the RTC's fixed address is outside the scope of the MCP's scope of addresses.


But then I wonder what happened when I had the library active and ran the example script and I got alternating black/white lines on the LCD.


I want to stop looking soon, but just found this one too:

Our PCF8583 Real-Time Clock Mini Board is the ideal solution to add a real-time clock or counter to your project. The board comes complete with the PCF8583 Real-Time Clock IC from Philips Semiconductor, which can also be used as a counter.

But don't know how good the chip is.

It is I2C bus connected.


Just a clock but I have been super happy with it - the Chronodot from Macetech. It uses the I2C bus and the DS3231. Highly recommended.


I use the Chronodot from MaceTech too.

couldn't be easier.    couldn't be better.

Thanks Macegr for your efforts.

Where can I get a nice discount on a bulk order - 250 units.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131