Orologio Nixie: 2 – il driver

luca 8 dicembre 2011 10

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:

10 Comments »

  1. Kevin 16 giugno 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 giugno 2012 at 08:22 - Reply

      Hi Kevin,

      could you please post the full error you get?

  2. Kevin 18 giugno 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 giugno 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 giugno 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 giugno 2012 at 11:43 - Reply

      Hi Kevin,

      did you get the same error?

  4. Kevin 19 giugno 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 giugno 2012 at 13:47 - Reply

      Kevin, you’re welcome! ;)

  5. KomandanteKrull 12 maggio 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 maggio 2013 at 09:44 - Reply

      Hi

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

Leave A Response »