26 November 2022

The 4-weeks challenge: deliver a Nixie clock from scratch

Last weekend of October a curious teenager guest noticed the Nixie clock in our living room. The most eye-catching element was the short depoisoning routine that runs once a minute. B-5750 Nixies have their numbers 0-to-9 back-to-front, which is an even more eye-catching feature.

So I quickly explained him and his family some basics of these lovely tubes, showed them my lab/workshop/messy room and of course I told them I had designed and built that clock.

The next day I came up with a self-challenge: design and build a fully functional Nixie clock that I could give the teen at our next (and probably last for a very long time) meeting four weeks ahead.

With a small personal "library" of hardware design and AVR firmware I was quite sure I could get over all the small challenges inside this project:

  • design a working circuit and receive the PCB from the fabhouse
    • sub-task: fix the KiCAD footprint for the chosen ZM1020 Nixie
  • design a suitable case and get it 3D printed (this then turned to laser cut)
  • build it without easy access to my lab for the same period of time
  • write a user's manual

The PCB was designed with KiCAD and etched by JLCPCB. To save on board space and stay into the chosen round design I used a bare AVR ATmega uC with its internal 8 MHz clock; it also drives the voltage booster. On the board I included an ICSP header which is very useful if you're debugging or adjusting the firmware code. I used a ZM1020 round top view tube

While waiting for PCBs to arrive I learned how to use OpenSCAD to design the case, which is plain geometry applied to programming. I also risked to have no AVR microcontroller for the clock as the ATmega48 doesn't have enough program memory (or I would have needed to do heavy optimizations). I managed to unbrick a couple of ATmega168 that are enough for my firmware (wrong fuse settings).

The circuit diagram was correct. The PCB was suitable, meaning I kept HV and LV separated enough. The laser cut case (two plates) was perfect and I picked it at 3.5 weeks into the challenge. In the last week I did some firmware corrections and upgrades and today the clock has been delivered to a happy teenager.

Here it is!

Single Digit Nixie Clock with ZM1020
Single Digit Nixie Clock with ZM1020

16 November 2022

Arduino based AVR ATmega fuse doctor

Given the ongoing semiconductors shortage and needing urgently a bare ATmega168/P/328/P chip, I had to reset two 168's unresponsive to the usual avrdude programmer command.

Actually I could have spent about 10€ to buy an ATmega328P rather than spend two hours assembling the fuse doctor.

According to my own blog posts, back in 2010/2011/2012 I had already built a fuse doctor, but the link doesn't work anymore. Well, I found this Fuse Reset by Thuta Kyaw on Instructables. It uses an Arduino Nano, which I still had at home. This time I decided to do a permanent build, in case I will need it again 10 years from now.

My build of Thuta Kyaw's Fuse Reset.
My build of Thuta Kyaw's Fuse Reset.

Building it with wires requires patience and a steady hand. There is no radiofrequency involved, so there's no need to do careful planning of the layout.

Operation is easy. Fit the ATmega patient in the socket, apply 12V, wait few seconds for the LED to switch off. Enjoy.

07 November 2022

OpenSCAD for 3D printing

If you are a software programmer/developer of some sort in any high-level language and you need to design an object for 3D printing, I think that OpenSCAD is for you.

I am designing a case around a PCB I have ordered. It's a cylinder with a diagonal cut, three supports for the PCB and two holes for the buttons. In OpenSCAD the final object is described as sum/difference of basic shapes (cylinder, cube, ...) in a simple programming language.

The GUI provides both auto-completion and 3D preview.

The following code makes an empty cylinder with a diagonal.Try reading it through:

module cylcut()
            cylinder(h=80, r=39);
                cylinder(h=82, r=37);


There is a long way to go and learn before I get to the STL file for the printer, but I like it!