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
  • jonivanart
    0 jonivanart over 9 years ago

    Robert Peter Oakes shabaz

    The RTC sounds really cool and I get where you are all coming from but may take a while to get to that level of programming on my part. Another thing is that I don't think the art piece will be near an internet connection either.

    What if I have 2 trigger buttons. One for UP and the other for DOWN? I want to have a LCD to display the time digitally on the back of the clock. Basically, someone come in and check the digital clock with their cell time and toggle the stepper UP or DOWN to set the time about every couple months or so or whenever. This piece will likely be in a museum and I don't want anyone messing with it mechanically but the curator could do it if needed if I set it up like that.

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

    Hi Jon,

     

    An LCD and couple of buttons sounds a reasonable approach, although the Arduino has no way of knowing what the mechanical hands are displaying (e.g. there could be a power failure).

    In theory with some additional electronics it could remember the last time before it lost power, but that is getting complicated and may still get out of sync e.g. if someone accidentally turns the

    mechanism by hand.

     

    So, you might want the LCD to just be used to put in a delta (e.g. minus 5 minutes) when the mechanical displayed time needs changing rather than a normal clock time.

    To be honest, if you're just putting in a delta, then you could get away without any display, if you only need precision down to minutes. The operator could just press the 'up' button 5 times and the clock would

    increase by 5 minutes. If you expect there to be a change of daylight savings time too, then personally I would just have two more buttons for that - one to increment by an hour (or to increment by 10 minutes, so

    press it 6 times) and one to decrement by that amount.

    What do you think?

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

    I get it. That sounds good. Maybe I'm over thinking it all. LOL! I just thought of something too. This probably would have helped you a few comments back! LOL! I forgot the clock piece has the minute and hour on a mechanical slip system built in for setting the hands without interfering with the gear train.

    What if I just make a start stop button. I just stop the arduino clock when the second hand is on 0/60 mark then manually set the clock ahead a minute and start it when it gets to the that time. or even better make a display menu to ask the hour then minutes then say PRESS TO START. (1 button for up another for down and the 3rd for enter/PRESS TO START)

    Set that and the mechanical hands ahead about 5 minutes to allow time to do it all. Then hit start/enter when it becomes time. After the button for start is pushed it automatically goes to UP or HOLD mode. Up to move time forward and hold to pause it. For HOLD you release the button when time reaches that time.

    Possibly an option for daylight savings time. Daylight HOLD or daylight FORWARD maybe?

    Buttt!! If the power goes out I want it to automatically go to the right time. If possible?? I think I just confused myself! LOL! Seriously tho. Could I somehow put it in the program to do that? If it would too complex then I could just leave that out and just make them reset it if the power goes out...

    Thanks for your time and input. It is really helping me work a lot out already. :-)

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

    Hi Jon,

     

    I'd say it is possible to implement pretty much anything (it's software, so everything is possible ; ) although your hardware will need to support certain things like the power failure thing, but we can discuss that in a bit..

     

    Mainly, the issue is the determination of the workflow for the user. With a scheme where the clock is temporarily stopped to allow a manual adjustment, for the user who just wants to trim by a minute or two every week or day, he will need to do a few things - press or hold a button to stop the clock, manually adjust the time (which may be a two-handed operation if he wants to take some care maybe? I have no idea) and then press or release a button. And also he will visually need to confirm that both LCD time and mechanical time look the same with his wristwatch or whatever.

     

    With the earlier scheme, he can just hit the '+' or '-' button x times for the number of observed minutes of error, and walk away.

     

    I'm just concerned if you go through the LCD route, you may still hit scenarios where the LCD time is different to the mechanical displayed time (the power failure example was just one scenario that would cause this, so would accidentally touching the clock hands). You or I would understand there is a limitation that there is no direct self-correcting "linkage" (e.g. optical or magnetic sensing means) between the LCD and mechanical displays, but the average user (e.g. museum staff) would have no idea, technology "just works" for them. So for me, a 4-button solution with +1, -1, +10, -10 sounds cleaner - but I'm not the target user, and I like stripped-down minimal user interfaces lol. Not everyone does!

     

    There is no right or wrong answer, just depends on what you're comfortable with your users doing, but what you propose is feasible to implement technically. I think there are many LCD shields for the Arduino.

     

    Regarding correction on power loss, that requires an RTC and backup battery, and a way of recording the current time every (say) minute to non-volatile memory (e.g. some free bytes of battery-backed SRAM which some RTCs contain), so you can read it and know on power-up what was the last time the device had power. It is complicated to do but feasible. Complicated because you have to cater for scenarios like the SRAM being uninitialized or corrupt due to power failures while it is being written, etc. There are solutions, but requires a fair amount of consideration and coding, and I really have no idea how confident you are with this. If it is not essential then might be worth leaving it out, because it could potentially double the coding effort (or more) for the project.

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

    That all sounds feasable and definitely easier but how would I implement the chime system and let it know when to go off(Chime) and what type of chime(Hourly or quarterly or both depending on the customer preference)?

    Also I'm going to get real deep into coding soon. Starting next week I will be devoting more time to that so I don't think that will actually be an issue as far as writing all the code eventually but I definitely want to have a good layout to shoot for for sure. I really think us talking about it is getting us there. :-)

    Maybe they should call me if the power goes out? LOL!

    Question then. I thought the battery in the ChronoDot allows it to keep time without power??

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

    Hi John,

     

    Yes, the DS1307 board you refer to has a battery, so it will keep time without power.

    I had forgotten about your chime requirement - that complicates things a bit, I think you will need some display and menu to be able to set this, and means your microcontroller does need to know the actual time, rather than just provide accurate steps to the mechanism. I've not used them but I see there are MP3 boards for the Arduino where you can upload your desired sounds. They mostly take a microSD card.

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

    I do tend to complicate things sometimes. LOL! Would the MP3 board convert somehow to the hammers on the chimes?

    There won't be a speaker. There will be 4 different rods that are tuned at different lengths to make only 4 notes available. Another reason for the second Arduino. Allowing me to build program/tunes as I get the time to. Then I can just reload the file with the added tunes whenever I want to. :-) I want to get good enough to make base notes/programs for each individual hammer then build arrangements. Thats a lot huh? LOL!

    I'm thinking I need to build the program for the main clock stepper to simply keep the clock in time. Then add the second hand stepper to that.

    Then either figure out how to make a trigger for different combinations of chime signals to the second Arduino. How can I make a communication signal between the 2? It will need to communicate a signal for Hourly- 12 different signals then quaterly then random tune mode on then random tune mode on.

    Or do the display part next.

    Am I gonna have enough pins to do all this? LOL!

    1- Display

    2- Stepper Hour and minute

    3- Stepper second

    4- Solenoid for escapement latch mechanism

    5- Chime signals to other Arduino(communication SPI maybe?)

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

    BTW... Thanks again. I will give you credit for helping me.  You have been very helpful...

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

    Hi Jon,

     

    Sorry I didn't get a chance to look into this earlier, and looks like I made a mistake, I didn't read closely and realize that there were mechanical chimes.

    In that case, yeah the mp3 function is really not needed.

    Personally I'd try to get it all functioning with one Arduino (I generally don't like multi-microcontroller solutions unless there is a real reason for them) since

    sometimes it can complicate things more than simplify them.

    There are I/O expanders to give you more capability if you run out of Arduino pins. However if you feel more comfortable with separated microcontrollers

    then you could use perhaps a serial interface for communications between them. Some information on a method to do that is here: https://www.arduino.cc/en/Reference/SoftwareSerial

    I'd say your project is moderately complex though, so you may want to simplify for the first iteration and do the chimes handling and chimes sequence upload later.

    • 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,

     

    Sorry I didn't get a chance to look into this earlier, and looks like I made a mistake, I didn't read closely and realize that there were mechanical chimes.

    In that case, yeah the mp3 function is really not needed.

    Personally I'd try to get it all functioning with one Arduino (I generally don't like multi-microcontroller solutions unless there is a real reason for them) since

    sometimes it can complicate things more than simplify them.

    There are I/O expanders to give you more capability if you run out of Arduino pins. However if you feel more comfortable with separated microcontrollers

    then you could use perhaps a serial interface for communications between them. Some information on a method to do that is here: https://www.arduino.cc/en/Reference/SoftwareSerial

    I'd say your project is moderately complex though, so you may want to simplify for the first iteration and do the chimes handling and chimes sequence upload later.

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

    Thanks. The I/O expanders do sound like a great idea and yea the plan was to get the bases operation/programming first then expand to the chimes later.

    This is definitely a complex project but I'm not one to shy away simply because of the work it will take. The last project, a guitar, took me 5 months to build. https://www.youtube.com/watch?v=kQLxJfoCihs

    I will keep you updated on the project.

    Here is what I have for now. https://www.youtube.com/watch?v=RS1lEBb0C00

    I also have all the power suppply needs met. I have 2 laptop computer power supplies which combined have the 24vdc, 12vdc, and 5vdc outputs I will be needing. I will be mounting them next.

    Thanks for the help for now. :-)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
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