I've made some "nixie" tubes. These are actually 7 segments displays made with filament LEDs but placed in a plastic bottle so it will have a more vintage nixie look. To control the LEDs I'm usig the MAX7219 driver that could control 4 x 7 segments displays. To get the real time, I'm using the DS3231 module that works with a i2c communication so it's easy to use. The project also has 2 push buttons to set the hour and minute. All is inside a wood
by: ELECTRONOOBS on 2026-11-16
1 x Arduino NANO: LINK eBay
1 x MAX7219: LINK eBay
1 x RTC module: LINK eBay
28 x filament LEDs: LINK eBay
2 x 3mm LEDs: LINK eBay
2 x Push button: LINK eBay
1 x DC plug: LINK eBay
1 x 40K resistor: LINK eBay
1 x 100nF capacitor: LINK eBay
1 x 10uF capacitor: LINK eBay
1 x 12V DC adaptor: LINK eBay
4 x plastic bottle: LINK eBay
Steel solid wire: LINK eBay
Wood case: LINK eBay
3D STL parts: See here
Wire, soldering iron, solder, etc...

First of all, download the STL files below and print them. I've made the supports using PLA material, 2 perimeters, 0.4mm nozzle and 0.2mm layer height, also 15% infill using my CR10. Now taht we have the plastic circle supports, we start by cutting some steel wires. This wire is very cheap and you could find it at any chinese bazar or home depo. We will need a total of 7 wires for the positive pins of the LEDs and 3 for GND.

Now, we heat a bit one of the steel wires and insert it into the plastic support. As you can see in the photo belwo, I've placed the support over a cardboard box with a hole, so the wire could pass to the other side with no problems. Now I tahe one LED filament and solder it to the steel wire. I add another wire on to the other siode and solder it to the negative pin of the LED. Now I have one filament. I do the same for all 7 and make sure I give them a shape of an "8".

Since there is not enough space, I had to use more than one pin for the GND rail. I've used 3 wires that I've soldered together as you can see in the picture below. So now we have 8 pins, 7 for the segments and 1 for GND. The base of out tube is ready. Test each LED connection before closing the tube. All is there to do is to place a plastic bottle over. If you ahve glass bottle even better!!!

Ok, so now I have 4 tubes as the previous one. Is time to prepare the case. For that I've used a 3 dollars wood case. I've made some measurements and drilled 4 holes for the tubes but also 3 8mm holes on one corner for some buttons. The final scheamtic will use only 2 buttons so 2 holes is enough. On the back, I've made another 8mm hole for the DC plug. Finally, using dark varnish I paint the case to give it a more vintage look. And that's it.

Now we have to place the push buttons on the corner and the DC plug on the back. To do taht I just screw the buttons in place and for the DC plug I use a bit of hot hlue and glue it on the back of the case as you can see in the photos below. I will later use a 12V DC transformer connected to that DC plug to supply the entire circuit.

Ok, below you have the full scheamtic for this project. We need an Arduino NANO, the MAX7219 driver for 4 7 segment displays, the buttons, 2 3mm LEDs, the DC connector and the tubes. Make the connections as below having in mind which is each segment of the tubes. Connect all the A segments together, all the B segments and so on... Then we have 4 GND connections, one for each tube. Connect all wires to the MAX7219 driver and the driver to the Arduino CLK DIN, and LOAD pins which are D2, D4 and D2.

The hour and minute buttons are connected to digital pins D6 and D7 and the second LED to D8. I connect all the segments with thin wires as you can see below. I then make the connections to the MAX7219 driver for the segments and 4 GND pins. Finally, I connect the driver to the Arduino and the RTC to the i2c pins which are A4 and A5 for data and clock. Oh, and I connect the DC plug to the Vin pin of the Arduino so we could supply the entire circuit.

Ok, now we have everything connected. Is time for the code. It is quite simple but a bit long. We have to inport the libraries for the DS3231 real time clock and define the SDA and SCL pins. We also define the pins for the CLK, DATA and CS for the MAX7219 driver. In this case those will be D2 D3 and D4. In the setup loop we start the RTC module and define the MAX7219 pins as outputs.
/*
Code by: ELECTRONOOBS, 16/10/2018
Tutorial webpage: https://www.electronoobs.com/eng_arduino_tut47.php
Scheamtic: https://www.electronoobs.com/eng_arduino_tut47_sch1.php
Youtube channel: https://www.youtube.com/c/ELECTRONOOBS
*/
//We include the DS3231 library for the real time module
#include <DS3231.h> //Downlaod it here: https://www.electronoobs.com/eng_arduino_ds3231.php
DS3231 rtc(SDA, SCL);
//Define the I/O
#define MAX7219_Clock 2 //CLK pin for the MAX7219
#define MAX7219_Chip_Select 3 //CS pin for the MAX7219
#define MAX7219_Data_IN 4 //D_in pin for the MAX7219
int LED = 8; //Pin for the two blinking LEDs
//int SET = 5; //Not used any more
int HOUR = 7; //Input for set hour button
int MINUTE = 6; //Input for set minute button
//Other variables for the code
int Delay=1000; //Variable used for the 1 second loop. Each 1s we change the LED state so it will blink
bool LED_state = false; //Here we save the LED state each loop, HIGH or LOW
unsigned long previousMillis = 0; //Variable used to count the 1s loop time
String time_str = ""; //Here we save the time in a string format from the ral time module
String prev_time_str = ""; //We save the last time value so we could compare it
String hr_1_str = ""; //We divide the hours and minutes in separate variables first digit for hour
String hr_2_str = ""; //We divide the hours and minutes in separate variables second digit of hour
String min_1_str = ""; //We divide the hours and minutes in separate variables first digit of minute
String min_2_str = ""; //We divide the hours and minutes in separate variables secodn digit of minute
int hr_1 = 0; //first digit for hour
int hr_2 = 0; //second digit for hour
int min_1 = 0; //first digit for minute
int min_2 = 0; //second digit for minute
int set_hour = 0;
int set_minute = 0;
//This function will shift the data to the MAX7219 driver.
void shift(byte send_to_address, byte send_this_data)
{
digitalWrite(MAX7219_Chip_Select, LOW);
shiftOut(MAX7219_Data_IN, MAX7219_Clock, MSBFIRST, send_to_address);
shiftOut(MAX7219_Data_IN, MAX7219_Clock, MSBFIRST, send_this_data);
digitalWrite(MAX7219_Chip_Select, HIGH);
}
void setup() {
//Serial.begin(9600);
rtc.begin(); //We start the real time module
pinMode(MAX7219_Data_IN, OUTPUT); //Define the data pin for the MAX7219 as output
pinMode(MAX7219_Chip_Select, OUTPUT); //Define the cs pin for the MAX7219 as output
pinMode(MAX7219_Clock, OUTPUT); //Define the clock pin for the MAX7219 as output
digitalWrite(MAX7219_Chip_Select, HIGH); //We set the CS to high, CS is negative enabeled
pinMode(LED,OUTPUT);
//pinMode(SET,INPUT); //Not used any more
pinMode(HOUR,INPUT);
pinMode(MINUTE,INPUT);
//digitalWrite(SET, HIGH); //Not used any more
digitalWrite(HOUR, HIGH);
digitalWrite(MINUTE, HIGH);
digitalWrite(LED,LED_state);
delay(200);
//Setup
shift(0x0f, 0x00); //display test register - test mode off
shift(0x0c, 0x01); //shutdown register - normal operation
shift(0x0b, 0x04); //scan limit register - display digits 0 thru 7
shift(0x0a, 0x01); //intensity register - Min brightness: 0x01, Max brightness: 0x0f
shift(0x09, 0xff); //decode mode register - CodeB decode all digits
shift(0x01, 0xff); //Turn off all segments
shift(0x02, 0xff);
shift(0x03, 0xff);
shift(0x04, 0xff);
delay(100); //Small delay
}
void loop() {
//This loop will execute each Delay=1000ms, so 1 second
unsigned long currentMillis = millis();
if(currentMillis - previousMillis >= Delay)
{
previousMillis += Delay;
time_str = rtc.getTimeStr(); //First,we get the real time, hour, minute, second
hr_1_str += (char)time_str[0]; //We separate the first digit hour value
hr_1 = hr_1_str.toInt(); //Pass the hour value from String to int format
hr_2_str += (char)time_str[1]; //We separate the second digit hour value
hr_2 = hr_2_str.toInt(); //Pass the hour value from String to int format
min_1_str += (char)time_str[3]; //We separate the first digit minute value
min_1 = min_1_str.toInt(); //Pass the minute value from String to int format
min_2_str += (char)time_str[4]; //We separate the second digit minute value
min_2 = min_2_str.toInt(); //Pass the minute value from String to int format
LED_state = !LED_state; //Invert the blinking LED state each loop, so each 1 second.
digitalWrite(LED,LED_state); //Turn the LEDs on or off
if(prev_time_str != time_str) //If the time is not the same, we print the new value to the 7-seg display
{
print_time_to_7_seg(time_str);
}
prev_time_str = time_str; //Save the last time value
}//end of timer
hr_1_str = ""; //Reset the digits String valuew for hours and minutes
hr_2_str = "";
min_1_str = "";
min_2_str = "";
if(!digitalRead(HOUR)) //If the hour button is pressed, we increase hour by one
{
set_hour = hr_1*10+hr_2; //get total hour value in int format
set_minute = min_1*10+min_2; //get total minuter value in int forma
set_hour = set_hour + 1; //Increase hour by 1
if(set_hour == 24) //If we get to hour 24, we start from 0
{
set_hour = 0;
}
rtc.setTime(set_hour, set_minute, 0); // Write the new time to the RTC module
//delay(50);
time_str = rtc.getTimeStr();
print_time_to_7_seg(time_str); //Print the new time value to the 7-seg dispaly
}
//We do the same for the minute push button
if(!digitalRead(MINUTE))
{
set_hour = hr_1*10+hr_2;
set_minute = min_1*10+min_2;
set_minute = set_minute + 1;
if(set_minute == 60)
{
set_minute = 1;
}
rtc.setTime(set_hour, set_minute, 0); // Set the time to 12:00:00 (24hr format)
//delay(50);
time_str = rtc.getTimeStr();
print_time_to_7_seg(time_str);
}
}//end of void loop
//This function will shift the numbers to the MAX7219 driver
void print_time_to_7_seg(String the_time)
{
if(hr_1 == 0)
{
shift(0x01, 0);
}
if(hr_1 == 1)
{
shift(0x01, 1);
}
if(hr_1 == 2)
{
shift(0x01, 2);
}
if(hr_1 == 3)
{
shift(0x01, 3);
}
if(hr_1 == 4)
{
shift(0x01, 4);
}
if(hr_1== 5)
{
shift(0x01, 5);
}
if(hr_1 == 6)
{
shift(0x01, 6);
}
if(hr_1 == 7)
{
shift(0x01, 7);
}
if(hr_1 == 8)
{
shift(0x01, 8);
}
if(hr_1 == 9)
{
shift(0x01, 9);
}/////////////////////////////////////end of first digit for hour
if(hr_2 == 0)
{
shift(0x02, 0);
}
if(hr_2== 1)
{
shift(0x02, 1);
}
if(hr_2 == 2)
{
shift(0x02, 2);
}
if(hr_2 == 3)
{
shift(0x02, 3);
}
if(hr_2 == 4)
{
shift(0x02, 4);
}
if(hr_2 == 5)
{
shift(0x02, 5);
}
if(hr_2 == 6)
{
shift(0x02, 6);
}
if(hr_2 == 7)
{
shift(0x02, 7);
}
if(hr_2 == 8)
{
shift(0x02, 8);
}
if(hr_2 == 9)
{
shift(0x02, 9);
}/////////////////////////////////////end of second digit for hour
if(min_1 == 0)
{
shift(0x03, 0);
}
if(min_1 == 1)
{
shift(0x03, 1);
}
if(min_1 == 2)
{
shift(0x03, 2);
}
if(min_1 == 3)
{
shift(0x03, 3);
}
if(min_1 == 4)
{
shift(0x03, 4);
}
if(min_1== 5)
{
shift(0x03, 5);
}
if(min_1 == 6)
{
shift(0x03, 6);
}
if(min_1 == 7)
{
shift(0x03, 7);
}
if(min_1 == 8)
{
shift(0x03, 8);
}
if(min_1 == 9)
{
shift(0x03, 9);
}/////////////////////////////////////end of first digit for minute
if(min_2 == 0)
{
shift(0x04, 0);
}
if(min_2== 1)
{
shift(0x04, 1);
}
if(min_2 == 2)
{
shift(0x04, 2);
}
if(min_2 == 3)
{
shift(0x04, 3);
}
if(min_2 == 4)
{
shift(0x04, 4);
}
if(min_2 == 5)
{
shift(0x04, 5);
}
if(min_2 == 6)
{
shift(0x04, 6);
}
if(min_2 == 7)
{
shift(0x04, 7);
}
if(min_2 == 8)
{
shift(0x04, 8);
}
if(min_2 == 9)
{
shift(0x04, 9);
}/////////////////////////////////////end of first digit for minute
}
Download the full code from above. Read all the comments in the code line by line to understand more. But the code dose this: We read the real time from the module using i2c communication. We pass the hour and minute from String to integer. Then we use then shift function to pass the numbers to the 7 segment displays and by that show the hour and minute. If the buttons are presed we increase the hour and minute by 1. Before, make sure you set the time to the RTC using the library example.
Below you ahve the config of thr 7 segment displays. Change those if you want to reduce or increase the brightness or any other settings. That's it. Compile, select Arduino NANO board, select the COM and uplaod the code. Now the clock should work and display time.
Leave a comment
Please login in order to comment.