This project is submitted for

Description

recycling a broken old mechanical clock by adding some Nixie tubes

Details

I have already too many project, so let's start another one. I bought a broken mechanical clock and then looked for some Nixie tubes. There are nice ones at eBay. One of the best looking Nixie tube is the Z568M. Usually they cost more than $200 on eBay, and they get sold for this price. Nothing wrong with it and the production quality is high, so it will probably last many years. But there is a new manufacturer, who creates a new version of this tube, see http://www.daliborfarny.com , each one hand-made, and with 10 years warranty.

I bought some, and they are gorgeous. This is the packet packet when it arrived :

Bottom side:

and a quick test, it looks so beautiful!

Now I'll design the circuit board for it.

Surprise: I just opened the clock and it comes with a built-in audio device :) This brings back memories, I remember the sound, my grandparents had such a clock (I think each full hour or at 12 o'clock: dong - dong - dong...). Will add some solenoids.

The path for the default 3D packages like for the pin headers and the capacitor was wrong, and for the crystal and the QFN IC I drew a package with ViaCAD Pro. Was easy to integrate in KiCad exported as VRL:

I plan to use an ESP8266 inside the clock, but a good clock needs to have a standalone realtime clock, if the internet is not available. So I created a breakout board for the AB1815 RTC clock chip to test it. Later I could even mount this on a vero board inside the clock.

I like the 3D view of KiCad:

This is my first KiCad board, until now I used Eagle for the last 20 years, but KiCad looks nice and modern, if you've mastered the quirks every program has.

I compiled it from source, latest stable release 4.0.6. In previous versions the 3D view was not that good. All files are in the Github repository. I shared the board on OSH Park.

For a smooth transition of digits and for adjusting the brightness, I plan to use PWM. For testing this, I wrote some VHDL code, with which I can create 10 PWM outputs, each one with three 32 bit counters: one for an initial off-time, one for the on-time and one for the final off time. The initial off-time is useful, if you want to turn on the PWMs phase-shifted, to avoid big current spikes if you turn on all PWM outputs at the same time. All 30 counters are running in parallel and clocked with 25 MHz (I love FPGAs). The reload values of the counters can be programmed via an SPI interface. For testing the functionality, I wrote a VHDL testbench. In a testbench you instantiate the component you want to test, simulate inputs and check the outputs. This is a little bit simpler: I just simulated the inputs, and looked at the outputs in the wave display of ModelSim to check if it is right:

And looks good. I tested all 8 combinations of setting off1Time, onTime and off2Time to 0 or 10. In the last line you can see the PWM output signal, and the phase relative to the cycleStart impulse.

With this FPGA configuration I can now test different PWM frequencies, down to seconds cycle time and up to MHz. For example with a PWM frequency of 6 kHz, I can implement a PWM resolution of 13 bits. This is sufficient for a smooth fading, which is tricky, because it has to be exponential: If it is dim, the human eye detects small changes much better than when it is bright, so you need small steps when it is dim and larger steps the brighter you get, for an apparently linear experience. I used the formulas as described here and implemented it in an Arduino sketch.

You might think a PWM frequency of 100 Hz is sufficient, but there are studies that you need at least a few kHz to avoid seeing dots when moving your eyes fast (saccade). Once I photographed a car headlight with long exposure and I could calculate the PWM frequency of the LEDs to be 100 Hz. This can be really annoying in traffic, when you move your eyes.

This is the PWM signal which the Arduino sketch creates, tested with LEDs:

My camera is not very good, in reality it looks even better.

Full source code for the FPGA project and the Arduino sketch is available in github. For the FPGA board I've used this one which you can get from eBay for 33 EUR, an USB blaster FPGA programmer clone included. Works great, but there are even cheaper FPGA boards, if you don't need the VGA output etc. The Arduino is an Arduino Nano clone, which you can get from eBay for EUR 2.39 shipped. Crazy how they can manufacture and ship it for such a low price.

Next I'll develop the high voltage driver for the Nixie tube and then test the PWM signal with the tubes. Some people suggested that Nixie tubes can't be controlled with such high PWM frequencies, because the gas in the tube needs some time to ignite, and you can't reduce the duty cycle too much, otherwise the gas doesn't stay ignited. Will be interesting to see how this works out. There were also some concerns that the tube ages faster when pulsed with PWM, but I asked Peter from Tubeclock.com about it and he says it doesn't matter much.

I discussed the project on EEVblog, see my pimp up grandma's clock with Nixie tubes posting, and there was the idea to move the digits closer together. I think it would be better to move them more to the front, so that it can be viewed good from the side as well, without the big round analog clock in the middle hiding digits. This is the new idea for the arrangement: