Here’s my Nixie Clock I designed when I was still in school. Actually, the majority of this design occurred when I was on a coop at a company at RIT. I had little real work to do, so designing this passed the time. I’ll post more details on this later, but this is the finished project:
More pics of what it took to get to this state are here: Nixie Clock Gallery
The heart of the clock is a Xilinx XC95144 PLD. There isn’t a single line of software code that runs this clock. Instead, it runs purely in gateware, which was described using VHDL. I really liked VHDL in college and still do, but I don’t get a chance to use VHDL much at work =(. Anyways, I used the PLD because FPGAs were too expensive at the time, and I wanted a purely hardware based design. An FPGA sorta is purely hardware, but it implements the VHDL hardware description using look up tables (LUTs) in a big block of SRAM whereas the PLD has actual logic gates in it.
The following is a very early prototype of the clock:
The power supply for the clock is a bit clunky, but it works as I couldn’t design a switching power supply to save my life at that point in time. Instead, I was able to find some cheap transformers that had dual 120V primaries and dual 12V secondaries. Since the nixie tubes need ~170V to illuminate the element inside them, I put one transformer’s primaries in parallel to run off 120V and then hooked the 12V secondary to the secondary of the 2nd transformer and wired the second transformer’s primaries in series, giving me ~240VAC with a 12VAC tap for the clock’s logic. Once rectified, I had pretty high DC voltage and once I figured out how much current a single tube would consume when it was on (the tubes are on a multiplexed bus, meaning only a single tube is on at a time), I used a resistor to drop the voltage to the Nixie’s correct working voltage. This ends up working just fine, but it’s not terribly efficient.
If I were to redo one part of the clock, it would be the power supply. I can build switching power supplies easily now, and making a 120V to 170V boost converter wouldn’t be tough at all. Or maybe I’d use a 12V or so to 170V boost… Some sort of transformer needs to be present to isolate the clock’s electronics from very high current line voltage. It’s more of a safety issue than anything, as I found out the hard way =). My first design to create 170VDC from 120VAC utilized diodes to form a voltage doubler. Somehow something go shorted to ground, lights dimmed, flames ensued, and in a flash a chip disintegrated off a circuit board. Only the legs were left (this was a through-hole DIP part). The body was completely gone. I tried again using the same circuit but being more careful, but I quickly learned that 1/4W resistors and high voltage don’t mix. It doesn’t take much current through them at 200+ volts to instantly make them burst into flames. While exciting to watch electronic morph into pieces of garbage, a non-isolated design is dangerous. I have not had any of these problems since using the transformers to boost voltage, and the finished clocks (two of them now) have been running day and night for about 6 years now.
For the tubes themselves, there’s not enough pins on the PLD I used to drive each one discretely. It probably would have taken up a lot more logic to drive them that way anyways. To solve this, each of the six tubes is on a common bus. To light up an element in the tube, a tube has to be enabled, and then the element is selected. Opto-isolators are used to interface the PLD almost directly with the tubes. The little decimal point dots in the bottoms of the tubes are just the binary representation of a counter inside the PLD.
The only major problem that had to be overcome was element ghosting between tubes since they’re on a multiplexed bus. Discretely driven tubes do not have this problem. I don’t remember exactly what the problem is, but I believe it’s similar in nature to what happens when you energize an inductor (or relay coil, electromagnet….etc), and remove power from it. The magnetic field collapses and sends a surge of power, called back EMF, into whatever was supplying the power. With the tubes the effect isn’t quite as drastic, but it is similar in the sense that when voltage is removed from an element, the charge doesn’t disappear instantly. It needs to be bled off or else when the next tube is enabled, the charge from another tube’s element dimly lights up the same element in the next tube. There is probably a more efficient way of fixing this now that I know more about electronics, but at the time, it was easily solved in exactly the same manner as you kill back EMF for relays, coils, …etc: a reverse-biased diode. When you’re driving the tube, the diode doesn’t conduct, but once the driver is turning off and the tube element voltage minus the driving voltage is greater than the diode’s forward voltage, the reverse-biased diode becomes forward-biased and bleeds off the charge to ground. Unfortunately this means that you need a lot of diodes to prevent ghosting. In my case, I needed 12 diodes per tube (digits 0-9 and two decimal dots) for a total of 72 diodes per clock…maybe less as the first tube would only be lighting digits 0-2. I don’t remember if I took that into account or not. I may have been planning to do fancy animations, which would make use of all elements in all the tubes.
Anyways, the timebase of this clock is a Maxim DS32KHZ TCXO (temperature controlled, crystal oscillator). This oscillator runs at 32.768KHz and that drives everything the PLD is doing inside from refreshing the tubes to actually keeping track of seconds. I’m not syncing this to the 60Hz line voltage or grabbing time sync stuff over the air or from the internet. This part is quite accurate, and it only deviates +/- 10 or so seconds a year (calculated based on measuring the time difference after a month). This is by far the most accurate, free-running clock in the house.