Gear Clock


Ever since I setup the CNC machine and built the controller housing I have been playing around with various ideas. Wooden gear projects have been around for a long time, and lots of people have made conventional gear clocks. I wanted to do something a bit different. This project combines some electronics and lots of wood.

Big thanks to The MAD Museum (Mechanical Art and Design Museum) for wanting to add the first production gear clock to their collection of items on display. They have a huge collection of other quirky mechanical machines, marble machines etc. You can visit it on display if you ever find yourself in Stratford upon Avon, UK.

**UPDATE** This project is now available as a kit. Please have a look at the Gear Clock Kit page in the online store or have a look at the Gear Clock Kit assembly page for additional assembly information.

The information below is of the prototype version, the CAD DXF and PIC Microcontroller HEX files of the kit version are available here on the kit page. If you are building one I recommend that you make the kit version.



The heart of the clock is a PIC 16f628A microcontroller (PDF). This microcontroller has an internal oscillator however an external 20MHz crystal oscillator is being used since it will have to accurately keep track of time for weeks and months. The microcontroller is interfaced to two buttons and one motor.


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.


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. There are many sizes and styles of steppers so it may take a bit of digging to find a usable 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 unipolar motor it is simple for the PIC to drive it with only 4 transistors. You will also need to be aware of motors with different number of pulses per rotation however 200 is the most common.


The gears are made out of MDF. They were painted to have a metallic look however the look I was going for was not achieved. Initially I was thinking of making the gears look like they were made of metal and left to rust for a few dozen years. I found some cool products that would give me that rusted effect but they were a bit too expensive. I settled for a can of Krylon Black Metallic Hammered Finish paint. The sample on the lid is a very nice black with subtle bit of gray. I think this might be from a bad batch since the final look is not as black as it should be. It also made taking pictures of the final clock a bit tough since even with modest lighting the glare was horrible.

The gear arrangement is as follows:

  • 9 tooth motor gear
  • 72 tooth minute gear with a 24 tooth secondary
  • 72 tooth intermediate gear with a 18 tooth secondary
  • 72 tooth hour gear

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.


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.



The schematic is just a quick back of the napkin design. I may cad up a proper design in the future. In the mean time if you have any questions about this one please ask.

Click on the image for a large version.

Download Code

If you are interested in burning your own chip you can get the HEX file here. If you would like to have a look at the source code that is available as a free item in the online store.

Download CAD Files


If you have access to a CNC machine you could cut your own clock parts. This zip archive has all of the DXF files for all of the clock parts. The g-code TAP files are also included if you prefer to use them. Please note that these files are only to be used to personal use.


121 Responses to ' Gear Clock '

Subscribe to comments with RSS or TrackBack to ' Gear Clock '.

  1. Alan Parekh said,

    on January 23rd, 2010 at 2:57 pm

    How much current is the stepper pulling? When the unit is not stepping (most of the time) it is being held in place by coil 1. In the kit version (which will be released soon) there is a PWM option which will hold the coil with less power.

  2. Dave said,

    on January 24th, 2010 at 7:48 am

    Resistance of each coil is 0.7 ohms which i got from a reference data sheet(can’t find the data sheet of my stepper motor), I’ll get a multimeter and get the accurate readings…(stepper motor is a 6v)6v/0.7 Ohms = 8.5714…Amperes??maybe…what if i add around 10 ohm resistors, to the base of the transistors???or do you suggest getting a power transistor…??btw im using an AC/DC adapter for power supply and it is set to 12VDC

  3. Alan Parekh said,

    on January 28th, 2010 at 4:05 am

    Is your 12 volt power supply adjustable? If it is set it for 7 volts. This should be high enough for the voltage regulator (for the chip) to function and will lower the draw from the stepper motor. Where did you see that spec? I don’t think that motor would be from your floppy drive because as you calculated it would be drawing tons of current that I am sure your plug in power supply can’t handle.

    If it is truly a 0.7 ohm stepper then you will need to find a different one. The transistors are only rated for between 500 and 600mA tops so they would not handle that current.

    Once you get a meter let me know what the actual measurement is.

  4. Dave said,

    on January 31st, 2010 at 10:26 am

    Hey Alan quick question! will a 48 unipolar stepper motor do the job?

  5. Alan Parekh said,

    on January 31st, 2010 at 12:03 pm

    Hi Dave,

    It will when the kit comes out, the new kit controller will work with 48 or 200 step steppers.

  6. on February 7th, 2010 at 1:17 pm

    […] have been putting the final touches on the Gear Clock kit which is made up of wooden gears. I have a new appreciation of the effort it takes to make […]

  7. John V said,

    on February 22nd, 2010 at 10:10 am

    Thanks for the great project. I cut the gears with your gcode and it worked real well. I was not able to locate a motor and was hoping that I might be able to purchase just the electronis and motor. If this is possible let us know. I know there are many cnc folks on various hobby sites that would be interested and it could be a major seller.

  8. Alan Parekh said,

    on February 22nd, 2010 at 11:06 am

    Hi John,

    We have had lots of inquiries about that, the motor, PCB and electronics will be available as a kit this week.

  9. Paul Rogers said,

    on May 7th, 2010 at 5:18 am

    Just learning to program PIC’s using PIBbasic. I have been going through your code for the clock and although I understand it, there is one part I cannot get my head round.

    ‘set the timer to 3036 (OBDC Hex) to allow for the timer to count to 62500
    TMR1L_Setpoint var byte bank0
    TMR1H_Setpoint var byte bank0
    TMR1L_Setpoint = $DC
    TMR1H_Setpoint = $0B

    Cannot understand how these HEX values in a 16 bit registry limits count to 62500. I can see where value of 62500 comes from but then I lose it. I presume it is something to do with the overflow. Checked data sheets but these don’t help. Would appreciate your explanation.

  10. Paul Rogers said,

    on May 7th, 2010 at 6:00 am

    I’ve figured it out. So simple. You sometimes miss the obvious.
    Overflow value 65535 – 3036 (0BDC) = 62499. I feel stupid at times. Still not sure about the 1 difference though.

  11. jasa web design said,

    on May 23rd, 2010 at 1:42 pm

    What I dont understand is how youre not even more popular than you are now.  Youre just so intelligent.  You know so much about this subject, made me think about it from so many different angles.  Its like people arent interested unless it has something to do with Lady Gaga!  Your stuffs great.  Keep it up!

  12. Art Fenerty said,

    on September 11th, 2010 at 7:23 am

    I am close to releaseing a softwar epackage to support this kind of work.
    You can find gears of all kinds at in the very near future.


  13. Alan Parekh said,

    on September 11th, 2010 at 11:28 am

    Hi Art,

    That looks like it will be an interesting gear making package.

  14. Tobby said,

    on November 3rd, 2010 at 3:28 am

    This is an amazing piece of work. I’d like to do it myself but it looks hard to do if you don’t have the proper tools and equipment. Very nice!

  15. on February 16th, 2011 at 6:43 pm

    […] cog from a mechanical clock designed by Alan Parekh before it had it’s final wipe […]

  16. on February 21st, 2011 at 9:50 am

    […] When you are laser etching some stuff there isn’t much contrast in the end result. There are rub on products that you simply buff off the excess. Only issue is you have a short working time before it is on everywhere for good. I am all about using products that you already own and didn’t know it could be used in a new and creative way. That is exactly what James Williamson has done with the crayon. Who would be looking for a black crayon right after they had laser etched some plastic? Well after you see the results you might be that person. You simply rub the crayon onto the plastic piece letting it fill in all the grooves that are etched, wipe off the excess with some alcohol and heat to melt and level the remaining wax. If you the clock gear looks familiar you are right, James looks to be building one of my gear clocks! […]

  17. vic enright said,

    on June 18th, 2011 at 5:11 pm

    often thought about making acrylic see through clock with the hour and minute hands on two discs lit up from the base different colours and likewise the numerals on square face bottom lit with say gold circles on face to hide the rotating disks driven by stepper motor in base,a carriage type clock like this would look fatastic on the mantelpiece

  18. Manolo said,

    on November 30th, 2011 at 10:33 pm

    I like so much your job, and i would like well if you want to, to have your relation for every gear, what are the size of every gear and how much gear did you use…

    sorry for my english, im studying english..! and mechanics

    Thanks in advance..

  19. on January 26th, 2012 at 7:08 am

    […] electronics controller for this clock. Since this clock doesn’t operate in the same way the Gear Clock did some custom firmware was […]

  20. dora said,

    on January 7th, 2013 at 5:42 am

    Pls provide more specification for gear will ask my engineering students to do this project.

  21. Alan Parekh said,

    on January 8th, 2013 at 2:37 pm

    Hi Dora,

    You can find the information in the article above. Is there something specific that you are looking for?

Leave a reply

Search Articles

Read or sign my guestbook, the most recent entry will be shown at the bottom of each page of this web site!

Home | Store | Kits | Hard Drive Clock | Stair Lights | Rotating Display| Fish Tank Lights | Small Projects | Links | Hacked Gadgets | Contact Information | Mailing List
              (c) 2005 - 2012 Alan Parekh