Thursday, April 14, 2011

AVR Nixie Tube Thermometer

A few months ago I was wandering around the newstand in downtown Davis looking for something to read, when I found the January issue of Elektor, which had a feature article on building a nixie tube thermometer. It looked like an interesting project, and gave me enough pieces to roll my own using what I happen to have in my parts bins.

Nixie tubes were originally used in the 1950's and 1960's, before LED and LCD segmented displays were developed, to display numerical information from equipment such as volt meters and early computers. Nixie tubes operate by having 10 different shaped cathodes and an anode cage in a neon atmosphere. With a large positive voltage applied to the cage, and one of the cathodes grounded, electrons will be ejected from the cathode and ignite the neon immediately surrounding the specific cathode, which are formed in the shape of the digits 0-9.

Nixie tubes went out of use quickly once it was possible to replace them with LEDs and LCDs, due to their requirement for high voltage, their fragility, and relatively high power requirement. The steampunk movement has brought back their use as a novelty, which has unfortunately driven up the cost of larger tubes on the second market (Obviously, production of nixie tubes halted decades ago). The IN-16 tubes used for my thermometer are about as big as you can get them while still being affordable, being about $3 a piece on eBay.

The circuit is composed of two major parts: The digital control on the front of the circuit board, and the high voltage power supply behind the tubes.

The digital control is driven by an ATTiny2313 AVR, which reads the current temperature from a DS1631 temperature sensor, optionally converts the Celsius reading into Fahrenheit, and then decodes it into three digits of BCD, output to the nixie driver chips, which decode the BCD to 1-of-10 while being able to handle the high voltages from the nixie tubes.

The jumper next to the AVR controls whether the temperature is displayed in Celsius or Fehrenheit.

The Nixie tubes have a junction voltage of about 120V, meaning the current through the display is determined by the remainder of the voltage across the current limiting resistors: (180V-120V) / 22k = 2.7mA.

The power supply was where the magazine article was most valuable. The MC34063 is a Texas Instruments boost convert, which means it uses an inductor to step low-voltage high-current to high-voltage low-current. I have done this open loop before, where the on and off times of the grounding switch on the right of the inductor are fixed and you just hope it happens to be the right voltage. The MC34063 on the other hand is able to run this circuit closed loop, meaning it samples the output of the circuit and uses that to adjust how it controls the boost circuitry to maintain a fixed voltage, regardless of load. This is done by the voltage divider, which divides the desired voltage down to 1.25V to be compared with the voltage reference inside the chip.

The 330pF capacitor controls the speed the boost converter runs at, and is mostly a function of how big the power inductor and voltage ratio are. I just used a value close to that in the schematic, but ideally you would calculate this using the tables from the datasheet.

Not shown in the schematic is the very standard 7805 linear regulator used to step the 12V down to the 5V required for all of the digital control.

Parts list for power supply:

1x MC34063 boost converter (I managed to smoke the first one with 180V pretty quickly, so having it in a socket and having spares is a good idea) (Digikey)

That is pretty awesome. I am building a watercooled steampunk-inspired PC and this would fit the bill for the temperature sensor. Would you consider designing a PCB for a kit?

Also, would a digital flow meter be possible? I have a flow sensor that generates 6000 pulses per litre flow... I imagine it should be easy to convert that into a digital readout. Again, could be a kit...

In any case, I would be willing to pay for a programmed ATTiny2313 AVR.

That would be pretty cool. I've been toying with designing some sort of generic Nixie breakout board, but I wouldn't hold my breath; It doesn't look like I have much time this summer to actually test anything, I don't have access to my electronics work bench.

I have built your power supply for 3x IN-14 tubes. I use the same components only a 470uH inductor (A77 470 Fastron). My 150 Ohm resistor becomes very hot, (50 degrees Celcius) and my IRF and coil also become 40 degrees. Is this normal?

I wonder what I can do to lower the amount of heat dissipation as the PCB will be built into a closed casing.

Yes...I found it and the code compiled fine. I do have one last question. I am getting the design on Eagle CAD and can't figure out what ports are connected to each individual BCD input line to the decoder chips. I can figure out what port control which digit or tube but each individual line is not indicated on the schematic or the connections to the controller. I am assuming they are in order like PB(0) to BCD A, PB(1) to BCD B, etc. for the rest of the BCD inputs. I am trying to study the code to figure it out but so far have been unable to do it. By the time I finish this project I WILL learn something!...Of course with your appreciated assistance...BTW I am only 75 years young and never sunk my teeth into "C"...any info appreciated!...Bob

Look at NixieTemp.c, lines 89 through 91. That's where the 12 digital output pins of the controller are updated with the new BCD values. Feel free to wire those connections any way you like, and then just update those three lines of code accordingly.

Kenneth, thanks for the schematic. I'm thinking about converting this to a four digit readout, (230ish plus decimal) would I be correct in thinking that I would just need a 16 bit version of the ATTiny? (And four of all the other parts)

Hi Kenneth, Great project. I have made a Nixie clock in the past and stumbled onto your page looking for new ideas with nixies. Could you post or send me a detailed schematic showing the pinout on the chips?

Hello Kenneth, very good project. I´m interested for this and i would like make it. it's possible configure the circuit for convert fahrenheit to celsius? and, I can use the typical boost converter, like this?:http://www.ledsales.com.au/kits/nixie_supply.pdf or the power supply must be like yours? All the best.

The sensor reads in Celcius. The "Unit Sel" jumper selects whether to display in Celsius or Fahrenheit.

That boost converter looks great for this project, so using that one instead of building your own is valid. I designed mine for 180V, but anything in the 150V-200V range should work without other modifications.

Hi again Kenneth... I am getting myself in a complete muddle with this.. I managed to get the hex file uploaded to the ATTiny chip and I have connected it to the K155 chips as per the pin out in the .C file but I am struggling with the thermometer chip.Are there only 2 wires going to the DS1631 with 2 resistors jumping these to +5V or are the other pins on the DS1631 connected to ground and VCC as well? The video shows something yellow sat next to the chip but I can't make out what it is or where it is connected.I am trying to test this using a load of LED's on a breadboard before I connect the HV and nixie tubes up. If I am correct, a different LED should light up depending on which K155 port goes high?Once again, I appreciate your expertise on this as I fear I am in over my head... I am like a magpie attracted to shiny things but my confidence is disproportional to my abilities it seems :/Craig.

It would appear that I didn't bother writing in any of the Vcc and ground connections, so yeah, you'll need to apply power to the DS1631 chip, as well as all the other chips. You should review the datasheets for everything and see how they recommend wiring them up.

I'd think the K155 port which is selected would go low... I'd recommend tapping LEDs (plus current limiting resistors) between the ATTiny and the K155 chips and just read off the binary code. Add in the K155 decoders and nixie tubes once you've got your 5V logic working.