- Published: Wednesday, 28 September 2011
- Written by Jon Chandler
Here's another great article I found via Hack-A-Day about controlling the ubiquitous quartz clock movements that are all over the place. Cibo Mahto explains how to easily control one of these using an Arduino but the same technique applies when using a PIC. The clock coil needs to be energized in a positive direction and in the opposite direction for each "tick" which is easily done by connecting it between a pair of port pins and toggling one pin high, the other low and then reversing the process. This makes it possible to control time - at least as indicated on one clock! Pulse faster than 1 Hz (once per second) and the clock speeds up. Slower and it slows down.
Cibo's article has all the details. There's plenty of explanation so doing this with any micro and language will be a piece of cake.
Controlling a clock with an Arduino
Update: The Arduino system is fine; the only thing you have to take into consideration is the 9.54 hour rollover event, which Rob Faludi has provided an excellent solution for here. I made up a nice little over-analysis of the issue, available here.
I have been wanting to make a variable-speed clock for a while, so this weekend I picked up a cheapish clock unit (thrift stores are a great source!), and played around with using the Arduino to control it. In summary, I was able to get everything going,
but there are some issues with the Arduino software that are going to prevent making it a really accurate clock. Explanation, source code after the break.