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.




Video:


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.

Parts list for control circuitry:
  • 1x ATTiny2313 AVR
  • 1x DS1631
  • 3x IN-16 Nixie tubes
  • 3x K155 or 74141 Nixie decoder
  • 3x 22kΩ resistor
  • 3x 4.7kΩ resistor
  • 1x MPSA42 300V NPN signal transistor (Digikey)


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)
  • 1x 7805 5V linear regulator
  • 1x IRF820 MOSFET
  • 1x 500μH power inductor (Digikey)
  • 1x 1N4937 600V fast-recovery diode
  • 2x 100μF 100V capacitors (or a single cap rated for >200V)
  • 1x 820k resistor
  • 1x 5.6k resistor
  • 1x 150Ω resistor
  • 2x 47μF capacitor (25V)
  • >2x 0.1μF capacitors (25V) - Apply liberally throughout the circuit
Source code:

24 comments:

  1. cool! Can you port this schem (project) to Arduino? It will be greate!

    ReplyDelete
  2. You could, but the source code would be a complete rewrite, and you wouldn't have to change anything else, so by all means, feel free to try yourself. :-P

    ReplyDelete
  3. I like your work Kenneth. I plan to make myself some nixie projects (already ordered tubes) and you posted this project right on time!

    ReplyDelete
  4. 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.

    ReplyDelete
  5. 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.

    ReplyDelete
  6. Hello Kenneth,

    great project. I would like to built this thermometer too. Is it possible that you send me the hex-file of your project.

    regards
    Stefan

    ReplyDelete
  7. Kenneth,

    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.

    Thanks,
    Remon
    rwilms(at)loosdorp(dot)nl

    ReplyDelete
    Replies
    1. Yeah, that's pretty typical. It is REALLY hard to build a boost converter with such a high step-up as this without something getting hot. Higher input voltage = lower power loss.

      Delete
  8. Hello Kenneth,
    Very nice project there!...I tried to compile your source code in AVR Studio but I keep getting the error message Can't find file "USI_I2C.c". I believe this is for the Universal Serial Bus module. I have the latest Winavr build so I wonder why the error...I am a code newbie BTW...any info appreciated..ThanksBob

    ReplyDelete
    Replies
    1. USI_I2C.c is the second file I list in the post. I kept my I2C driver as a separate file since I reuse it regularly.

      Delete
    2. 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

      Delete
    3. 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.

      Delete
    4. Thank you very much...They are in sequence by default as I expected....Bob...W8UUU

      Delete
  9. 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)

    ReplyDelete
    Replies
    1. You would need 16 output pins. You'd still be using an 8 bit AVR. You could still use the ATTiny2313, and would just need to add a pair of 74595 shift registers to get you all the outputs you'd need.

      Delete
  10. 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?

    Cheers

    ReplyDelete
    Replies
    1. I'd have to reverse-engineer my own project. You'll need to refer to the datasheets and figure it out yourself.

      Delete
  11. 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.

    ReplyDelete
    Replies
    1. 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.

      Delete
  12. Hi Kenneth... I have managed to export the code as a hex file (I think) but I need to know if the ATTINY chip is running in 1MhZ or 8MhZ mode... not sure what this means but hope you can help.

    ReplyDelete
    Replies
    1. I want to guess that it's running at 8MHz. I don't recall deliberately changing any fuses from the default, so whichever that is.

      Delete
    2. Thankyou for the quick reply. I am hopefully going to attempt to build this next weekend... Fingers crossed I get all the pins correct lol :D

      Delete
    3. 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.

      Delete
    4. 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.

      Delete