This is my first Instructable so please ask questions if I there's anything I haven't made clear enough, thanks.
I have a distant childhood memory of an old machine that was in my local amusement arcade, which had these glass tubes with numbers inside to display your score. I think that machine dated from around the 1950s and I wondered if this old technology was still available. I recently searched on google to see if I could find out anything about these tubes and was surprised to discover that there are quite a number of people using Nixie Tubes to build their own projects (mostly clocks or thermometers) and that they are readily available to buy on ebay.
I had some previous experience in using the Arduino Uno board and wondered if there was a nixie tube arduino shield available. There is. I found some on ebay and purchased one which comes with instructions and example arduino code on how to set up a clock using the arduino uno. Following the instructions which came with the shield I was able to set up the clock fairly quickly, but that got me thinking, if the shield could be used on an arduino mega board then surely all the extra output pins could be used to make something more interesting happen at specified times.
Step 1: The Idea
I had seen ordinary clockwork mantle clocks which would chime at quarter past, half past, quarter to and on the hour and wondered if I could dismantle one of these and remove the clockwork parts and then power the mechanism with a couple of stepper motors. After close inspection of the clock internals I realised that much of it could be removed and discarded (some of the cogs etc. could be used in steampunk projects if you like these) and that there are two main things which need to be kept. One side there is a row of gears which operate some cams which lift the hammers to play the various parts of the tune and another part which lifts all the hammers together to strike the number of hours. (I've built two of these now and although the donor mantle clocks I used were manufactured by different companies and had slightly different designs, they both worked in exactly the same way) So, using one stepper motor to operate each part of the mechanism seemed like it would be pretty straightforward.
Step 2: How It Should Look ?
I like the art deco look and for my clocks I used the cabinets of old 1930s radios which i found on ebay. I gave these a light sand and a couple of coats of clear varnish. But this part you can make any way you want to suit your own taste, as long as it can show off the tubes and the chime mechanism you can use any sort of case to hold it all.
Step 3: What Materials Will You Need and How Much Will It Cost?
Arduino Nixie Shield from ebay: around $110 including postage
Arduino Mega 2560: Anywhere from $10 for a copy board up to $45 for an original board
2 stepper motors with driver boards: stepper model 28-BYJ-48 5Volt with ULN 2003 driver boards around $6 for these from ebay.
90 degree header pins: one strip for less than $1
10 K ohm resistor: 5 cents
Clear LEDs: To illuminate the mechanism when it's chiming, around 10 of these will do, less than $1
Dupont Jumper Wires: Various lengths, at least a couple of dozen of these $5 on ebay
Stackable Header Pins: To go between the arduino and the shield so that you have room for your 90 degree header pins.
Stepper motor couplers: To connect the stepper motors to the clock mechanism 5mm x 2mm $3
An old westminster chiming mantle clock: Around $15 - $20
Some sort of cabinet to hold everything:
A 5 volt power supply for the stepper motors: A couple of dollars from ebay or maybe use an old mobile phone charger. DO NOT try and power the steppers directly from the arduino board as they need more current than it can supply.
A power supply for the Arduino: Either 9 or 12 volt. A couple of dollars from ebay.
Various Micro Switches: You'll need 3 buttons for setting the time, and a lever micro switch which will be attached to the clock mechanism
Step 4: Preparing the Chime Mechanism
Dismantle your westminster clock, removing the hands so that you can get the mechanism out of the case. Be VERY CAREFUL when removing the winders / springs as if these are still wound they can jump quite violently when loosened and hurt your fingers. Have a good look inside the mechanism and you'll see that there should be a shaft that comes out the front of the case which operates the cams that play the tune and another shaft which comes out the front which operates the striking mechanism for the hours. You basically need to keep these and the gears they connect to and remove everything else which will no longer be needed. Loosening the nuts / bolts at each corner of the mechanism should give you enough room to remove everything you don't need. Then tighten up the corner again and you should be left with a mechanism with two shafts at the front with you can turn freely to play the chimes and strike the hours. In both of the clocks I have used for this I noticed that they need to turn in different directions, so check this now and make a note of which direction each one has to turn.
Now you need to position your lever microswitch on the clock mechanism, as shown in the photo, so that as the gears for the chimes (not the hours) turn, the switch will close at one point and the open again as it turns. You'll need to drill two small holes about 1.5mm diameter and attach the switch with small machine screws and small washers. The switch will be used to determine the position the chime mechanism is in when the clock is powered up each time but the exact position of the switch is not vital as we will need to compensate for this with adjustments in the arduino code which I'll cover later on.
Step 5: Header Pins and Arduino
Sort out your 90 degree header pins and see where you're going to attach them to your arduino mega. I used pin 23 for the micro switch we attached in the last step, pin 27 for the white LEDs which light up the mechanism while it's chiming, pins 31,33,35,37 for stepper motor one and pins 39,41,43,45 for stepper motor two. You'll also need header pins attached to the ground and +5V. Solder a jumper wire onto each of these.
The picture with the white outlines show a red and a grey wire. The red one comes from the +5V of the arduino, through the back of the clock to one side of the micro switch we fitted to the mechanism earlier. The grey wire comes from pin 23 of the arduino and connects to the other side of the micro switch and also goes through the 10 K resistor to ground.
The picture showing the small green board with the red and black wires is the 5V supply for the two stepper motors and is the ground for everything.
Step 6: Attach the Arduino to the Nixie Board
Attach the arduino to the nixie tube board with the stackable header pins as shown in the picture. Make sure you connect all the pins including the group of 4 which connect to the long strip of sockets on the arduino.
Step 7: Software for the Arduino
The software that comes with the nixie tube board can be found on github here:
You will also need the 'CheapStepper' library found on github here:
Attached here is my modified Arduino Sketch which includes the code to operate the stepper motors.
You will also need to replace two files in the CheapStepper libraries as the originals limited the number of steps that each stepper motor could make and prevented the hours from striking the full amount. I have attached the two modified files 'CheapStepper.cpp' and 'CheapStepper.h' here also
Step 8: Testing the Motor Direction
If we now connect up both the stepper motors using the driver boards and arduino output pins we can check that they turn in the correct direction that we need them to turn to operate our chime mechanism. When powered up, stepper one should turn constantly. It will stop when the micro switch we fitted earlier is tripped, but since we have not mounted the motor yet you will need to trip this manually. Once tripped, the board should run a self test and the tubes should power up. From here you can set the time via the built in switches on the nixie tube board and wait until the steppers operate at each 15 minute interval for stepper one and on the hour for stepper motor two. Once you are happy that the motors are turning in the correct direction for your chime mechanism then we can mount the motors to the back of the mechanism and connect them with the couplers.
Step 9: Adjusting the Arduino Code for Your Clock
As I mentioned earlier, the switch we attached to the front of the mechanism will be triggered at a different position in relation to the chiming cam for everyone who builds one of these. To compensate for this you will need to edit four lines in the attached 'NixieClockWithChimes.ino' sketch.
Lines 204, 205, 206, 207 will need to be altered.
In line 207 the value of 39 will have to be adjusted (pretty much by trial and error) until your chiming mechanism turns to the correct position when the clock is powered up.
In line 204 the value of 75 will have to be changed to (36 + your new value from line 207)
In line 205 the value of 147 will have to be changed to (108 + your new value from line 207)
In line 206 the value of 255 will have to be changed to (216 + your new value from line 207)
Once you have this set your clock mechanism should turn to the correct position ready to play regardless of what time it is when the clock is powered up.
Step 10: Almost There (I Hope)
From here you can decide where you will mount this set up inside your cabinet. You can arrange your clear LEDs, wired in parallel so that they will illuminate your mechanism. Connect these to the ground and to pin 27 of your arduino.
The nixie tube board comes with some connectors for external switches to be added for 'Mode', 'Up' and 'Down'. You can connect your push button switches to these, mounted in a suitable place on your cabinet so that you can adjust the time and LED colour.
If anything isn't clear or if I've missed something please get in touch and I'll try to help if I can.
Thanks for looking and good luck if you give it a try!!!