NIXIE clock using six ZM1030 tubes.

Ronald Dekker


When I was about ten my father brought a few NIXIE tubes with him home from work (ZM1020 and B5092, I still have them see photograph). We mounted one of them on a wooden sigar box and connected the anode via a large series resistance to the live wire of the 220V mains! Just by touching one of the cathodes it was possible to make the numbers glow. I think that this was the beginning of my life long fascination for these misteriously glowing tubes. They are in one word beautifull! One of the things that makes them so fascinating is that they are so visably a monument of a time when a revolution in electronics was taking place. On one hand they were obviously a product from the radio tube area, and on the other hand they were used to display the results from the children of the revolution, digital ICs. To me, an equally fascinating component is the 74141 NIXIE driver. What a curious component it is, designed to interface the 5V TTL world with the high voltage NIXIE tubes.

My father used to buy, from time to time, electronics magazines which I as a child of course would read. Of course I could not understand everything that was in them. One of these magazines contained a description of a poor man's NIXIE clock (right picture) which used a mechanical clock to switch the cathodes of the tubes [1]. At that time I had no clue about the working of digital ICs (I was twelve), but this was something I could understand. Over the years I built up a small collection of NIXIE tubes, always having in mind that one day I would build my own NIXIE clock.

A few years ago a shared my room at work with Jacco van der Hoeven. Although Jacco is a mechanic by profession, he also likes to experiment with electronics in his spare time and therefor could understand my fascination for these glowing tubes. Somewhere in 2003 the NIXIE clock fever rose to an alarming level when I run into a bunch (50!) of old 74141 NIXIE driver ICs that were about to be thrown away together with a whole chest full of obsolete TTL ICs. There were at the time two obstacles which prevented me from actually building a clock. The first obstacle was the housing. Making the electronic part of the clock is no problem, but making a descent box around it is for me impossible. I always end up fitting my projects into luncheon boxes or transparant cereals containers. Although I have a very understanding wife, this is unfortunately not her idea of a nice drawing room assesoiry! The second obstacle was the lack of time. At that moment I was writing my thesis, which practically consumed all my spare time.

When I finally received my PhD (2 june 2004), Jacco and Eugene Timmering organized a beautifull group present. Jacco persuaded Jim Oostveen to donate six ZM1030 NIXIE tubes he had lying around. Then they asked Henk van Aken from the mechanical workshop to make a beautifull housing to hold the tubes and the electronics that would drive them. Henk is a man who can make anything, and the result was fantastic (top figure). Jacco and Eugene rightfully assumed that now my thesis was finished I would have plenty of spare time left to design and built the circuits for the clock. On these page you find a report on this delightfull task which made a boyhood dream come true.

Driving the dual anode ZM1030

The ZM1030 and ZM1032 are to my knowledge the only dual anode NIXIE tubes ever made. The tubes are identical except that the ZM1030 has a red filter coating. The tubes were fabricated to fit into a standard NOVAL socket. A NOVAL socket has nine pins. A normal NIXIE tube however requires at least elleven pins (ten for the digit cathodes and one for the anode). To make the NIXIE tube fit into a a nine pin socket, Philips used multiplexing. Instead of just a single anode, the ZM1030 contains two anodes (Fig. 1). One anode drives the odd digits, while the other anode drives the even digits.

Figure 1 Connections of the ZM1030 and ZM1032 NIXIE tubes.

Now, although this sounds simple, correct driving of these tubes is not a trivial matter. Figure 2 summarizes the driving voltages recommended in the ZM1030 datasheet. Both the cathodes as well as the anodes are switched between certain voltage levels. Additionally the screen between the two anode sections in the tube has to be set to a specific voltage level (Vbs). All this is nescassery to prevent parasitic glow of adjacent numerals.

Figure 2 Driving voltages as recommended in the ZM1030 datasheet.

Fortunately, after some experimenting I found that as long as the tubes are not used at their maximum brightness (maximum current), the glow of adjacent numbers is not really a big problem and a much simpler driving scheme can be used. This driving scheme is depicted in Figure 3. The anodes are switched by high voltage pnp transistors T1 and T3 connected to the 180V power supply. Two high voltage npn transistors T2 and T4 interface the anode switches with the microcontroller. A high on the base of e.g. T2 will cause T2 to conduct. The collector current of T2 set by R6 to something less than 0.5 mA is equal to the base current of T1. This high a base current will drive T1 into saturation so that anode a2 will switch to 180V. Instead of using conventional 74141 drivers, simply 5 high voltage npn transistors might have been used to switch the cathodes. In this case that would only have required one control wire more as compared to the four wires needed for a 74141 decoder. However, since I had them lying around I took the easiest solution.

Figure 3 Basic driver circuit for the ZM1030

Multiplexing of NIXIE tubes is normally not considered to be a sensible thing. Although with multiplexed tubes the avarage current remains the same, the peak current increases resulting in a reduced life expectancy. No multiplexing at all would mean that the anode driver circuit consisting of T1-T4 would have to be repeated for every tube. Additionally two control outputs from the microcontroller per tube would be needed. I choose for a compromise between full multiplexing and no multiplexing at all. In this scheme one anode driver circuit drives all the anodes which have been connected in parallel. The odd and even anodes are switched on alternatedly fast enough to make the digits appear to burn constantly. During the on time the current has to doubled compared to the current of a continuously burning tube with the same brightness. The anode currents are set by R1-R4 and amount to 1.4 mA for anode a2 (odd digits) and 2.6 mA for anode a1 (even digits). This corresponds to an avarage current of 0.7 mA and 1.3 mA respectively. The reason that the even digits are driven by a somewhat higher current is that they are physically located at the backside of the tube and thus obscured by the odd digits. The higher current gives them the same brighness. Both the peak as well as the average cathode currents are still well below the 5 mA maximum current specified in the datasheet. Using the tubes at an as low as possible current will greatly extend the life expectancy of the tube. By the way, the life expectancy at 4 mA digit current is specified in the datasheet to be 50.000 hrs (6 years). The anodes of the tube are directly connected via the anode resistors to two anode driver bars located on either side of the tube sockets (figure to the left). This keeps the amount of wireing required to the minimum.

The driving scheme presented in Fig. 3 uses only 5 of the 10 outputs of the 74141 (see connections of 74141 on the right). Any of the 10 outputs of the 74141 could have been used to drive the five cathodes. The reason that outputs 0,1,5,4 and 6 have been used is that these outputs are located on the same side of the IC, opposite to the low voltage inputs which are connected to the microcontroller. I use a simple small five pin SIL (Single-In-Line) connecter to connect the tubes to the decoder (see picture above). The female part of the connecter is placed next to the decoder and connected to the decoder with straight short wires (Fig. 12). Figure 4 shows the breadboard testing of the driver circuit including the flyback converter. The box on the right which holds the NIXIE tube is my "tube-test-box". It contains a Noval, a Rimlock and a 7 pin miniature socket. The pins of the socket are available on the top of the box via a standard sets wire plug. For tubes with a fillament the box contains a small 6.3V transformer.

Figure 4 Breadboard testing of the driver and flyback converter circuits.

The combination of a not too high anode voltage (180 V) and a low anode current resulted in a minimal parasitic glow of non-selected digits. The only visible parasitic glowing is around digit 1 when digit 0 is burning. Figure 5 attempts to show this effect although it is difficult to capture on a photograph. If you look at the photograph at the top of this page, you can also see the glowing of the upper part of the 1 digit in front of the zero. The effect is most pronounced when the tubes are cold and reduces as the tubes warm up. The microcontroller is programmed to switch the tubes off at night between 0:00am and 6:00am. This increases the lifetime of the tubes by 25%. Rotating the tubes from time to time also helps to increase the tube lifetime.

Figure 5 Parasitic glowing around digit 1 when digit 0 is selected.

A mains driven 1 Hz timebase

For the timebase of an electronic clock their are basically two options. Traditionally the mains frequency is used in mains powered electric/electronic clocks. However, most people tend to prefer a crystal oscillator over the mains frequency as a timebase for their clocks. Without question it is true that the short term stability of a crystal oscillator is much better compared to the mains frequency. The short term stability of the mains frequency, or rather the phase, depends on the demand and supply of the power on the electricity grid. When the demand increases, it "slows down" the generator. In other words it decreases the frequency. However, the electricity companies closely monitor the mains frequency. They count the number of cycles and compare them against absolute time standards. When a deviation is detected, it is compansated for at a suitabel moment. So the long term stability of the mains frequency is excellent! On the website of ETRANS, the coordination company for the Swiss extra high voltage grid, you can check for yourself how the mains frequency and phase compare against the absolute time [3 but also 4,5]. Crystal oscillators furthermore require accurate callibration, and are sensitive to temperature fluctuations. In short, the mains frequency is an excellent choice for the timebase of your homemade clock!

Figure 6 Mains driven 1 Hz timebase circuit.

The problem with the mains frequency is that it is "polluted" with high frequency noise. The on- and off-switching of heavy (inductive) loads, switch-mode (PC) power supplies, light dimmers etc. all cause high voltage transients on the mains, which may deragulate your clock. To filter out these transients I use a very robust filter (Fig. 6). The filter consists of three consequtive defence lines. The first line of defence is the mains transformer itself, which act as a low pass filter. Next the low voltage signal from the mains transformer is fed into two opto-couplers in such a way that the LED of one optocoupler lights up during the positive phase of the mains, while the other lights up during the negative part. Diodes D1 and D2 limit the reverse bias over the LEDs. The HP2530 conveniently houses two optocouplers in one package. Instead of the HP2530 any other optocoupler or set of optocouplers may be used (preferably not too fast types). The outputs of the optocouplers set and reset a simple set-reset flip-flop formed by N1 and N2. At the output of the flip-flop we find the wanted 50Hz signal. The idea behind using optocouplers is twofold. Optocouplers respond relatively slow, so they filter out fast transients. Secondly, it requires quite some energy to turn an LED on. In this way the optocouplers additionally function as an energy filter. Transients and spikes with a too low energy content will be filtered out even if they have a very high voltage.

Figure 7 Timing of the input and output signals of the HEF4047. The HEF4047 one-shot is used in the non re-triggerable mode to suppress unwanted triggers.

The HEF4047 forms the final line of defence. It is used here as a non re-triggerable one-shot multivibrator. Figure 7 explains how it works. The output pulse length (T) of the HEF4047 is set to slightly less than one mains period (20 ms). Once the 4047 has been triggered, it can not be re-triggered during the full length of the output pulse. In this way ((20ms-T)/T)*100% of all spurious triggers are filtered out (ignored). For the best filter working, T should be just slightly less than 20 ms. To be sure that T remains less than 20 ms even during temperature variations and aging of components it is best to set T to something like 17 ms. The HEF4518 is used as a devider by 50 to obtain a second pulse. In some of my clocks I have implemented the functions of the HEF4047 and the HEF4518 in software. It works just as good, but for this clock I didn't bother.

Now most likely all this will sound to most people as an enormous overkill. I tend to agree, but fact remains that the clocks that I have built which have this timebase circuit are perfectly accurate.

The complete circuit

The complete circuit will hold little surprises after all that has been discussed in the previous sections. The clock uses the flyback converter discussed on one of my other pages to generate the 180V anode voltage. Figure 8 shows the the CPU, ISP interface and the Nixie cathode and anode drivers. Figure 9 depicts the power supply, flyback converter, and the 1 Hz timebase circuit. Both figures are just meant to give an overview of the circuit. A detailed circuit diagram can be obtained in pdf format by clicking on the pictures.

Figure 8 CPU and Nixie drivers.
(Click on the diagram to download a detailed circuit diagram in pdf format)

For this clock I have used a Philips P89C51RB2 microcontroller. This is a, 8-bit Flash controller with a fully compatible 80C51 central processing unit. The P89C51RB2 has 16kB on-board flash memory. The larger members in this processor family with extensions RC2 and RD2 respectively have 32kB and 64kB flash memory on-board. The main reason that I have used this processor was that I had it lying around salvaged from an old controller board. Many other processors with far less program memory could have been used since the total program is only about 1kB in size. Although this processor has several additional hardware features as compared to a standard 80C51 processor, I have not used them for this clock. Consequently any other 80C51 compatible processor with on-board flash may be used. On-board flash is a must since all four I/O ports are used.

A very usefull feature of the P89C51RB2 is that it is possible to program the processor without the need to remove the device from the circuit board. Hidden somewhere in the processor is a program that allows you to erase, program and check the on-board flash memory via the RxD and TxD serial I/O pins. This program is activated by applying specific voltage conditions to the EA and PSEN pins during a reset. During the development of the program, the CPU was connected to my PC via a homebrew interface board using the small ISP (In System Programming) connector drawn in the circuit diagram. I will give a full description of both the interface board and the ISP programming software on a seperate web page.

Figure 9 Front and backside of the CPU and 1Hz timebase generator board. The ISP interface connector is situated in front of the CPU.

Figure 10 combines the flyback converter, the 1Hz timebase and the power supply. The 10V mains transformer is nicely located out of sight in a wall adapter that can deliver 1A. The adapter was converted from DC to AC since we need the 50Hz signal for the timebase. The 74141 decoders are made in good old fashioned TTL technology so they consume several hundreds of mA's. For this reason the 7805 power regulator is provided with a small heatsink.

Figure 10 Power supply, flyback converter and 1Hz timebase generator.
(Click on the diagram to download a detailed circuit diagram in pdf format)

The two "euroboard"format printed circuit boards are connected together though a simple connector. Since the total size of the boards was dictated by the spacing of the tubes rather than the number of components, the layout on the boards is comfortable spacious (Fig. 11).

Figure 11 Front and backside of the power supply and flyback board.

Figure 12 finally shows a closeup of the connections to one of the 74141 Nixie tube drivers. By using only decoder outputs at one side of the IC, the high voltage connections and low voltage data inputs have been seperated as much as possible.

Figure 12 Close up of the connections to the 74141 Nixie driver.

One button control

Personally I hate control buttons and switches, principally because you need to drill or saw holes in the clock which is something I do not like. Additionally they require wiring and consume I/O ports. For this reason my clocks only use a single push-button control in combination with a simple menu displayed on the clock itself.

After power-up or reset, the clock enters the mode select state. In this state all digits except for the most right display (seconds) are dimmed. The most right display counts at seconds intervals from 0 to 6 and then loops around to 0 again. By pressing the control button at the appropriate moment one of the 7 modes (0-6) is selected.

mode 0:
Standard clock mode. After entering this mode, the clock first needs to be adjusted to the current time. This is done by the following procedure. Immediately after entering mode 0 the hours start incrementing at a 1 Hz rate counting from 0 to 23 and then looping back to 0 again. At the moment the button is pressed the hour displayed at that moment is latched and the minutes start incrementing. Again after pressing the button the minutes currently being displayed are latched. At this point the clock displays hh:mm:00. The clock can now be synchronized to the exact time. When the button is pressed again, the clock is started. Pressing the button again during normal clock operation will re-enter the mode selection state.
mode 1:
This is a test mode. On entering the mode the clock displays 00:00:00. After pressing the button the display is incremented to 11:11:11. Each push on the button will increment the displays until 99:99:99 is reached. Pressing the button again at this moment will re-enter the mode selection state.
mode 2:
This is a test mode identical to mode 1 except that the displays are incremented automatically every second. The only way to leave this mode is by a hardware reset.
mode 3:
This is a test mode. Uppon entering this mode 000H is written to ports p0,p1,p2. All tubes are now dimmed. After pressing the button 0FFH is written to ports p0,p1,p2. All tubes are dimmed except for the most left one which simultaniously displays the 0 and 1 digit. After pressing the button again 000H is written to the ports etc. After five of these cycli the clock returns to the mode selection state again.
mode 4:
This is again a test mode. The ports are configured as a 24 bits counter p2:p1:p0. The 24 bit counter is decremented at high speed with the lowest bit in p0 as the least significant bit and bit 7 in p2 the most significant bit. This mode can only be left by a hardware reset.
mode 5:
Selecting this mode sets the "leading zero suppress flag". Setting this flag suppresses the leading zero for the minutes and seconds digits. So 5:03:06 is now represented as 5: 3: 6. Note that the leading zero of the hours is always suppressed. This flag can only be reset by a hardware reset. After setting the flag the clock returns to the mode selection state again.
mode 6:
Selecting this mode sets the "night savings flag". When this flag is set, the tubes are dimmed at night during 00:00:00 and 06:00:00. This increases the lifetime of the tubes by 25%. By pushing the button when the tubes are dimmed the flag is reset and the clock re-enters the mode selection state. Otherwise the flag may be reset by a hardware reset.

The control program

The 89C51RB2 is fully 80C51 compatible. Additionally it has many features which have not been used in this clock. The control program was written in assembler, and assembled with my "standard" assembler ASM51. The ASM51 assembler for 8051 cores was written by A.C. Verschuren and denoted to the public domain in September 1987. ASM51 runs directly under DOS and is run by the command: ASM51 filename.ASM. It is very simple to work with, transparant and on modern systems extremely fast. And yet the total program is just 50kB in size, just the size of one of the highly compressed pictures on this page! I have included both the assembler and the manual in the download zip file at the end of this page.

The program itself is rather straightforward and the assembler code is reasonably well documented. I will suffice here with a brief description. To fascilitate multiplexing of the tubes, the program uses two sets of registers, the "even set": p0_e, p1_e, p2_e and the "odd set": p0_o, p1_o, p2_e. The program every 10 ms alternately writes each set of registers to the output ports. The odd set when the odd anodes are activated for the odd numbers and the even set when the even anodes are activated.

At startup the program will configure timer 1 in such a way that it will generate an interrupt every 250us. After fourty interrupts (10 ms) the interrupt service routine (T1_int) will update the output ports as described. Additionally the service routine will read and debounce the control button. After initialisation the program enters the main program loop (main). The main loop will first check for a new second. If there is a new second it will call "inctime" to update the time kept in registers "hrs", "min" and "sec". Next routine "chk_blnk" is called to implement the "night savings function". finally the routine "convert" translates the time into the proper codes for the odd and even sets of output registers. Additionally, the main loop checks if a key is pressed and implements the mode selection state.

The routine "convert" in turn uses routines "bcd2nix" and "hrs2nix". Routine "bcd2nix" is used for the translation of the seconds and minutes digits while "hrs2nix" is used for the translation of the hours. Note that the hardware connections to the hours drivers are slightly different from the minutes and seconds.

Download the files

The compressed file which can be downloaded here , contains the following files:

  1. The assembler input file: NIXIE1.ASM.
  2. The assembled nixie1.asm file in Intel hex format: NIXIE1.HEX
  3. The 8051 assembler ASM51.COM. The program runs under DOS, usage: ASM51 NIXIE1.ASM
  4. General manual for the assembler: ASM_MAN.TXT
  5. Assembler manual specific to the 8051: ASM51MAN.TXT

References and Web links

[1] P. Oosterling, "Een andere digitale klok", Radio Bulletin, 42e jaargang, nummer 2, februari 1973, pp. 50-51/84

other interesting NIXIE and NIXIE clock pages:

[9] href=

My Son Geert's view of a father with a nixie addiction.

back to homepage