Raspberry Pi Zero Nixie Clock

4 Digit Nixie Clock driven by Raspberry Pi Zero and Arduinix board.

Similar projects worth following
I am working on a Nixie Clock driven by Raspberry Pi Zero and Arduinix board.

I wanted to build a Nixie clock by combining Raspberry Pi Zero, Arduinix and 4 IN-12 Nixie tubes I bought on Ebay and putting it into a case I am designing and 3D printing.

The goal of the project is to create a great looking clock with some IoT functionality while keeping it under $100 in cost.

Possible feature additions after the basic clock is working:

  • Display temperature, humidity via sensor.
  • Display arbitrary number from the internet
  • Timer and/or alarm functionality

Here are the latest videos of the clock in action:

Energy consumption of this clock turned out to be much lower than I thought. It maxed out at 3.8 W displaying all four numbers and being connected to WiFI.


ATMega328P source code for an SPI slave Nixie display controller

C Source File - 7.24 kB - 03/10/2017 at 22:06


Complete Python program for the Nixie Clock

x-python-script - 4.43 kB - 12/27/2016 at 00:19


View all 6 components

  • Nixie mux code on GitHub

    Nick Sayer03/20/2017 at 02:40 0 comments

    I've checked in the Nixie multiplex code for the ATMega into GitHub. It's available here.

    To get started, you need to get an ATMega328P in whatever form factor you prefer. For getting started, you probably want the DIP variant for breadboarding.

    To compile the code, you need to get it from the GitHub repository. You'll need the AVR GCC toolchain. Just type "make" and the makefile will make a .hex for you.

    Edit the Makefile and set the type of programmer you're going to use. By default, it's configured to use a USBTiny (or a clone). Wire your chip up for ISP programming. You'll probably want something like this to make it easier to breadboard.

    Connect up your AVR programmer to the chip and type "make init" to have the makefile fuse and flash the chip.

    Having done that, you can now connect the SPI pins of the chip up to your host. If you write a "1" to the E bit of the config register (see the README on GitHub), then you should see the multiplex action begin to happen on the element select lines of the chip.

  • ATMega328 SPI display controller

    Nick Sayer03/10/2017 at 22:04 0 comments

    I haven't actually tried any of this yet, but I've got a rough cut of the code for an ATMega328P acting as a dedicated SPI slave display controller.

    The wiring:

    PB3-PB5 are used as both the ISP interface to program the chip and the SPI slave interface. In principle, this means that the same 3 wire connections (plus holding !RESET low) could be used to update the flash from the Pi.

    For vocabulary, I use "element" as the name for an individual tube and "digit" as the 0-9 (plus decimal point) digit line.

    PD0-7 are digit lines 0-7.

    PB0-PB1 are digit lines 8 and 9.

    PB2 is the digit line for the decimal point.

    PB6-PB7 are the element select lines 0-1

    PC0-PC5 are the element select lines 2-7.

    What's left on the DIP variant of the ATMega328P are the !RESET, two Vcc and two GND and AREF (which can be left NC).

    I'm going to upload preliminary (untested) code for the chip to the files.

    You'll want to set the LFUSE to 0xe2. That will set the clock speed to 8 MHz from the internal oscillator. The minimum Vcc voltage is 2.7V at that speed.

  • Multiplexing in Action

    Maksim Surguy11/09/2016 at 07:45 0 comments

    After I wrote the software for the clock, I took a slow motion video of multiplexing in action!

  • Connecting Raspberry Pi and Arduinix

    Maksim Surguy10/20/2016 at 00:04 0 comments

    I am going to try to use Arduinix as the driver for the 4 IN-12 nixie tubes I got from EBay. Arduinix is an board that was originally designed to drive Nixie Tubes via Arduino Uno or alike.

    Since Arduinix requires 12 inputs in total and Pi Zero has many more outputs than that, It should be very easy to connect Pi Zero GPIO to Arduinix input pins.

    I first explored using ESP8266-based solution as a controller but there were not enough pins on ESP chip to drive the 12 necessary pins on Arduinix.

    Arduinix uses 2x SN74141 or Soviet equivalent Nixie Driver ICs to route power to appropriate cathodes of the nixie tubes. These ICs take in binary 5V input on 4 pins and turn on up to 10 cathodes on the output.

    Nixies' anode pins connect to high power transistors on the Arduinix and those transistors are turned on via yet other transistors.

    By using only 12 pins (2 banks of 4 pins and 4 pins for anodes) you can control 8 nixie tubes in total by means of multiplexing. Since I am using only 4 tubes I should be able to turn on 2 tubes at a time for a brief period of time, then switch to another 2 tubes. When this is done very quickly, it will appear that the digits are always lit.

    Without further ado, I connected pins 2-13 on Arduinix to the following pins on Pi Zero:

    Pin on ArduinixPin on Pi Zero

    I also connected Pi Zero's +5V and ground to Arduinix's 5V and ground pins necessary for the ICs.

    Arduinix requires separate 9-12V input that gets converted to high voltage necessary for the Nixie tubes. I used an adjustable DC converter (link in the part list) that takes in 12V and converts it to 5V that is then distributed to the Pi and Arduinix's 5V input.

    I followed schematics below to connect a single Nixie tube to the Arduinix:

    I then created the following Python program to display a number zero on a single nixie tube:

    from gpiozero import LED
    from time import sleep
    # Assign anode and cathode pins
    anode1 = LED(22)
    anode2 = LED(27)
    anode3 = LED(18)
    anode4 = LED(17)
    cathode1_a = LED(26)
    cathode1_b = LED(16)
    cathode1_c = LED(20)
    cathode1_d = LED(19)
    cathode2_a = LED(13)
    cathode2_b = LED(12)
    cathode2_c = LED(6)
    cathode2_d = LED(5)
    # Reset all anodes to 0
        while True:
            # Displays a "0"
            #Turn off the nixie    
    except KeyboardInterrupt:  
        # here you put any code you want to run before the program   
        # exits when you press CTRL+C 
        print "\nExiting" # print value of counter  
        # this catches ALL other exceptions including errors.  
        # You won't get any error messages for debugging  
        # so only use it once your code is working  
        print "Other error or exception occurred!"  
        print "\nExited" 

    And here's the first test of the Arduinix and Raspberry Pi Zero!

View all 4 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates