Introduction: Hanging Gear Clock
Gears never fail to capture the interest of anyone observing them. The inspiration for this clock was a minimalist approach to a gear clock. By simply hanging an incremented gear onto a small driven gear and letting gravity and mathematics do their thing, an eye catching clock can be made.
This project is aided through the use of a CNC router, however, it is possible to adapt these plans for use with other workshop equipment. All plans provided can be printed at a 1:1 scale and used as guides to help those who are not using computer assisted machining.
This project also uses a micro-controller and stepper motors to make the gears move and keep time. Detailed information regarding wiring and coding is also included in this instructable, but please comment if I've left anything out :)
Step 1: Materials
Bill of Materials -
The Wood Bits:
Lime wood/Basswood - Most of the clock is made from lime wood, it's light, bright and easy to carve. I used two thick pieces for the clock base and body, each is 29 mm thick and 120 mm wide. the total length was close to 350 mm but was cut in two as shown in the picture.
A thinner piece of lime wood was used for the light coloured gears, the original size was 15 mm thick by 150 x 150 mm.
Walnut - I used walnut for the larger gear and the front insert used to cover the motors. The only piece I could find was a 45 x 45 mm spindle blank which I sliced up and made into a board measuring 180 x 220 x 13 mm. If you can find a board close to these dimensions, you'll save yourself a task :)
Ply Wood - An A4 sheet of 3 mm ply was used as an access panel for the base unit of the clock.
The Electronic Bits:
Arduino Nano - I actually used a clone board based on the Arduino Nano. The board I used was the Cylewet CH340G 5V 16M Micro-controller board. It works just the same as the Arduino but costs a lot less.
Stepper Motors - The steppers I used are Elegoo BYJ48 5V steppers.
Stepper Drivers - The boards that drive the stepper motors are ULN2003 drivers and are usually supplied with the motors.
Power - You will also need a 5V DC mains adapter, and a barrel jack adapter of appropriate size.
Wires - You can get away with using jumper wires but if you have some soldering skill, this would be better.
Step 2: Cutting the Parts
The clock is made from 8 parts in total, this includes 4 gears, a body, a base, an insert (motor cover), and an access panel. The Vector files for all these parts are provided below and are 1:1 scale. If you're using a CNC machine, I'll presume you have your preferred method for operation and so I'll keep it brief. For anyone not using CNC, you can print out the svg files and glue them to your work pieces to use as a guide.
The Body -
The first part I cut was the body. This was cut from 29mm thick lime wood using a 6 mm 4 flute straight cut tool. Using the svg file I have provided below, I used makercam.com to generate the g-code for free. The body consists of a number of pockets which house the stepper motors and provide a channel for the wires. As the wires for the top stepper have to go behind the lower stepper, there is an extra deep section of channel to allow this. The diagram above shows the depths of each area.
The Gears -
For the gears, I used a much thinner 1.5 mm cutting tool to give better definition to the gear teeth. The thinner tool can also be used for carving numbers by using the "follow path" operation in makercam. I cut the large hour gear from walnut and the smaller gears from lime wood. (I also cut a a few small gears from the walnut so I'd have a choice of colours).
The Base -
This was also made from 29 mm thick lime wood using the 6 mm straight cutter. I made a box by pocketing out most of the material, leaving a lip and corners for screws. This allows me to attach the access panel later. You could also make a base box by any method you like, just be sure it has a hole to allow you to connect the body.
Access Panel -
This is just a rectangle of plywood :)
Step 3: Fit the Steppers
The stepper motors come with some screw attachments that I had to remove. I found the best way to remove them was to use bolt cutters, but they could easily be removed a number of other ways. I also gave them a little bit of a clean up with a file to neaten the cut.
Next, make sure the steppers fit into the body, be sure to feed the wires of the top stepper behind the lower stepper as shown in the photo.
After checking the fit, it's a good idea to remove the steppers and then sand the front of the body now. Once the steppers are fixed in place, sanding will be tricky. The walnut insert needs to be sanded flush with the body, now is the time to make sure it sits flush and looks neat.
Step 4: Electronics and Code
An unfortunate flaw in the design of this clock is the inability to access the stepper motors once the insert has been glued in place. For this reason, it is recommended to test your motors before you realise one of them is broken!
The photo above shows the testing of the circuit, but a clearer description is shown in the diagram.
The Nano micro-controller works exactly the same as an Arduino Nano. You need to connect it to a computer via a USB cable and have the Arduino IDE installed. You may also need to install the drivers for the micro-controller, however, newer versions of the Arduino IDE may already come with the driver installed. If you find you need the driver, it can easily be found on Google by searching for "CH340G drivers".
Be sure to select the correct COM port, board type (Arduino Nano) and processor type (ATmega238P). You should now be able to Upload the code provided below.
This is the code that runs the clock, for testing purposes you may want to change some of the numbers to see more noticeable changes, otherwise you'll be looking for small movements every 20 seconds or so :)
I'll talk more about how the code works later in this instructable.
Step 5: Body Assembly
Now we can be sure our steppers are not duds, it's time to fix them into position.
I used a standard grip clamp to press the small gears onto the stepper shaft. Take note of the walnut insert in place between the gear and stepper. The gear is a tight fit and once it is pressed on, you will have a hard time getting it off again, so make sure the walnut insert is already in place.
Now we can fit the steppers and walnut insert into the main body and glue the insert in place. You can glue the steppers if you like but don't use too much glue as there is already limited space inside the body. I found they remained in position without the need for glue.
Next, feed the stepper wires through the base hole and glue the body to the base.
Make sure the body does not slope forward!
If the body is leaning forward, the gears will slowly work their way off the driver gears and fall off the clock. Make sure the body is upright or even leaning slightly back.
Step 6: Finishing Touches
I gave the dial gears some paint to make the numbers stand out. Just ordinary acrylic paint works well, and you don't even have to be particularly neat either. Once the paint is dry, sand off any paint that didn't make it into the carved numbers and you'll be left with some neat looking numbers.
I drilled a 10 mm hole in the back of the base to allow the barrel jack adapter to sit.
Lastly, I found some small screws which allowed me to attach the boards to the inside of the base. The photo shows a slightly different wiring configuration which is something I was experimenting with; I would recommend sticking with the original wiring shown in a previous step. I would also recommend doing away with the jumper wires and having a go at soldering the connections as this saves a lot of space. This is something I will be doing next.
Step 7: Closing Remarks
Comments on the Code -
The core of the code was provided by Instructables user curtis63 who posted it as a comment to Mohannad Rawashdeh who made an excellent instructable on the BYJ48 stepper motors.
The code keeps time by splitting an hour into 128 units, then advancing each stepper by an appropriate number of steps, after accounting for the time that motion takes, the code then delays the rest of the 1/128 hour period. If that wasn't complicated enough... Here comes the maths...
How the code keeps time:
The inner gear (minutes gear) has 28 teeth and the outer gear (hour gear) has 52 teeth. Each of the driver gears have 8 teeth, giving gear ratios of 3.5 and 6.5 respectively. This means the inner driver must turn 3.5 times each hour and the outer gear must turn 6.5 times every 12 hours.
We know from the product specs that the BYJ48 steppers have 4096 steps per rotation. So that's
3.5 x 4096 = 14336 steps every hour
6.5 x 4096 = 26624 steps every 12 hours
12 hours is 43,200,000 milliseconds (what the Arduino works in) which when you divide down gives 1344 steps every 337500 milliseconds for the minutes stepper and 208 steps every 337500 milliseconds for the hours stepper. As 1344 steps is almost a quarter of a rotation, and I wanted the movements to be subtle, I divided that down again, this time by 12 to give 112 steps every 28125 milliseconds.
Moving the motors takes time so this is accounted for by putting a known delay in each step. The main loop is a for loop that loops 12 times. Each loop moves the minutes stepper by 112 steps (which takes 112 x 64 milliseconds) then delays by 19917 milliseconds. The code then moves the hours stepper by 208 steps taking 208 x 60 milliseconds. The total number milliseconds is then:
(12 x 112 x 64)+(12 x 19917)+(208 x 60) = 337500
I'll admit it's not an ideal method as it assumes a single step is instantaneous, which it isn't. I'd like to eventually incorporate a real time clock (RTC) into this project to keep accurate time and I'm open to any suggestions for improvement.
Thanks you for reading this instructable :D please leave a comment or suggestion, I'm still working on this project and I'd welcome any ideas, suggestions, recommendations, and potential improvements.
Second Prize in the
2 years ago
Nice clock. Just what I need for my idea. How did you create the inner gear? I have difficulties finding instruction on how to create these in my 3D-Software (Siemen NX). If you have some ideas here, would be cool. Thank you for sharing in any case:)
Reply 1 year ago
I use a program called Gear Template Generator from a gentleman in Canada at woodgears dot ca. Creates several kinds of gears, change the settings how you like. Exports in several vector file formats like SVG and DXF.
I also see there is an online gear generator at geargenerator dot com.
1 year ago
This is why one of my pet peeves is that every Arduino tutorial starts out using delay() for timing.
This would be much more accurate without requiring the use of interrupts by simply starting with the example code for "Blink Without Delay".
Reply 1 year ago
I'm sorry that your pet is peeved, but peeved it will have to remain. I'm not really bothered anymore, about the accuracy of this almost 4 year old hobby project; I've moved on to other things, but I had fun making it and I had fun using delay().
Reply 1 year ago
;') No problem, I didn't mean =your= tutorial for this clock. I meant that most Arduino beginner books, especially the early ones, tend to lean to heavily on delay() for timing.
Yours is not a tutorial on learning to program an Arduino, it is a tutorial on how to build this clock. Then we, including me, can make any improvements we desire, and learn along the way.
No insult to you was intended.
1 year ago
The .svg files seem to be broken can you send me the link again please
4 years ago
I'm definitely making one of these. When I read through this, I knew immediately the changes I would make, then I read that you're open to suggestions...
I would replace the Nano with an ESP8266 (ESP-12E). They cost about $7 each, so slightly more than a Nano, but they have Wifi built-in, so you can have it connect to an NTP server to get the time. I have code for that if you want it, but I think it's in the Arduino IDE samples when you add the ESP8266 libraries.
Then the issue would be getting the clock to know where it's zero point is so it could go to the right time. Magnet and reed switch sounds like the right idea.
Unfortunately, I'll be away from my shop that has my CNC router until July, so I won't be able to build it until then. :-(
This is really nice, and I'm looking forward to making one!
Reply 1 year ago
Can you provide the code please. I know it's late but can ya?
Reply 4 years ago
Cool, I never even thought of an ESP8266 and the price isn't that much more than the Nano+RTC combo. I've just bought some reed switches and tiny magnets to experiment with this idea. My fear is that the reed switches could be triggered in a range of positions so I'll have to find the best TA rating to get the best spacial resolution. I'll post an update after my experiments :D and good luck with your build.
Reply 4 years ago
I have been away from my home and shop almost the entire time since I posted this comment, so I haven't had a chance to put it together yet. :-/ However, I saw this other clock pop up on Instructables, and they are using a reed switch to synchronize the time hourly. It's pretty much identical to how I pictured it working.
Reply 4 years ago
Yeah, I was thinking about the reed switch after I posted, and remembered that it's difficult to control the precise trigger point with those. Ranges typically vary by about an inch, depending on various properties of the magnet and the approach angle, which wouldn't work well for "homing" a clock. I'm going to play around with an optical sensor and a hall-effect sensor. Given the small gap between the base of the clock and the moving parts, I believe that an optical sensor will be the easiest and will provide the highest level of precision.
But then again... Back on the reed switch idea. With some simple tricks in software, the trigger and release positions could be calculated each time the trigger (magnet) passes the switch, and the mid-point should be acceptably close to the middle of the switch. So, the calibration points could be known on each revolution, and a calibration could conceivably take place after each instance in which the trigger has left the area of affect and the reed switch re-opens.
The main advantage of magnetic triggering is that the parts that perform the nerdery can remain hidden. It would be a shame to dork up this design by punching holes through it for sensors. You've done an unusually great job of hiding all of that in your design, so I'd be willing to bet that you're sensitive to that.
Now if only I could be back at my shop.
Reply 4 years ago
I was thinking about the ESP8266 as well and checking with NTP. I am not a programmer, so not sure how the program would flow, but my thoughts were to check the time at a certain interval, then when a minute advances, it will trigger the stepper to move a minute increment, and trigger the hour stepper to move 1/60.
Also would be nice to be able to add a couple manual adjust buttons to use for setting the time.
Reply 4 years ago
Checking with an NTP would be similar to checking a built in RTC, only you wouldn't need the physical space inside the base to house it. Frequent time checks coupled with stepper advancements to correspond with those checks would certainly deliver the correct number of steps at the right rate. However, there is the additional problem of missed steps; if the steppers were to stall for example and only move, say 97 steps instead of the requested 112, the displayed time would slowly drift despite the continuous checking. These are not the highest quality stepper motors after all. A physical mechanism for "homing" would allow the program to make adjustments to make up the lost steps and essentially auto-correct every 12 hours. Also, to set the time, it's easier to just lift the rings off and place them at the correct time ;)
Question 4 years ago
Looking forward to creating this clock. Can you provide dimensions of each piece? Height and width
4 years ago on Step 7
Great clock ! I love it. Really well presented.
Tip 4 years ago
I think with interuptions you can make exact timming for yours movement.
Also, terrific project, congratulations
4 years ago
Very beautiful design and clear explanations. Thanks !
4 years ago
Nice clock :D very ingenious !
4 years ago
Great clock and great instructions! Love it!
Question 4 years ago on Step 5
can a pattern be made from something like plastic and be done with a router?