Introduction: Nixie Tube Clock W/ Arduino Mega
This is a Nixie Tube Clock run by an Arduino Mega. It also has a set of RGB LED lights, and a button matrix on the back to change settings without plugging it into a computer. I used a set of laser-cut standoffs, but you can make your own with a small drill bit.
Some background: Read here about what nixie tubes are if you're curious. Basically they're gas-filled tubes with numbers 0-9 in them, when you run some voltage through a digit it will light up.
I'm sorry this guide isn't very detailed, please comment if you have questions. I also apologize that I don't have pictures of the RGB LED lights I used.
Step 1: Parts
These are the parts I used, you can probably find plenty of alternatives.
4 IN-14 Nixie tubes (get 5 or 6 in case one doesn't work) ($25 total)
1 130V-200V Power supply (Look up "nixie tube power supply") ($12)
4 K155ID1 drivers ($15 total)
1 DS3231 clock module ($2)
10 5.6K 3W resistors ($4) (You can also use 10K resistors)
1 Arduino Mega ($10)
1 long breadboard ($5)
Solid core wire - $5 ish
1 8-button matrix (optional) ($5)
Assorted heat shrink tubing ($5) + Heat gun
Tools: Soldering iron, safety glasses, laptop with Arduino software, patience, needle nosed pliers, wire strippers/cutters, exacto knife, multimeter, drill press, hot glue gun. Access to a laser cutter for easy acrylic standoffs, access to a 1/2" hole saw drill bit if you want to make your own.
Step 2: How to Power a Nixie Tube
READ THIS GUIDE: https://www.instructables.com/id/How-to-Control-a-Nixie-Tube-with-an-Arduino/
Especially steps 1-3. You definitely need the 10K resistor. I used two 5K 3 watt resistors in series to accomplish this.
Basically, get up to 160v or so, put a 10K resistor between the power source and the nixie tube, and plug a lead of the nixie tube to the ground. Read the guide, it explains better than I will.
Step 3: Controlling 4 Tubes With an Arduino Mega
Once again, follow this guide. I'm just making this to show the last few steps of putting the parts together into a working clock.
I used K155ID1 chips for controlling the nixie tube, it was $16 for a set of 6 from Europe.
You can use multiplexers to need less outputs from the arduino, or there might be a way to use less of the IC chips, but I didn't do that.
I used one chip per tube, and 4 outputs from the Arduino for each tube. Because of this I needed an Arduino Mega, which has more I/O pins than the Arduino Uno. The above/below pictures are of my breadboard before I wire up all the parts, and a sketch I made of how I wired each tube up to the arduino with the chip.
Yes, this uses 4*4=16 I/O pins minimum, but that's fine because the Mega has like 60.
I wired up the button matrix by putting the "G" pin to power, and putting each button to an analogRead pin. This is because digitalRead sometimes reads the button as pressed when it isn't, but by only making it "pressed" if analogRead is at 1023 (The max value), I skipped most of that noise.
After wiring up the tubes, DS3231 clock module, and RGB lights to the arduino, it was time to do some major programming.
RGB LED Lights
I put 4 RGB LED's in parallel by wiring all the leads together with jumper wire. You can see it in the above pictures as the white wire that jumps between the four tubes. I used common cathode LED's, so if I put the Arduino pin to LOW they would be on. You can find plenty of tutorials online about controlling RGB LED lights, just figure out if yours are common cathode or common anode.
Step 4: Programming
I have attached my code, hopefully it helps. "NixieJT1" is the full code. DS3231 helps set the clock module
Some programming tips:
If your segments are lighting up in random order, try changing the order of the pins A/B/C/D. I made them be reversed of what I thought they should be, and it started working.
I used analogRead for the button matrix, and plugged the "G" into 5V. DigitalRead gets confused if you touch metal parts of the matrix.
The last part of the code (void DisplayNumber) is just going from 0 to 9 in binary. 0001, 0010, 0011, etc. There's probably a better way to do it.
Step 5: Laser Cut Standoffs
I have attached the file I made/used for the laser cut standoffs. My school uses an Epilog laser, and it's settings are a stroke thickness of .0001in or smaller to cut it, and anything else to just etch it. I just wanted them cut out, so all the lines .0001in or so.
I cut out two sets of standoffs mostly so that I had replacements in case I messed some up, but they also have small differences (different hole sizes for the wires and LED hole in the center).
If you don't have a laser cutter you can make these yourself with two normal drill bits and one hole saw drill bit (1/2 inch diameter). Wood would also work instead of acrylic, you just wouldn't have as cool of an effect with the LED's.
Question 4 years ago
Is there an Arduino compatibility issue or am I not doing something correct? Every time I try to compile I get errors; rtc does not make a type.. and also time does not name a type. Please let me know if the code compiles for others and I am just missing something in this. Otherwise it’s a clean look finish that I am just some code away from having done.
Answer 4 years ago
Hmm did you get it to work? Errors like that are often fixed by updating the library or reinstalling the library, or finding a different source for that RTC library. Often I'll test 2 or 3 libraries before finding one that simply works for my needs
Reply 3 years ago
Sorry for the delay. Yes I was able to get it going. It was a library issue There’s so many ds3231 libraries it can be daunting just to find the correct one
Question 5 years ago
I like this project in that it is NOT using a multiplexing function to drive a clock display. This seems to be the only Instructable out there for a full blown clock driving each tube with separate tube bit patterns. LOVE that brute force approach, and the simplicity of not having to build a full blown printed circuit board to make something work. Do you have a complete wiring diagram for this project? It would save a lot of time not to reverse engineer from the program, particularly the push-button panel and what you are doing with the LED lights. Thanks!
Answer 5 years ago
Thanks, me too! I got annoyed at a class assignment where we had to use a multiplexer to control a 7-segment display when I had more than 8 output pins available on the microcontroller.
I don't have a complete wiring diagram, but I can give you more of a summary:
For the push button panel you can see the pic below - the left four buttons were for changing the time (increase/decrease hour, increase/decrease minute), then the right four buttons were for the LED functions. I had a fading function, a few solid colors, off, and the smiley face button showed the time 11:11 with her favorite color LED's on.
The button matrix's outputs were put into the analog input pins on the Mega. I did this because something wasn't right with the matrix I had and it inconsistently said 0 or 1 with/without being pressed, but if I did an analog read and only used the value if it was 1023 then it would work well enough.
The LED lights are just three RGB LED's hooked up in parallel. There are tons of other instructables on wiring and programming RGB LED lights, I think I copied code for the RGB fade function.
The last few pictures in the instructable are the closest thing I have to a circuit diagram lol sorry. I basically followed other instructables on how to wire up nixie tubes (resistors included), then different tutorials on wiring up the clock module and button matrix.
Answer 5 years ago
Take a look at my Nixie Clock routine. I think you might want to check the pushbutton routine I used. I am not sure from your description if you used pull down resistors in yours or not. But your routine was helpful and I'm glad I used that approach in mine.
5 years ago
Hey! I really like this project and am getting ready to build it myself. I was curious how you decided to power the arduino? Did you hook it up to the 12vdc side of the converter or did you run a separate power supply for both the arduino and the converter? Also, I'm assuming this design could be expanded to use 6 nixie tubes instead of 4 right? Thanks again!
Reply 5 years ago
Sorry I didn't see this for a few weeks! I just plugged the 12V DC from the wall supply right into the arduino, and also had that going to the input of the power booster.
This could absolutely be expanded for 6 tubes! There are plenty more output pins on the Mega. Just plan for the space you need on the breadboard
6 years ago
Nice. I really like the simple wooden housing. It gives the whole thing a clean minimalist design.
Reply 6 years ago
Thanks! My dad made the box. We used 1/4 inch wood, put together with a nail gun and some screws for the back panel.
6 years ago
that is so cool!
6 years ago
Great project with a lovely, unique look!