Professional Documents
Culture Documents
Gear Clock
by abbtech on October 21, 2009
Table of Contents
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
http://www.instructables.com/id/Gear-Clock/
License: Attribution Non-commercial Share Alike (by-nc-sa)
The Gear Clock Kit is now available. Have a look at our kit page for more details . If you have a CNC machine you can cut your own gears and just purchase the
electronics for the clock .
To achieve the correct timing the 9 tooth motor gear is advanced 4 steps every 9 seconds. By moving 4 steps at a time the motor routines can be simple since the motor
is always at rest with the same coil energized.
http://www.instructables.com/id/Gear-Clock/
step 2: Construct the Clock Electronics
Microcontroller
The brains of this project is a PIC 16F628A microcontroller. It keep track of time and activates the stepper motor when needed.
Buttons
The interface is very simple, it consists of two buttons. When the left button is pressed the clock advances time using the motor. When the right button is pressed the
clock decrements time using the motor. The only issue is when you need to correct time by many hours you would have to keep the button pressed for a long time. The
stepper motor is also always energized to prevent the gears from slipping. To overcome this issue when both buttons are pressed the stepper motor is deenergized and
the minute gear can be spun freely.
Motor
The motor is a unipolar stepper motor that has been harvested from an old 5 1/4 inch floppy drive. This is the motor that used to move the read write heads back and
forth, to get one of this size and power you’ll need to find a nice old one. Modern floppy drives don’t have steppers with this level of torque.
This motor moves 1.8 degrees per pulse which means that with 200 pulses it will make one full rotation. Since it’s a bipolar motor it is simple for the PIC to drive it with
only 4 transistors.
Code
The code is basically split into two sections, there is an iterative loop that monitors the buttons for a change in state and checks if the internal clock has crossed the 9
second mark. If one of those conditions has occurred the stepper motor is driven appropriately.
The other section of code is interrupt driven and it keeps track of time. An interrupt is triggered every 0.1 seconds and adjusts an internal clock as needed. There is a true
running clock inside, if you connect the clock PIC pin 6 to a computer serial port operating at 9600 bps you will see the internal clock values update once per second. The
clock value in this case is arbitrary since it is never shown and will not be the same as what the gears are displaying but this same code will be used in future projects
which will use this code display time.
http://www.instructables.com/id/Gear-Clock/
step 3: Assemble and Enjoy
All the pieces screw together, the only piece that is glued is the stepper motor into the motor holder.
http://www.instructables.com/id/Gear-Clock/
Related Instructables
DIY CNC (guide) $20 CNC CNC (guide) by LED Binary Parallel Port 3
by Instructables Machine by Instructables Clock by Axis CNC
Multimeter Guides Techbuilder ElevenOf9 Driver, Opto-
Guides
Clock by Isolated,
abbtech Unipolar
Steppers by
ChromationSystem
http://www.instructables.com/id/Gear-Clock/
vertisemets
Comments
39 comments Add Comment
Weird.
Thanks.
http://www.instructables.com/id/Gear-Clock/
john3f says: Jan 2, 2010. 6:20 PM REPLY
The step motor used in this project is a " unipolar " type step motor, not a bipolar one. Bipolar step motors dont have a "common, ground, +V, coil split etc.."
connection. Also it's not easy to drive a bipolar step motor. A bipolar stepper requires h-bridge circuit and 8 transistors for the coils to be driven.
Very nice project! In terms of getting a rusted metallic look on wood, I've had good luck spraying the parts with flat black, then just lightly dusting with bronze
metallic paint.
http://www.instructables.com/id/Gear-Clock/
abbtech says: Oct 23, 2009. 11:24 AM REPLY
LOL, it does!
I used Artcam to design most of it. MDF is cheap and tough, I would use it over cardboard.
http://www.instructables.com/id/Gear-Clock/