Playing with nixies: Yet another Nixie Clock

I stared this project almost two years ago but never got the patience to write it down, despite Mario asking for it a zillion times. I’ve decided to upgrade the first version, so I though it would be a great idea to go through the first design to remember what I did then. So let’s see how my memory works…

IMG_0052

First time I saw a Nixie tube I was captivated by the glow coming out of its segments and right away I decided to build something with some of them. There are several kinds of Nixies, most of them displaying digits, so I had to come with a project a bit more ambitious than the standard “Hello World!”.  A clock! that would do it. Simple but with enough elements to have fun for a bit of time. Also, Christmas were close so I thought it would make a hell of a present.

There are multiple kinds of Nixies with different sizes, with numerals, letters or symbols. Here there is a big list with most of them including datasheets. All of them work under the same principle called Glow Discharge. Basically, they are tubes filled with low-pressure gas and two (or more) metal electrodes. When a voltage is applied to two of this electrodes, and such voltage exceeds a certain value called the striking voltage, the gas in the tube ionizes, becoming a plasma, and begins conducting electricity, causing it to glow with a colored light (depending on the gas filling the tube, for tubes with neon this color is red-orange). The Nixie glass tube contains a wire-mesh anode and multiple cathodes, shaped like numerals or other symbols. Applying power to one cathode surrounds it with an orange glow discharge.

IN-12 Nixie tubes

IN-12 Nixie tubes

For this project I chose the IN-12 Nixie tube, which is fairly cheap (~15€ a pack of 6) and easy to find online (ebay). There are two variants, IN-12A and IN-12B, both with ten digits and a decimal point for the later. When I got them the cheapest I could find were the IN-12B, although I won’t be using the decimal point for the clock. Its striking voltage is around 170V, with a voltage drop across it in the range from 130V to 150V. The specs indicate that the tube current should be in the range from 2mA to 3.5mA, which could be achieved with an anode resistor in the range from 15k to 30k (the math is simple R_a = V / I, where V=Vin-Vdrop). Also, I got a couple of INS-1 neon lamps for the two dots in between the hours and minutes digits. This lamps have a striking voltage around 65V and the indicated current is 0.5mA.

Common circuits to drive a Nixie tubes could be found here. Basically a BJT transistor capable of sustaining voltages around 200V would do the job (e.g. MPSA42/92). The problem comes from the fact that we want to drive 10 lines per tube and a minimum of 4 tubes (HH:MM). Although there are MCUs with that amount of ports available an easier solutions (in terms of hardware) is to connect all cathodes in parallel and to do multiplexing on the anodes. This way we go from 40 control lines to just 14 (10 cathodes+4 anodes). There is also a bunch of devices capable of driving Nixie tubes like the vintage IC 71414 or the modern Supertex HV5812, which also includes a shift register to make driving tubes even easier. For this project I have chosen the Supertex HV5812 in the configuration described here. Although the circuit works perfectly I should note that if we want some sort of dimming through PWM, this approach requires us to implement some PWM mechanisms over the shift register, which in theory is possible (an example) but that so far I have not success at yet.

To drive the Nixies, apart from the driver circuitry, we need a high voltage power supply able to produce 180V at between 10mA and 50mA. I guess there is no need to say that this could be dangerous, but just in case: you should be extremely careful when handling high voltages!!. There are several solutions such as feeding the circuit directly from the mains (which scares me a lot!) or using some DC-DC converter such as boost/flyback converter. Given that I’m a complete newbie at electronics I decided to by an already made DC-DC converter to start, although I’m looking forward to work out this nice tutorial on the matter to understand better how they work. I got this one at ebay: Nixie tubes / Magic eye tubes high voltage power supply module kit DIY which do the work perfectly.

For the clock logic I’m using an Arduino Nano plus an DS1307 RTC module  with a cell battery that keeps the time event when the main power is disconnected. The code is straightforward and it can be found here (sketchbook/NixieClock folder). The TimedAction library adds a very simple scheduling mechanism for the main two tasks: The display task and the serial comms task. The former updates the Nixies according to the current time and the later handles a very simple protocol through the serial port to set the time using a simple app written in Processing (sketchbook/NixieTimeSync folder). In addition to the tasks running in the main loop, there is a timer1 is set in CTC mode and it generates an interrupt at 500Hz to run the digits multiplexing. Given that the display has four digits, their update rate is 125Hz, which is more than enough to run the nixies without any flickering.

After everything was working on the protoboard I decided to put all together on a PCB. It was my first time using a tool like Eagle by Cadsoft, needless to say it was a hard trip… But after reading/watching several tutorials I was able to draw the schematic, and short after that lay everything on a two layers PCB (schematic and  board files are also hosted at github, check hardware folder). To keep things easy I put the arduino nano, the RTC and the power supply as if they were discrete components. At that time I wasn’t confident enough to put all that circuitry together at once. The drawback is that the board came a bit bigger that I was expecting, but after all this was just a prototype. To produce the PCB I used the  Seeedstudio Fusion PCB service. I was very pleased by the result: 6 8×10 (mm) boards for around 20$ including shipping. They arrived in 3 weeks. After putting all together the result was like that:

IMG_0071 IMG_0073

Everything worked as expected, although I realized about a couple of mistakes. First the Nixie footprint I used lacked the hole in the middle for the little protuberance at the bottom of the IN-12s. I had to drill those myself. Also, the footprints were a little too close to each other, but luckily for me they fitted perfectly. On the electronic side, I realized that the power connector had the polarity inverted (negative inside, positive outside) in relation to standard power supply connectors (positive inside, positive outside), so I had to modify the adapter I bought for the clock. I also realized that the arduino voltage regulator can work backwards as shown here (method #8) when only USB power is applied, which happens if I have the board connected to the computer to program the micro. 5V appear at Vin and that is enough to run the DC-DC converter. Although the load is very small, this could lead to a failure at the voltage regulator. I’ll fix that for the next revision. And last, the neon lamps have a weird flickering after a while on, I couldn’t figure out what was the problem. I read some forums with similar problems, but so far I didn’t find an answer to the problem.

Anyway, despite some minor problems, the final thing working is awesome!

Advertisements

3 thoughts on “Playing with nixies: Yet another Nixie Clock

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s