This project is a PIC based Nixie Tube clock. I built this project to give me some more experience with hardware design and debugging. I wanted to try implementing a switching power supply, so I used two in this build. One for the high voltage (~170VDC) used to drive the neon filled Nixie Tubes, and another to supply 5V for the rest of the components on the board. At a high level, I have a PIC18F2550 running the show. The main communication bus on the board is I2C. I am using a battery backed DS1307 for the real time clock. I use 2x MCP23017 IO Expanders to run the Nixie Drivers( Russian K155ID1, equivalent to a 74141). The PIC will also host a USB HID device used to communicate with the computer and receive time / other settings (see bellow).
I breadboarded all major components before spinning the PCB... which was a good step for me as the 170V supply did not function correctly for the first power up. When I first ordered parts I was not paying attention to some critical parameters that make the supply efficient. One of the parameters is the ON resistance of the N-Channel FET (Rds), the original attempt had a 1ohm resistance causing a lot of loss and heating the FET when switching current through the inductor. As a result I reevaluated all of the components in the circuit and selected more efficient ones. (Low Rds FET, Fast Recovery Diode, Excessively high rated inductor).
PIC Firmware: I wanted to add some advanced features to the clock and needed a way to set them. Since I already had USB support working on a previous project I decided to use the same microcontroller (PIC18F2550) as the platform for this project. This imposed some limitations as well. I knew I wanted to add RGB LEDs to the project and be able to adjust the brightness of each color via PWM. Unfortunately the PIC I chose only has two hardware based PWM modules, and I used one is used to drive the IN-13 nixie bar-graph. Since I am using a high clock frequency (Fosc = 48MHz) I used a timer module and created my own software PWM routine and called it from the ISR. To set the brightness of a individual color, set the color brights limit from 0 to 255. The ISR will call the below function fast enough that the LEDs will dim without flickering.
static unsigned char Tim0Ctr = 0;
// Timer will increment from 0 -> 255 then roll over.
// | Software PWM. Counter will run from 0 to 255. Set |
// | the color limits within the same range where |
// | 0 = off, 255 = Always On. |
// Red LED control
if (Tim0Ctr < RedLim)
// Green LED control
if (Tim0Ctr < GreenLim)
// Blue LED control
if (Tim0Ctr < BlueLim)
Once I was happy with how everything was functioning I designed the full Schematic / PCB. It is a two layer board measuring 9.5"x4.3". In the lower right hand side is where both power supplies live. I went a bit overboard with the traces because I wanted to make sure there would be no issue carrying enough current to the supplies. I also experimented with a ground plane pour on the far left of the board, to try to shield the RTC crystal. In the very center of the board is a coin-cell battery holder. This will keep the RTC running and keep accurate time if power is lost or the microcontroller is reset.
Build Pictures: (Click to enlarge)
I populated the PCB going from the shortest component (resistors / sockets) and moving to larger ones to make my job easier so that the PCB would lay flat and hold the parts in place while I soldered them. The nixie sockets were the most time consuming part of the build. I hot-glued a 5mm RGB LED in the middle of the socket and then soldered a ribbon cable to all of the pins. This is what gives the tubes the back-lighted effect seen below.
The project really looks good in a dark room. The glowing tubes contrast nicely with green/blue light given off by the LEDs. You can also see the extra LEDs I placed around the perimeter of the PCB making the whole board glow.
Color Fade Speed: Adjust how fast the board LEDs will fade from red -> green -> blue.
Colon Indicator: Adjust if the colons are always on, always off, or blink at 1Hz.
Sleep Times: Since this clock is pretty bright, I wanted a way to turn it off when I'm trying to sleep. If this feature is enabled, when the time is between sleep start / sleep end the high voltage power supply is shut down, turning off all nixie tubes. (Also saves on nixie tube bulb life) The leds will fade dim green -> off to indicate sleep mode is active.
12/24 Hour Display Mode
Automatic Daylight Saving Time adjustment code. (United States based, second Sunday of March / first Sunday of November)