The easiest/best way to drive a Numitron (IV-9) with an Arduino Uno

Hi everyone,

I have been "researching" the last couple of days what would be a good approach to drive some Numitrons with my Arduino Uno. Basically the IV-9 Numitron is a 8 segment display, uses 3.15 to 4.5 V and consumes 17 to 22 mA per segment. My goal is to drive 3 Numitrons (so 8 * 3 = 24 segments) to start with, potentially extended to 6 if everything works out. The ideal solution would contain a minimum number of components (and wires :slight_smile: ), and would be easy to write code for. The options I found so far:

  • using a led display driver, for example the MAX7219CNG
    advantage: can drive 64 leds/segments, only uses 1 resistor to limit current
  • using shift registers, for example the 74HC595
    advantage: cheap, but: requires a resistor for every segment and I'd need 3 of them to drive my 3 Numitrons
  • using a pin extender, for example the MCP23016
    advantage: code seems very easy (I2C), only 2 wires, with 2 of them I could drive my 3 Numitrons

Thanks for sharing your thoughts and advice!
Jan

Just a follow-up message, since I got my project to work, and there may be other people looking for this info. :slight_smile:

First I tried the MAX7219CNG: everything worked with LED's, but the Numitrons did not work. There seemed to be some current flowing into the opposite direction when the filament shoudn't be active. (LED's don't have that issue since they only allow current to flow in one direction anyway)

So I tried three 74HC595 with shift registers and it works perfectly! I used the tutorial on the Arduino site (http://www.arduino.cc/en/Tutorial/ShiftOut), and just replaced the LED's with the Numitrons. I hadn't to make use of resistors to limit the current however. Here is a quick picture of the result: http://sdrv.ms/T8xHtV

Hth,
Jan

Cool,

thanks for sharing :slight_smile:

Not cool.

The 74HC595 are being massively overloaded beyond their specifications.

Should be using TPIC6B595s.

Paul__B:
Should be using TPIC6B595s.

Agreed. Or TPIC6A595, which is the lowest-current in that familly, but still plenty. Or put ULN2803 between each 74hc595 and the tubes.

I wonder if max7219 would have worked if you put a diode on each segment?

Paul__B:
Not cool.

The 74HC595 are being massively overloaded beyond their specifications.

Should be using TPIC6B595s.

What about what you said here: Is it possible: control Numitron IV-9 with MAX7219CNG LED driver - #15 by TM - LEDs and Multiplexing - Arduino Forum

I thought you meant that the 74HC595 could handle it. I think the 74HC595 can deliver a maximum of 20ma at up to 15V and the numitrons IV-9 needs between 17 and 20ma at 3.5V. (Tubes-Store.com → → IV-9 numitron tube).

So should that not work?

Ok I see that they actually recommend 6ma and that 20ma is the absolute max. But is it working for a few people because in the end it's taking less than 5V?

Is that what Grumpy_mike is saying here: http://forum.arduino.cc/index.php/topic,15620.0.html

With a 220R resistor you will be pulling about 18mA from each pin. That is somewhat overstress things. However, these outputs sag a bit when you start taking current from them so if you measured it you would probably find you are not outputting 5V but more like 3.3V to them. This cuts down the current and makes it a lot safer.

TM:
What about what you said here: Is it possible: control Numitron IV-9 with MAX7219CNG LED driver - #15 by TM - LEDs and Multiplexing - Arduino Forum

I thought you meant that the 74HC595 could handle it.

No, I consistently said that they could not. I said that the "HC" series are actually more capable in terms of current drive than "plain" 7400 or "HC" series which are only intended to drive low in the first place, but even if individual outputs can drive as much as 20 mA, you are only allowed 70 mA total - or 3½ outputs at once!

TM:
Ok I see that they actually recommend 6ma and that 20ma is the absolute max. But is it working for a few people because in the end it's taking less than 5V?

It is working for a few people because they appeared to "get away with it" by some chance (and likely did not test all conditions). Nothing else.

PaulRB:
I wonder if max7219 would have worked if you put a diode on each segment?

Useless. Remember - this is a multiplexed chip. Numitrons work by the heating effect of a continuous current of 20 mA. If you applied twice the voltage and thereby drew twice the current for a quarter of the time (think about those numbers!), you could presumably multiplex them (with the diodes).

Thanks Paul for taking the time to answer. I'm going to buy some TPIC6B595s then. I will try to remember to post my results so we finally have an example or thread about how to actually drive those numitron.

Hi Paul,

I've received some TPIC6B595, as far as I can see they seems to work in the same way as the 74HC595 (I'm probably wrong). I've got one Numitron-IV9 plugged in. Everything is working but I've got a voltage issue I think.

The numitron needs between 3.5V and 4.5V. the problem seems to be that when there's more than one filament on it needs more.

I've got a countdown sketch going, and once it's started counting it seems stable, "1" is as bright as "8". So I'm not really sure what's happening as when the arduino reboot, the shiftregister will light a filament at random and that one is very bright as I'm putting 5V in, but once it's running it's pretty dim. (that's just when the arduino is stopped to upload the sketch at a moment when a filament is on)

So I don't really know how to deal with that, seems to need more voltage but I don't want to burn the filament at start. I also want to use more than one Numitron and feel like this could escalade pretty quickly. Any ideas?

(some source that seems to confirm the voltage change: http://www.instructables.com/id/Numitron-clock-thermometer/step4/The-numitrons/ )

I've done a test with one of those Regulated AC/DC Adaptor where you set the voltage, and it's does get brighter with higher voltage.

I've done that because at first I though that I was demanding to many mA from the Arduino as I was using the 5V from it. So I tried the Adaptor, as much as that was probably an issue that didn't change my problem.

One filament light up using 4.5V is still brighter than all filaments light up using 6V. I'm not really sure I understand what's going on there....

I think I understood the why. The filaments are heated one after the other in a very quick sequence to give the illusion that they are all on at the same time. Because of that 3.5V or 4.5V takes to long to heat the filament in such a short amount of time, so it needs higher voltage to heat the filament quickly. I think that's it?

What you're describing is multiplexing. But I did not think you were multiplexing, I thought you had 1 tpic6c595 per digit? If so, I don't think your theory can be right.

Hi Paul,

I thought shifregisters were multiplexing but they obviously don't if you say so. I tried to read about the difference but I'm not 100% sure of the difference. Does that mean that shiftregister have some kind of memory, you can set up each pin like actual independent pins and leave it? As multiplexing you have to keep setting pins, one by one in a quick sequence as only one at the time will be working (that I though was the behaviour of shift registers too)

Well if what I though was the "why" of my problem isn't anymore. Maybe it's a software issue, maybe I'm treating it like multiplexing. My sketch is based on the arduino tutorial for shift registers. I'm going to post the code when I'm back at my computer.

Thanks

Ok, the multiplexing thing was silly of me, I got confused because of an old project I did using shiftregiters for a small led matrix, where I light up each rows in a quick sequence. Looking at my code and shiftregisters tutorial made me realised it :roll_eyes: :sweat_smile:

TM:
I'm going to post the code when I'm back at my computer.

Yes, and a schematic please. Hand drawn will be fine, but having seen your earlier pic, I don't think a photo taken at any angle is going to help.

With 1 tpic6*595 per digit, you don't need to multiplex at all, but maybe in effect that is what your sketch is doing somehow. Its certainly one possible explanation for the fading issue you are seeing.

Paul

Here's my sketch in case someone wants to look at it.

I did a check with my multimeter and the more pins at set HIGH on the shift register, the less voltage I get. Is there something I need to add to my setup to tackle that. For the moment, it's the numitrons legs straight to the shift register. I going to try to illustrate it.

//Pin to clear the register
const int clearPin = 7;
//Pin connected to latch pin (ST_CP) of 74HC595
const int latchPin = 8;
//Pin connected to clock pin (SH_CP) of 74HC595
const int clockPin = 12;
////Pin connected to Data in (DS) of 74HC595
const int dataPin = 11;

/*
  Russian Datasheet
  0: 3,4,5,6,8,9
  1: 3,4
  2: 3,5,7,8,9
  3: 3,4,5,7,8
  4: 3,4,6,7
  5: 4,5,6,7,8
  6: 4,5,6,7,8,9
  7: 3,4,5
  8: 3,4,5,6,7,8,9
  9: 3,4,5,6,7,8
  <: 2
  */

//Numbers
const byte numbers[11][8] = {
  {1, 1, 0, 1, 1, 1, 1, 0},
  {0, 0, 0, 0, 0, 1, 1, 0},
  {1, 1, 1, 0, 1, 0, 1, 0},
  {0, 1, 1, 0, 1, 1, 1, 0},
  {0, 0, 1, 1, 0, 1, 1, 0},
  {0, 1, 1, 1, 1, 1, 0, 0},
  {1, 1, 1, 1, 1, 1, 0, 0},
  {0, 0, 0, 0, 1, 1, 1, 0},
  {1, 1, 1, 1, 1, 1, 1, 0},
  {0, 1, 1, 1, 1, 1, 1, 0},
  {0, 0, 0, 0, 0, 0, 0, 1},
};

void setup() {
  //set pins to output because they are addressed in the main loop
  pinMode(clearPin, OUTPUT);

  pinMode(latchPin, OUTPUT);
  digitalWrite(latchPin, LOW);
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);

  registerOff();

  Serial.begin(9600);

  // delay a little and then set
  delay(100);
  // Always start by sentting SRCLR high
  digitalWrite( clearPin, HIGH);



}

void loop() {

  /*
    //Counting (ignore the last one)
    for (int n = 0; n < 10; n++) {
      while (!wait(1000, false, " ")) {
        for (int i = 0; i < 8; i++) {
          if (numbers[n][i] == 1) registerWrite(i, HIGH);
          else registerWrite(i, LOW);
        }
      }
      //delay(100);
      wait(100, true, "Reset");//reset Wait timer.
    }

  */

  //Manual Test
  registerWrite(0, HIGH);
  registerWrite(1, HIGH);
  registerWrite(2, HIGH);



  /*
  //Goes through all filaments one by one);
  for (int i = 0; i < 8; i++) {
    registerWrite(i, HIGH);
    delay(1000);
    registerWrite(i, LOW);
  }
  */
}


// This method sends bits to the shift register:
void registerOff() {
  for (int i = 0; i < 8; i++) {
    registerWrite(i, LOW);
    delay(100);
  }
}

/*Not mine, from tutorial*/
void registerWrite(int whichPin, int whichState) {
  // the bits you want to send
  byte bitsToSend0 = 0;
  // write number as bits
  bitWrite(bitsToSend0, whichPin, whichState);

  // turn off the output so the pins don't light up
  // while you're shifting bits:
  digitalWrite(latchPin, LOW);

  // shift the bits out
  shiftOut(dataPin, clockPin, MSBFIRST, bitsToSend0);

  // turn on the output so the LEDs can light up:
  digitalWrite(latchPin, HIGH);
}

PaulRB:
Hand drawn will be fine, but having seen your earlier pic, I don't think a photo taken at any angle is going to help.

Haha, if you're referring to some old posts of mine on the forum I understand :slight_smile: I'm doing it Fritzing now.

Ok here's the image of the wiring. Couldn't find a TPIC6B595 in Fritzing so I used something with 20legs. Also no Numitron but I think it's clear. Also I'm testing on a old Deicimila before moving on to a Yun, just so I don't fry up the £60 Yun. But I don't that makes a difference.

Haaaaaa! It's the code!

this example works perfectly: Arduino Code | Arduino Lesson 4. Eight LEDs and a Shift Register | Adafruit Learning System

Now I need to figure out why as I really want to know.