Introduction: Arduino Controlled Nixie-tube Thermometer
Years ago I bought a bunch of IN-14 Nixie tubes from the Ukraine and I had them lying around since then. I always wanted to use them for a custom device and so I decided to finally tackle this project and build something that utilizes this almost ancient way of displaying digits, but for now I didn’t want to build a Nixie tube clock (I thought that was a bit of a cliché thing to do and for now I’ve had enough of fancy hipster clock projects), so I thought: Why not build a thermometer for my room that can be activated by clapping? I made it clap activated so that it wouldn‘t be on all the time, because I thought that was quite a waste of energy and I also didn’t want it to illuminate the room, especially during the night.
The Nixie tubes are controlled by an Arduino, which is also responsible for reading the temperature from the well-known DHT-11 temperature sensor.
This is a shortened copy from my original series released on my website. Take a look at it, if you are interested in other technical articles and projects that I didn't edit for Instructables yet.
Step 1: Nixie Tubes and High Voltage
Nixie tubes are cold cathode tubes that are filled with a specific gas.
Furthermore, they contain a common anode (or cathode) and separate cathodes (or anodes) for every digit or character they can display (See fig. 1.1).
In my case, the tubes have a common anode and the digits are separate cathodes. Unlike other tubes from that time (transistors, diodes, …) Nixie tubes usually don’t need to be heated to work properly (hence the name: cold cathode tube).
The only thing they require is a pretty high voltage, typically between 150 and 180V DC. This is typically the main problem when handling these display devices because it means, that you will need a custom power supply or step-up circuit and controllers, that are capable of switching the cathodes on and off without using too many GPIO lines.
Step 2: 12V to 170V DC Step-up Converter
Let’s start with somehow creating the necessary voltage to make the tubes glow. Luckily the typical Nixie tube needs a high voltage but very low current, which means that it is quite easy and cheap to build such a converter.
Be careful when using this circuit and high voltages in general. They are not a toy and getting a zap hurts a lot in the best case and can potentially kill you in the worst case! Always turn the power supply off before changing/servicing the circuit and make sure to use a proper case, so that nobody touches it accidentally when it is in use!
I used the well-known MC34063 integrated circuit for the step-up converter. This small IC combines everything you need for any kind of switching converter. However, instead of using the built-in transistor of the IC, I decided to go with an external transistor, which helped keep the IC cool and also allowed me to have a higher current draw at the output. Furthermore, because It was surprisingly hard to find the right values for all these components to get an output of 170V, I gave up after some days of calculations and tests (The highest I got from 12V was 100V) and decided not to re-invent the wheel. Instead, I bought a kit from eBay, that pretty much follows the schematic from this datasheet with a few tweaks (See fig. 2.1. I also added descriptions to the image).
Step 3: Controlling the Tubes With an Arduino
So, as you saw earlier, the tubes require a high voltage to turn on. “So how can you switch the tubes on and off with a microcontroller, like an Arduino?”, you might ask.
There are a few alternative routes you can take to achieve this goal. For example, dedicated Nixie tube drivers. You can still get new old stock and used ICs, but they can be hard to find and they can be expensive and I don’t expect them to be easier to find in the future, because these are no longer produced.
So I won’t use such a Nixie tube driver. Instead, I’ll use transistors and binary to decimal decoders, so that I don’t have to use 10 GPIO lines per nixie tube. With these decoders, I’ll need 4 GPIO lines per tube and one line to select between two tubes.
Additionally, so that I don’t need to switch between the tubes all the time with a high frequency, I’ll use flip-flops (which will need one additional GPIO line for resetting) to retain the last input as long as needed (See Fig. 3.1, click here for the full control-circuit in a high resolution).
Step 4: Design Considerations
While designing this circuit, I found decoders with built-in R/S-Flip-Flops, that are still being produced (for example the CD4514BM96). But unfortunately, I couldn’t get these quickly as the delivery time was two weeks and I didn’t want to wait that long. So if your goal is to make a small PCB (or you want to have a small number of different ICs), then you should definitely go with such a chip, instead of using external Flip-Flops.
There are also inverted variants of these decoders. For example, the CD4514BM965 is the inverted variant to the above mentioned IC, where the selected number will be low instead of high, which is not, what we want in this case. So pay attention to this detail when ordering your parts. (Don't worry: A full parts list will be included later in this Instructable!)
You can use any type of transistor for your array, as long as the ratings match the voltage and current draw of your tubes. There are also transistor-array ICs available, but again, I couldn’t find any that were rated above 100V or that were quickly available.
Step 5: The Transistor Array
In step 3 I didn't show the transistor array to keep the graphics simple and easily understandable. Figure 5.1 shows the missing transistor array in detail.
As you can see, each digital output of the decoder is connected to the base of an npn-transistor via a current limiting resistor. That's all, really simple.
Just make sure, that the transistors you use can handle a voltage of 170V and a current of 25mA. To figure out, what your base-resistor value has to be, use the calculator linked at the end of this Instructable under "Further readings".
Step 6: Reading the Temperature
You might have already heard about the DHT-11 (or the DHT-22) combined temperature and humidity sensor (See fig. 6.1). The only difference between this sensor and the DHT-22 is the accuracy and measuring range. The 22 has a higher range and better accuracy, but for measuring the room temperature, the DHT-11 is more than sufficient and cheaper, even though it can only deliver integer results.
The sensor requires three connections: VCC, GND and a single line for serial communication. Simply connect it to the voltage source and connect the single wire for communication to a GPIO pin of the Arduino. The datasheet suggests adding a pull-up resistor between the com-line and VCC, so that the communication line is in a high state, when not used (See fig. 6.2).
Luckily there’s already a library for the DHT-11 (and a bunch of well-documented libraries for the DHT-22), which will handle the communication between the Arduino and the temperature sensor. So a test application for this part is quite short:
Step 7: Complete Arduino Sketch
So after the sensor readouts were done, the last step was to take the information from the sensors and to display the temperature with the Nixie tubes.
To turn a certain number on a tube on, you have to transmit a 4-bit
code to the decoder, which will turn on the correct transistor. Furthermore, you also need to transmit one bit that indicates, which of the two tubes you want to set right now.
I decided to add an R/S-Latch right in-front of each input of the decoder. For those of you, that don’t know, how one of these latches works, here’s a quick explanation:
It basically allows you to store one bit of information. The latch can be SET and RESET (hence the name R/S-Latch, also known as S/R-Latch or R/S-Flip-Flop). By activating the SET input of the latch, the output Q is set to 1. By activating the RESET input, Q becomes 0. If both inputs are not active, the previous state of Q is retained. If both inputs get activated at the same time you have a problem, because the latch is forced into an unstable state, which basically means that its behavior will be unpredictable, so avoid this state at all cost.
So to display the number 5 on the first (the left) and the number 7 on the second Nixie tube, you have to:
- RESET all the latches
- Activate the left tube (Send 0 over the EN-line)
- Set the inputs of the decoder (D, C, B and A): 0101
- Set D, C, B and A all to 0, so that the last state is retained (This doesn’t need to be done if both tubes should display the same number)
- Activate the right tube
- Set the inputs of the decoder (D, C, B and A): 0111
- Set D, C, B and A all to 0, so that the last state is retained
To turn the tubes off you can transmit an invalid value (like 10 or 15). The decoder will then turn all the outputs off and therefore none of the available transistors will be activated and no current will flow through the Nixie tube.
Step 8: Odering the PCB
I wanted to combine everything (except for the step-up circuit) on one PCB, which I think turned out pretty well (See fig.(8.1).
A main goal of mine was to keep the PCB-size as small as possible, but still provide some space, where it could be mounted to the case. I also wanted to use SMD-components, so that I could improve my soldering-technique and they would also help keep the PCB thin so that the custom case doesn’t have to be large and bulky (See fig. 8.2).
Due to the usage of SMD components, most of the connections had to be made on the component-side. I tried to use as few vias as possible. The bottom-layer really only has the GND, VCC and +170V lines and some connections that had to be made between different pins of the same IC. That’s also the reason why I used the two DIP-16 ICs instead of their SMD variants.
You can download the PCB design files and EAGLE schematics here.
Because this is a tiny design with very small tolerances and traces it was important to find a good manufacturer for the PCBs so that they would turn out nice and work properly.
I decided to order them at PCBWay and I can’t be more satisfied with the product they sent me (See fig. 8.3).
You can get an instant quote for your prototypes online without the need to register. If you decide to order: They also have this handy online-converter which will convert EAGLE files to the correct gerber format. Even though EAGLE has a converter too, I really like online converters from manufacturers, because this way you can be 100% sure, that there won’t be any compatibility issues with the gerber version.
Step 9: Troubleshooting
When first testing my freshly soldered PCB, nothing worked. The tubes would either display nothing at all (decoders reached a value > 9) or random numbers would either stay on constantly or flash on and off, which looked nice but was undesirable in this case.
At first, I blamed the software. So I came up with this Nixie tester for Arduino (See fig. 9.1).
This script allows you to input a number of a GPIO pin (0-8) you want to change the state of. It then asks for the state. When entering pin number 9, the latches are reset.
So I continued my testing and made a truth-table with all the possible inputs for A, B, C and D. I noticed, that the numbers 4, 5, 6 and 7 could not be displayed with either of the two tubes. Additionally, they would react differently to the same combination of inputs.
I figured, that there must be an electrical problem too. I couldn’t find any technical problems in the design, but then I thought about something I’ve learned a long time ago (but never really had a problem with since then): Flux can be conductive. This might not be an issue for usual digital and low-voltage applications, but it seems like it was an issue here. So I cleaned the board with alcohol and afterward it behaved properly.
Kind of. Another thing I noticed: The part that I used in EAGLE when creating my PCB layout was incorrect (at least for my tubes). My tubes seem to have a different pinout.
Just some things to keep in mind when your circuit does not work right away.
Step 10: A Custom Case
After everything else was sorted out, I wanted to build a nice case to house my circuit. Luckily I had a lot of wood left from my word clock project, which I wanted to use for building a grid on the inside (See fig. 10.1).I built the case using the following measurements:
|6||40 x 125 x 5||Bottom, top, front and back side|
|2||40 x 70 x 5||Small side pieces|
|2||10 x 70 x 10||Structural pieces on the inside (See fig. 8).|
|2||10 x 70 x 5||Structural pieces on the lid (See fig. 11).|
After cutting the pieces, I laid them out together to create the box shown in fig. 10.2.
Figure 10.3 shows the case from a different angle.
The top of the case is exactly the same as the bottom, just without the walls and with less high structural parts (see fig. 10.4). It acts as a lid and can be taken off to service the components on the inside. The PCB will be mounted to the lid with the two tubes sticking out of the case.
After I was satisfied with how everything fits together, I simply glued all the parts together and let it dry for some hours.
You might be wondering, how I fixed the PCB to the lid when there are no screws visible on the top. I simply drilled a hole for the screw into the structural part of the lid and then made a countersink for the screw's head to go in (see fig. 10.5).
Step 11: Finishing the Build
After the main PCB was mounted to the lid, all the other components simply had to be placed in the case, which can be seen in fig. 11.1.
As you can see, I tried to organize the cables as good as I could and I think it turned out rather good. Everything fits into the case nicely, as you can see in fig. 11.2.
I also added a DC-Jack to the case (and went a bit crazy with the hot glue there). But this way it's possible to power the thermometer with any generic phone charger and a fitting cable. However, you could also add a 5V battery, if you wanted to.
Step 12: Parts Used in This Build
For the electronics:
|1||DHT-11||4,19€||Got it from an expensive store. You can get these for less than 1$ in from China.|
You'll also need some kind of microcontroller. I used an Arduino Pro Micro.
For the case:
|1 bottle||Wood glue||1,29€|
|1 can||Wood paint||5,79€|
Step 13: Conclusion
I’m really happy with the outcome of this build. For once I managed to cut the wood pieces precisely and also didn’t forget about mounting holes for the PCB. And it actually looks magnificent too (See fig. 13.1).
Besides that, it was interesting to work with tubes and high voltages in general and there are a few things to consider when doing so.
In conclusion, I’d say that it’s good, that we have more convenient ways of displaying numbers today but on the other hand there is nothing comparable to the glow and overall appearance of nixie tubes, which I really do enjoy looking at, especially, when it’s dark (See fig. 13.2).
Hope you liked this instructable. If you did, make sure to take a look at my website for more interesting articles and projects!
Step 14: Attributions, Sources and Further Readings
MC34063 Application details – ti.com
MC4x063 Datasheet – ti.com
Nixie tube driver IC – tubehobby.com
DHT-11 Arduino library – arduino.cc
A Transistor as a switch - petervis.com
Base resistor theory, formulas and online calculator - petervis.com
Participated in the
Creative Misuse Contest