Orologio Nixie: 2 – il driver

luca 08/12/2011 23

In questo secondo articolo dedicato al mio orologio con Nixie, vi illustrerò come pilotare tali display con un microcontrollore.

Limitare la corrente

Ogni tubo Nixie è caratterizzato da due valori di tensione:

  • tensione di innesco (Vign)
  • tensione di mantenimento (Vm)

e da uno o più valori di corrente:

  • corrente media/di picco per i numeri (Ik)
  • (eventuale) corrente media/di picco per il punto decimale (Ikdp)

E’ possibile trovare questi valori consultando il datasheet:

Il classico schema di collegamento del tubo è il seguente:

Per il calcolo della resistenza R utilizziamo la seguente formula:

Mentre la potenza dissipata sarà:

Applicando le formule ai valori della mia Nixie ottengo:

  • (per i numeri) R = 12Kohm e P = 0,075W
  • (per il punto decimale) R = 60Kohm e P = 0,015W

Nel mio orologio non utilizzerò il punto decimale, quindi andrà bene una resistenza da 12Kohm 1/4W.

Driver a transistor

Non è possibile pilotare direttamente un tubo Nixie utilizzando i PIN di output di un microcontrollore: ogni catodo della Nixie non connesso a massa si trova ad una tensione vicina a Vm.

La soluzione più semplice è utilizzare un transistor alla cui base collegare il PIN del microcontrollore.
Non tutti i transistor sono in grado di sostenere l’elevata tensione collettore-base (Vcbo): la scelta più diffusa è il modello MPSA42, che – come recita il datasheet - ha una Vcbo di 300V.

Il collegamento è molto semplice:

Lo svantaggio di questo approccio è che richiede un transistor per ogni numero, se quindi vogliamo utilizzare 4 Nixie avremo bisogno di almeno 40 transistors.

Driver a circuiti integrati

In passato sono stati prodotti diversi circuiti integrati progettati per pilotare le Nixie; i più diffusi sono quelli siglati 7441, 74141 o i loro “cloni” russi K155ID1 e KM155ID1 ed è ancora facile trovarli su eBay. Tutti questi integrati svolgono la funzione di bcd-to-decimal decoder to drive nixie tubes e presentano 4 PIN di input (A/B/C/D) e 10 pin di output (0..9).

Il loro funzionamento è molto semplice: inviando ai 4 PIN di input un numero (da 0 a 9) codificato in binario, viene attivata il relativo pin di output. Tutte le possibili combinazioni sono indicate nel datasheet:

Test

Ho scritto un semplice sketch per Arduino che invia su 4 PIN digitali (D8-D11) la codifica binaria dei numeri da 0 a 9, cambiando numero ogni secondo e tornando a 0 dopo il 9.
Unica nota: per poter cambiare contemporaneamente lo stato dei 4 PIN di output, non utilizzo l’istruzione digitalWrite() ma comando direttamente il registro PORTB come illustrato qui.

void setup() {
 
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);  
 
  Serial.begin(9600);
}
 
void loop() {
 
  for(int i = 0; i < 10; i++) {
    Serial.println(i);
    PORTB = i;
    delay(1000);
  } 
}

Ai PIN di Arduino sono collegati gli ingressi A/B/C/D del 74141 e, alle uscite di questo, i catodi della Nixie. L’alimentazione per il circuito integrato (5V) è presa dalla scheda Arduino, mentre la Nixie è alimentata come indicato nell’articolo precedente aggiungendo la resistenza da 12Kohm:


Ecco il circuito in azione:

23 Comments »

  1. Kevin 16/06/2012 at 12:42 - Reply

    Hi,
    I tried to compile the short sketch in Arduino v1 and 022 but keep getting “lt” error. As you might of guessed i’m new to the Arduino. What am i doing wrong.

    • luca 18/06/2012 at 08:22 - Reply

      Hi Kevin,

      could you please post the full error you get?

  2. Kevin 18/06/2012 at 14:11 - Reply

    Hi Luca,
    I get the following error:
    ‘lt’ was not declared in this scope

    sketch_jun18a.cpp: In function ‘void loop ()’:
    sketch_jun18a:12: error ‘lt’ was not declared in this scope
    sketch_jun18a:12: error: expected ‘)’ before ‘;’ token
    sketch_jun18a:12: error: name lookup of ‘i’ changed for new ISO ‘for’ scoping
    sketch_jun18a:12: error: using obsolete binding at ‘i’
    sketch_jun18a:12: error: expected ‘;’ before ‘)’ token

    Also I would like to thank you for your guide to SeeedStudio’s Fusion PCB Service. It has made the process of sending suitable board files so much easier, and I’ve been very pleased with the results.

    • luca 18/06/2012 at 19:26 - Reply

      Hi Kevin!

      sorry it was my mistake… something went wrong with copy&paste, now the sketch is fixed and you should be able to run it without problems!

      Thanks for your feedback!

  3. Kevin 18/06/2012 at 19:47 - Reply

    Hi Luca,
    I tried the new code but it still would not compile. I used both Arduino v1 and 022.

    • luca 19/06/2012 at 11:43 - Reply

      Hi Kevin,

      did you get the same error?

  4. Kevin 19/06/2012 at 13:07 - Reply

    Hi Luca,
    Not sure what went wrong works now with v1. Thank you you have been a great help to someone just starting out with Arduino’s.

    • luca 19/06/2012 at 13:47 - Reply

      Kevin, you’re welcome! ;)

  5. KomandanteKrull 12/05/2013 at 23:41 - Reply

    Hi, I have a questio about the circuit schematic.

    Where must go the ground cable of the 180V power supply?

    In the schematic, there is only 1 cable connected to the power supply. Is not missing the ground cable of the power supply?

    • luca 13/05/2013 at 09:44 - Reply

      Hi

      connect the ground of the power supply to the ground of Arduino and 74141 IC.

  6. Nat Victor 23/05/2013 at 14:57 - Reply

    hi, I have your circuit & sketch running but I’m not seeing an 8 displayed, just a pause. I’ve checked the tube and it works ok & tried 2 74141 IC’s

    Any ideas?

    • luca 23/05/2013 at 19:16 - Reply

      Hi, are you using the same power supply I used? Did you connect the ground wire?

  7. Nat Victor 24/05/2013 at 11:36 - Reply

    Hi, ground is connected and 0,1,2,3,4,5,6,7,9 all work, just the eight missing.
    Its a different power supply from http://www.kosbo.com.
    I may try playing with the anode resistor – I didn’t have a 12k so used a 10k instead.

    • luca 25/05/2013 at 09:22 - Reply

      Hi Victor,

      sorry I misunderstood your message… is 8 working if you connect it directly to power supply, without 74141?

  8. Dan 04/06/2013 at 14:35 - Reply

    Hey Luca,
    Nice post. I’m trying to follow it to test out my nixe tube setup. before I build a nixie clock.
    Everything works for a bit, but then I have problems.
    Maybe you can help me out?

    Here is my dilema:
    When I wire everything, it all works for about 10-30 seconds.
    I get my nixie tube to display digits 0 to 9 in a loop. All nice so far.
    But after about 30 seconds it either gets stuck at 7, completely goes out, or displays almost all digits at the same time. The only way to fix the situation is to go to a new nixie IC driver. I already tried 3 new ICs, think of Einsteins theory of insanity: doing the same thing over and over again and expecting different results. LOL!
    I have a strong feeling that I’m burning nixie drivers. Besides for that on my third attempt with a new driver I think I have burned my arduino mini (it just overheats any time I plug it in USB, so I declared it dead…)

    I’m using this power supply
    http://www.nixieclock.eu/component/virtuemart/power-supply-magic-eye-voltage-dc-115-235v-in14-in16-in18-in12-detail.html
    and wiring everything just like in your diagram.
    I have used a multimeter to see how much voltage comes out from this power supply to power arduino and IC, its a constant 5 – 5.5V

    Any help on how I can test nixie IC drivers that I might have burned, to see if I really burned them or if they are still alive?

    I’m more or less a newbie with all of this. Hope my questions are not too lame.

    Any thoughts or ideas?

    • luca 05/06/2013 at 16:20 - Reply

      Dan, be sure you used the power supply to power ONLY the nixie tube, not Arduino or the driver: they need 5V (for example power Arduino via USB and the driver using Arduino outputs). Could you send me a drawing of a photo about how you wired the different elements?

  9. Dan 14/06/2013 at 16:44 - Reply

    Luca,

    Sorry it took me a while to respond.

    My power supply comes with ports-out for +5v, +12v, +180v, Ground.

    I was using power supplys +180v to power the nixie anode.
    I was using power supplys +5v and Ground to power arduino and drivers.

    Here is a very rough sketch I made with Fritzing.
    I could not find some parts in Fritzing library and didn’t want to draw them from scratch, so I just took similar looking things (Magic Eye Power Supply, K155ID1, Nixie)

    https://minbox.com/gi/wWvZjxHh7g

  10. Cant 12/03/2014 at 15:32 - Reply

    Ciao Luca,
    sto cercando in giro librerie Altium per il MAX1771 per farne un alimentatore step up DC-DC e poi alimentare una valvola.
    Sai dirmi se tale libreria si trova?
    Grazie dell´attenzione,
    buon pomeriggio

    • luca 15/03/2014 at 10:24 - Reply

      Ciao Cosimo, purtroppo non so dirti: uso Eagle.

  11. holmes. 27/05/2014 at 12:37 - Reply

    Hi Luca,
    I’m getting a error saying PORTB was not declared in this scope, sorry I’m all new to this and not sure what this means?

    thanks, olly.

    • luca 27/05/2014 at 12:59 - Reply

      Hi Olly,

      strange, I’ve just tested the sketch and I can compile it. Which version of the Arduino IDE are you using?

      • holmes. 28/05/2014 at 10:57 - Reply

        Luca,

        the version is 1.5.6 -r2 to work with my Arduino DUE. It’s annoying because your work has helped me a lot with my HNC college project (Nixie Clock) the theory is there I just wanted to get something built and running even if its not a clock! but time is not on my side so i’ll have another play with the code after work to see what can be done.

        thanks, olly.

        • luca 28/05/2014 at 20:32 - Reply

          Olly, maybe direct port manipulation is not allowed for Arduino Due.
          Anyway the code can be easily changed to use the “normal” commands: in the for() loop use something like:
          switch(i) {
          case 0:
          digitalWrite(8, LOW);digitalWrite(9, LOW);digitalWrite(10, LOW);digitalWrite(11, LOW);
          break;
          case 1:
          digitalWrite(8, HIGH);digitalWrite(9, LOW);digitalWrite(10, LOW);digitalWrite(11, LOW);
          break;
          case 2:
          digitalWrite(8, LOW);digitalWrite(9, HIGH);digitalWrite(10, LOW);digitalWrite(11, LOW);
          break;
          case 3:
          digitalWrite(8, HIGH);digitalWrite(9, HIGH);digitalWrite(10, LOW);digitalWrite(11, LOW);
          break;
          (and so on)
          }

Leave A Response »