Introduction: Ticking Gear Clock
Sup.
This is a build describing a gear clock with independent hour, minute, and second drives, that all tick - so reading the clock is as simple as looking at the number closest to the top. Simplified, for younger makers :-) I also needed a 24 hour clock, so that I could attach notes to it - such as sleep time, wakeup time, lunch time. I found that both ticking and 24houred-ness are rare, so ended up building my own clock.
The clock utilizes an Adafruit Feather board, a real-time-clock shield and stepper motors; we're driving one stepper for hour, minute and second, entirely independently. This means that, other than the hour alignment, setting the clock is as simple as adjusting the gear wheel.
I like the feather because it's easy to power, and easy to add backup power - literally just plug in a lipo battery. The stepper motors (major power draws) are powered externally, so the clock should maintain backup time for quite a while; however you will need to adjust the clock face wheels to the right time, since the steppers don't move while the clock is on battery.
Step 1: Acquire Parts
The first step is to order, print and cut the parts!
Source
All the parts for the clock can be found in my github: gearclock
Tools
To build the clock I used a 3D printer, a laser cutter, a soldering iron, some hex keys and a hot glue gun.
Parts to Purchase
- Adafruit Feather M0 - with CircuitPython - $19.95
- Feather Header Set - $1.50
- Feather Stacking Headers - $1.25
- Real Time Clock Feather Wing - $13.95
- 9 volt power supply - $8.80
- Step down 3.3v Power Regulator - $9.88 for 5
- 5 stepper motors with drivers & wire - $12.69
- 6 * 20mm M3 button-head screws
- 6 * M3 nuts
- 2 small wire nuts
- Hot Glue
- Battery backup - CR1220 battery - $.95
I used the gear steppers because they can easily handle the torque, and they're quite inexpensive given that their 'driver' is included.
Parts to 3D Print
- Base Mount: gearclock.stl
- Second Sun: second_sun
- Minute Sun: minute_sun
- Hour Sun: hour_sun
- Optional Bezel:
The stepper motors tend to get warm, so for best longevity I 3D print the gears in anything higher temp than PLA - PETG, ABS or nylon are all good choices. I also made a more interesting gear for the hour and minute; these utilize other folks' models to make the gear more visually interesting.
Parts to Lasercut
The lasercut parts are all embedded - you want to make the gears out of 6mm or 1/4" MDF, plywood or acrylic sheet; the gears get cut out, but the letters are merely engraved on the surface.
The sun gears have a retaining flange on the inside teeth; it doesn't look like it, but the lasercut ring gears won't fall off as long as a tooth is engaged.
The hour ring has room for signatures, sticky notes or decoration; for the test clock it has signatures from the Capitol Hill Maker Faire. I plan to decorate my daughter's clock with night time, day time, etc.
Step 2: Assembly
To assemble the clock, we'll need some 20 or 25mm M3 screws and nuts - 6 of them - to mount the stepper motors into the frame.
Once the steppers are mounted, hot glue the stepper drivers in place - there are slots for each one on the back of the main mount. Note that the LEDs are aligned vertically!
There's a jumper on the stepper driver - this connects the LEDs to power. I think it looks cool when they flash as the gears move, but if you don't want lights in your clock you can remove the jumper and they won't light up.
Step 3: Wiring - Feather
Next step is to solder the headers onto the Feather and the RTC module.
The feather uses the short pins, while the RTC gets the stacking headers - since it'll be stacked on top.
Using the headers simplifies the wiring and lets you alter it later; however feel free to solder in directly. The RTC module has two rows of pins, so it's relatively easy to solder to directly even if using headers. Direct soldering will also let you make the electronics much shorter - but, well, having it stick out doesn't hurt, since the clock gear is huge.
The feather is powered by our 3.3v regulator - I just plugged OUT on the regulator to 3V on the feather, and Ground to Ground on both. This requires some lead bending, since the feather's ARf pin is in the way. Bend the IN pin of the regulator out - this is 9V in from your power brick.
Once the feather is soldered and attached to the RTC, hot glue it onto the mount - there's an indentation for it on the right side.
Step 4: Wiring - Power
Everything needs power!
The stepper boards are powered from the 9V power supply, as is the 3V regulator that's attached to your feather.
The stepper motors come with a bunch of male-female leads - these I used for all the wiring. If you need more, Adafruit sells them quite cheaply:
3" male female jumper leads
You can peel off as many as you need at a time; to make a 2-pin connector, I hold two of the female ends together with a dab of super glue - add as many as you like.
I made three 2-pin leads, one for each stepper, and for the feather you need one female and one male lead.
For the two pin, plug each into a stepper driver - cut off the other ends and strip down to bare wire. These will be gathered into the wire nuts, along with the feather leads and power in.
The feather leads, female feeds power into the regulator, and male is connected to the end ground pin, down past the TX pin.
Before gathering all the positive and negative leads, hot glue the 9V power supply wire in place - there's a half-circle entry at the bottom of the mount for it. You'll need to cut the end off and strip the leads, as well.
There's a fair amount of wiring in this build, but plenty of space to hide it - just be sure all wires are in, or exiting the back of the mount - there's cutouts around the electronics bay for the wires.
Step 5: Wiring - Steppers! Finally!
The stepper drivers aren't really drivers - they're just transistors, able to turn on a stepper coil. There are four coils in these steppers, since they're monopolar - turning on the coils in sequence causes the motor to move one step.
To make life super simple, and since we have pins, I used the feather to directly control each coil - which means each stepper driver needs four microcontroller pins to operate.
The Seconds stepper uses pins D10, D11, D12, and D13 - if you wire it backwards, the stepper will spin in reverse - if you wire it out of order, the stepper will vibrate angrily and not move much at all. In all of these, the lowest stepper pin goes to the lowest driver pin- so D10 goes to IN1 on the driver board.
The Minutes stepper uses A0, A1, A2, and A3.
The Hour stepper uses A4, A5, SCK, and MOSI.
The RTC module (doesn't need to be wired, it's plugged in) uses, for reference, the SCL and SDA I2C lines - so you can't use those :-)
So... once it's all wired up, load the firmware and test it out!
Step 6: Load the Firmware
Adafruit has amazing tutorials - for everything you ever want to know about the feather, check here: Adafruit Feather M0 - with CircuitPython
Mine came with CircuitPython pre-flashed, so the only thing I had to do was drop my code in - replacing the existing main.py.
I actually wrote my own stepper library (it's super simple) in there, but the gist is keep checking the time - when the second changes, move the stepper... and the same for the minute and hour. The clock always moves the hour first, then minute then second.
Because the clock ticks (i.e. the hour moves once every hour) you'll need to set the correct time before uploading - after that, with the battery attached it'll never need to know it again, and can stand being moved about for a while.
By default, the time is 5:58:55 - but with the gear clock, the only thing that matters is that you start it one minute and 5 seconds before the next hour; you can just move the display gear ring to correct anything else.
Step 7: Enjoy the Clock!
Add a bezel and hang the clock!