Home | Giveaways | Rules and About
last modified: Monday 5 December 2016
author: Hales
markup: textile

Project: Wooden synchronous clock

This clock took many months to complete. So much for a weekend project!

The wooden gears are driven by a stepper motor. This stepper is controlled by a circuit that counts the 50Hz waveform of mains to keep time.

Whilst mains frequency changes about quite a lot during the day, over the long term power companies ensure that any lost or gained cycles are counteracted. Many digital clocks (including alarm clocks, oven clocks and microwave clocks) count mains to tell the time.

Once upon a time synchronous motors were popular to run clocks. You may still encounter some today. Listen for gentle motor and gearset whirring near power boards, pool control systems, hot water heaters and wall clocks that plug directly into mains.

Gears

Inkscape has a built-in gear generator. Although involute gears would be better, I can't cut accurately enough for it to matter.

I print and then stick the gear designs onto plywood. This is an easy and accurate way to get things done:

Printers are an amazing tool for making stencils like this. I do this for aluminium parts too. Most printers have a small scale error that you can adjust/counteract if necessary, but either way they have a ridiculously high relative accuracy and paper is cheap.

You can also see that I've drilled holes in the valleys between teeth. After this I band-saw the rest of the shape out. These holes provide convenient and neat end points for the cuts. I stole this idea from a clever person somewhere on the web.

The gears do need a little work to mesh together properly and have quite a lot of backlash. I spend some time sanding the teeth to a better shape after using the band saw. They end up looking pretty nice:

The roman-numeral clockface was applied using the same toner transfer technique I use to make PCBs. It took me a few tries, the first few of which only partially transferred so I sanded them off to start again. I found that layering multiple transfers on top of each other worked the best.

Electronics

Rightmost board: power supply. Takes in ~9VAC from an external plugpack and spits out 5VDC. Nothing fancy. These used to be popular more than a decade back: WES Wagner sells them if you are in Sydney.

Middle board: samples the AC and converts it into square 50Hz pulses using a comparator. Then counts those pulses using decade counters. The LED pulses once every 9 seconds, indicating the motor should take one more step.

Left board: drives motor with a dual H-bridge (four half bridges) and keeps track of the stepper motor state using a decade counter. LEDs represent the motor state.

The 'squaring up' circuit has a little tomfoolery in it, mixing in signals from various sources through the four resistors. I used the philosophy of 'try some values and see what happens' to design this.

First of all: we don't want voltages above 5V entering the comparator, as that is what the comparator is powered with. So I used a voltage divider to cut the 9VAC down a bit.

Second of all we don't want negative voltages touching the comparator. Although the waveform we should be getting is half-wave rectified, it still drops around 0.7V below zero. So I used another resistor to pull it up toward 5V by a little.

The comparator suffered instability when it hit the crossing point of the 50Hz signal. This appears a lot like switch bounce in the output wave. It was particularly hard to spot because the output looked like a perfect square wave on a scope screen -- until you zoomed in very heavily to see the spurious pulses. To fix this I put a resistor from the output of the comparator to the input, adding in a bit of positive feedback (aka hysteresis).

The shape of the waveform made by this mixture of voltages is quite interesting and I have a little picture of it drawn on the schematic. The threshold level for the comparator is adjustable, and as you adjust this you can see the vertical 'slip' lines (where the circuit switches from high to low or visa versa) lines move up and down in the waveform. The bottom end of the waveform has some interesting distortions too -- it has three distinct steps in its shape, rather than just a small curve.

It's also worth mentioning that many comparators have an open collector output. Equivalent circuits in datasheets help allude to this. The solution is to use a pull up resistor on the output pin (pin 7 in the diagram above).

Mistakes

The gears shown in the photos above are completely wrong. They give an irrational ratio. Please don't ask. In the end I had to remake the smaller gear with a different number of teeth and modify the counting circuity to counteract it. You can't just modify the counting circuitry to counteract irrational ratios, unless you're happy to gain/lose time each day.

During these changes I fitted a 'rotating mount' for the stepper motor (not pictured) which made depthing the gears easier. It was basically a couple of strips of aluminium that acted as a pair of arms.

If you depth the gears too close to each other then the clock would silently lose time over the day. Occasionally a step would fail (not enough torque) and you wouldn't notice. I wanted to run the stepper motor off the rectified 9VAC, but even with lots of capacitance the motor noticeably vibrated with the ripple current, so I opted to use the regulated 5VDC instead.

Oh and there are probably errors in my schematic! Make sure to poke me if you encounter them or are suspicious.


Steve T - Monday 6 March 2017

Nice. I'm working on similar clock using plywood gears. What stepper motor did you use? I am concerned that a small stepper like a 28BYJ-48 will not have enough torque.

Hales - website - Monday 6 March 2017

The stepper motor I used was one I simply had to hand. It's the size normally used in small 3D printers. NEMA17

You can really get away with a smaller stepper in a situation like this. The way the clock ends up being geared means that you are driving each successive gear with more torque and less speed. Provided you pay attention to detail in the first couple of gears, the rest should be easier.

In the end my torque was limited by the current I was happy to deliver to the motor. Unfortunately mine was a low coil resistance motor, and I was just using a normal H-bridge to drive it, so my motor stayed cold and my H-bridge stayed hot. In the end chose to supply the driver with a low (5V) supply to keep it cool, which in turn meant my motor supplied very little torque.

All in all: if I replaced my stepper with a smaller one, I would have gotten the same (or possibly even better) torque because it would probably have had a higher impedance. The way I'm driving it at the moment means the stepper stays bone cold and you can easily turn (some of) the gears by hand.

Your 28BYJ-48 looks like it already geared down and has a better impedance than my motor did, so I suspect you will be fine. If you don't already have a motor, then consider getting a small synchronous one like microwaves use to spin their turntable. This avoids you having to do _any_ of my circuitry: instead you just need to wire the synch motor directly to mains.

I hope you enjoy making your project :)

Steve T - Thursday 9 March 2017

Thanks! My gearing and drive will be different, but the appearance will be similar with numbers on wooden gears to display the time. This is my first project using wooden gears and steppers, so that's an area I'm worried about and probably cant solve until I get parts in hand and try it. Once again, thanks for your info and all the projects on your site.

Hales - website - Friday 10 March 2017

> an area I'm worried about and probably cant solve until I get parts in hand and try it

Indeed, the best thing to do is try it. My circuit diagram was actual a reverse engineering of the setup I managed to get working on a breadboard. Prototyping (instead of soldering) until you are committed to a fully working design is useful to avoid getting stuck in a world of rework.

I enjoy sharing my projects, I'm glad you like them :) And remember that for every project you finish there are ten halfling projects that eat your soul away from the shadows.


Add your own comment:

Name:
Email (optional):
URL (optional):
Enter the word 'irrlicht' (antispam):
Do not enter anything into this box (antispam)

Comment (plaintext only):

If you provide an email address: it won't be made public. I'll only use it to contact you regarding your comment. No spam, mailing lists, etc.

If you provide a URL then your username will hyperlink to it.