The design blurb, part 1

A project log for The "thIN-18" nixie tube clock

Simple and small 4-digit IN-18 clock.

Gary MarshGary Marsh 02/15/2016 at 01:040 Comments

Here's a bunch of design notes on the thIN-18 clock. This covers the electrical design, I'll make another post describing the mechanicals and the software.


I'm running the clock with an Atmel SAMD20, ARM Cortex-M0+ controller. I used this exact chip to run a lighting system for a Burning Man art car last year, and was very happy with the chip for that role, and thanks to that project I've got a bunch of software written already for SERCOMs/TCs/etc. Plus the chip is fairly cheap (cheaper than an Atmel AVR with the same pin count, even), and I like the Atmel Studio tools, so why not?

For in-circuit programming and debugging of the ARM, I'm using a Segger J-Link EDU debugger. I highly recommend buying genuine tools, for the simple reason that they work when you need them to and you can get help when they don't. The EDU costs $60, and its only limitations are some "you can't use this for profit" legalese and a nag screen that it displays every now and then when you fire up the thing.

I've also got a FTDI FT230XS USB-to-UART bridge on the card, which I use to provide a simple text menu for messing around with the internals of the clock and code testing. The FT230XS comes in a small TSSOP, has a built-in oscillator, and you can configure its spare pins to do cool things like report that you're plugged into a dedicated charging port.


I'm keeping track of time using an Intersil ISL12022 RTC, which connects to the ARM via I2C.

This RTC is a bit spendy, but it has a bunch of features I like. It does temperature sensing/compensation, which makes it +-1ppm accurate over a wide temperature range. It does frequency control by changing the crystal load capacitance instead of adding/dropping 32K clocks, which helps with on-the-fly calibration. There is a ISL12022M part available which integrates the crystal already, however the wide SOIC package was too tall/wide to fit mechanically so I went with the separate-crystal part instead.

To back up the RTC I'm using a BR1220 lithium cell, held in place with a Keystone coin cell clip. This cell has a 35mAh capacity, which at the 1uA typical discharge current of the RTC can keep the time backed up for 35,000 hours or about 4 years with the clock unplugged. Or about 40 years with it plugged in. It'll do.

I originally stuffed an A5100 GPS receiver module and a MMCX antenna connector in the location where the backup battery currently sits, and had plans of the hour/minute buttons being time zone adjustment buttons and the clock being self-setting. But an external wired antenna is annoying and would have to be located near a window, so I decided to just yank the GPS and go to the "battery and decent RTC" solution instead. There's 31.6e6 seconds in a year, assuming I can maintain +-1ppm accuracy on the clock crystal that's +-31.6 seconds of error in a year; and since I'm setting the clock twice a year anyway for daylight savings, and the clock doesn't display seconds the error is worst case about 1/4 of a minute. That'll do.

Calibration of the RTC is straightforward to do - apply an external 10MHz, CMOS level signal to the CAL input. This clocks one of the TC modules in the SAMD20, which is set up to capture on 1PPS edges coming out of the RTC chip. By capturing successive timer edges and subtracting, you can quickly figure out the frequency error and trim it accordingly - eg. if you get exactly 10M clocks, your error is 0ppm, if you get 10,000,005 clocks, the 32KHz oscillator is running half a ppm slow.

Power supply

I decided to use micro USB for the power supply input - the connector is low profile which suits what I'm trying to do here, and MicroUSB phone chargers are very easy to find.

Nixie tubes require ~180V to light up, so I have to make 180V from 5V. This is pushing things for a conventional boost converter design, requiring either a very high duty cycle. So I went with a combination flyback/boost converter architecture which runs at a much lower duty cycle - I'm using a MCP1661 monolithic boost converter chip from Microchip, and a Coilcraft CJ5143 transformer which was originally intended for photoflash capacitor charging.

The combination boost/flyback architecture is used because it nicely handles the leakage inductance of the transformer. I really wanted to design a resonant converter, but couldn't come up with a design I was happy with.

5V to 3.3V conversion for the digital bits is done with a MCP1703 LDO regulator.

Nixie tube drive

The 4 nixie tubes are multiplexed at a 256Hz rate, so the display is fully refreshed at a 64Hz rate. Ten MMBTA42 NPN transistors are used to turn on the anodes (individual digits in each tube), which are connected together for every tube. To turn on cathodes, four more MMBTA42 transistors can turn on MMBTA92 transistors, which turn on the individual tubes through anode resistors. To prevent ghosting during multiplexing, the cathodes are diode clamped to a 75V rail created from 180V with a biased zener diode.