element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino internal clock inaccurate??
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 14 replies
  • Subscribers 392 subscribers
  • Views 1019 views
  • Users 0 members are here
  • clock
  • explodedclock
  • brass
  • collectable
  • antique
  • art
  • arduino
  • no4
Related

Arduino internal clock inaccurate??

jonivanart
jonivanart over 9 years ago

Hello! I am a newbie here and fairly new with the Arduino. I am building a piece of art that has a 150 year old clock as the main subject. I am going to use an Arduino to drive a stepper that runs the clock, a DC motor for the Chime drive (For visual effect) and a solenoid for the escapement mechanism also for visual effect. I've heard that the internal clock on the Arduino is inaccurate from others. What will I need to make it have an accurate output?image

  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 9 years ago +3 verified
    Hi Jon, Interesting project! Will it not damage the mechanism though? Maybe something like that is worth a lot of money. You didn't say how accurate you wanted : ) Anyway, the Arduino clock is ok, but…
  • Robert Peter Oakes
    Robert Peter Oakes over 9 years ago +2
    It sounds like what you need is a very accurate pulse / time period, not he arduino actually keeping time Using an internet connected NTP client as sugested by shabaz would be an easy way to keep time…
  • jonivanart
    jonivanart over 9 years ago in reply to shabaz +1
    Thanks! To answer the first question. "Will it damage the clock and maybe it's worth a lot of money? I have plans to put the drive on the proper gear with the least amount of drag/pressure on the coupling…
Parents
  • shabaz
    0 shabaz over 9 years ago

    Hi Jon,

     

    Interesting project!

    Will it not damage the mechanism though? Maybe something like that is worth a lot of money.

     

    You didn't say how accurate you wanted : )

    Anyway, the Arduino clock is ok, but not spectacular. It may not be precise, and you'll notice time drifting slightly (perhaps a minute per week or a bit more - enough to be irritating).

     

    A nice device is the DS3231, you could expect a minute or two of gain or loss per year; therefore in comparison the Arduino clock is an order of magnitude worse.

    In practice the Arduino clock is more worse than that, because it is affected by change in temperature (the DS3231 is temperature compensated, so affected less).

     

    Actually, after all that, you would have achieved a clock circuit that is still an order of magnitude poorer than the 250-year old Harrison clocks : ) which were only out by a second per month,

    but the DS3231 circuit costs a tiny fraction of course and doesn't take a lifetime to build.

     

    There are other ways to have precision clocks (e.g. GPS based or NTP based) depending on where you wanted to go with this.

     

    Information on how to use the DS3231 is here. One important point is that it has 3.3V logic, not 5V like the Arduino Uno. So you may wish to use a different board than the Uno.

    There are some 3.3V Arduinos, but I have not used them so I wouldn't be able to recommend any. There are Arduinos (and other single board computers such as Raspberry Pi - although this

    could be considered over-the-top for a clock) with network capability or with Ethernet shields, so NTP could be used with them. A google search on 'arduino ntp clock' revealed some hits.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • jonivanart
    0 jonivanart over 9 years ago in reply to shabaz

    Thanks!

    To answer the first question. "Will it damage the clock and maybe it's worth a lot of money?

    I have plans to put the drive on the proper gear with the least amount of drag/pressure on the coupling pieces and gears in the clock.  Also on top of that, I will be making a rubber breakaway/absorption coupling in between. If something get's out of whack and jams the gears, it will separate. As far as the value. The clock was severely damaged in all other aspects other than the gear train and of course no parts available. LOL! I will make it far more valuable than it would have ever been as a collectible clock. To give you an example. the last project will be for sale for at least 6 figures. ;-)

     

    As far as accuracy, a minute per a week wouldn't be bad considering the original would have been about a minute a day. LOL! But seriously, I like the sound of the 1 to 2 minutes per year but I will definetly need some resources to learn how to set the clock module up paired with an Arduino etc., which I'm sure I can find. Is the DS1307 basically the same thing but with the soldering points?

     

    I do plan on purchasing 2 Arduino's as a permanent part of the project that is soldered in and smaller like the Pro mini 328. One will be the "Chime Arduino" and have a music program for the chimes. It will be signal'd by the main Arduino when the chime needs to be sounded off since there aren't enough outputs on the one Arduino for all the electromechanical devices in the project. Also I want to be able to leave the clock running and upload musical programs to the chime Arduino as I write them. On top of that I want to have some signal buttons to make tunes when I push them for show and tell. :-) 

     

    I will also be making a voltage divider circuit to create the power needed for the different devices so making a 3.3v line won't be an issue if needed.

     

    Cool stuff on the arduino ntp clock search!

     

    Thanks again for all the time and info. It is very much appreciated!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 9 years ago in reply to jonivanart

    Hi Jon,

     

    Great, sounds like an excellent idea with the rubber coupling. DS1307 is more popular than DS3231 for hobbyists, so more chance of finding info on arduino/DS1307 projects. Less accurate than the DS3231, but more than the Arduino on its own, so a good compromise. The DS1307 integrated circuit is available on hobbyist-friendly soldered boards, so no need to solder the IC yourself, you could just get a board.

    As Robert Peter Oakes says, regardless of the method you use to obtain your clock, you'll need a strategy to either directly drive your stepper motor from the clock (hard to do) or perform a compensation (e.g. daily) to correct for any time (probably seconds) gained or lost.

    The way I'd possibly approach that (never tried it) is to keep a local count in a variable (i.e. still use your arduino clock and arduino events/interrupts or whatever constructs arduino's have to pulse your stepper motor), and compare with the RTC (DS3231, 1307, or whatever method you choose) daily (or some other interval e.g. hourly).

    I'd also pre-determine an amount of time (e.g. 1 minute) that would make 1 second invisible to the average observer.

    So, daily or hourly, after the comparison of local vs RTC time, if the delta is (say) one second or more, then for the next minute I would run my local clock at a speed that I can correct for 1 second. After the minute had completed, I would then compare again, and repeat, until the delta is less than one second.

    Anyway, that's just an idea - maybe there are other more refined ways of doing it.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • shabaz
    0 shabaz over 9 years ago in reply to jonivanart

    Hi Jon,

     

    Great, sounds like an excellent idea with the rubber coupling. DS1307 is more popular than DS3231 for hobbyists, so more chance of finding info on arduino/DS1307 projects. Less accurate than the DS3231, but more than the Arduino on its own, so a good compromise. The DS1307 integrated circuit is available on hobbyist-friendly soldered boards, so no need to solder the IC yourself, you could just get a board.

    As Robert Peter Oakes says, regardless of the method you use to obtain your clock, you'll need a strategy to either directly drive your stepper motor from the clock (hard to do) or perform a compensation (e.g. daily) to correct for any time (probably seconds) gained or lost.

    The way I'd possibly approach that (never tried it) is to keep a local count in a variable (i.e. still use your arduino clock and arduino events/interrupts or whatever constructs arduino's have to pulse your stepper motor), and compare with the RTC (DS3231, 1307, or whatever method you choose) daily (or some other interval e.g. hourly).

    I'd also pre-determine an amount of time (e.g. 1 minute) that would make 1 second invisible to the average observer.

    So, daily or hourly, after the comparison of local vs RTC time, if the delta is (say) one second or more, then for the next minute I would run my local clock at a speed that I can correct for 1 second. After the minute had completed, I would then compare again, and repeat, until the delta is less than one second.

    Anyway, that's just an idea - maybe there are other more refined ways of doing it.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube