Arduino Timekeeping -- Crystal tuning

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
westfw
 
Posts: 2008
Joined: Fri Apr 27, 2007 1:01 pm

Re: Arduino Timekeeping -- Crystal tuning

Post by westfw »

Note that the original complaint "36 seconds per day" is only 0.02% error...

Makes me wonder ABOUT our expectations, and AT the talents of mechanical clockmakers...

User avatar
grabberson
 
Posts: 9
Joined: Tue Sep 20, 2011 12:27 pm

Re: Arduino Timekeeping -- Crystal tuning

Post by grabberson »

I assume the oscillator is some division of the clock crystal, which says SPK16.000G on the top - presumably 16 Mhz. The hardware says Arduino UNO, board model R2.

Using the above method above I can get +/- 1 second every four days. Maybe better if I kept refining the TIME_CORRECTION value. But I think JChristensen is right - without temperature compensation (e.g. Chronodot) that's about the best I can do.

I agree Westfw - an amazingly small error is unacceptable in a clock application! A mechanical watch that's banged around and encounters large temperature variations keeps time as well as this.

Regards.

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Arduino Timekeeping -- Crystal tuning

Post by rbardsley »

Hi everyone. Fascinating thread! Would you happen to have the full example code for this checktime() function? I am not a programmer, but learn by example. I can't figure out how to implement this correctly. Are you using the time library? Anyone mind sharing a barebones example of this that spits out something to the serial monitor?

Greatly appreciated!

Ryan
Boston, MA

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”