Pages: [1] 2   Go Down
Author Topic: Multiplex Nixie Tube or similar  (Read 5743 times)
0 Members and 1 Guest are viewing this topic.
Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I am working on a nixie display and my first idea was about usin some 595 shift register with the nixie driver, the 74141 driver.
In this way for driving 6 tubes I need 3 595 and 6 74141 drivers.

I have seen some cool project where a single 74141 driver is used with a tlc5940 and multiplexing.

Now, I don't understand precisely how multiplexing works with arduino, I have done some really basic test with arduino alone (without IC's) and leds tryng to wire it correctly and switching in the loop section HIGH and LOW the ports, but I see the leds on and off, so I have no persistence of vision.

I suppose that I am lacking of knowledge... Could someone explain or point to any tutorial?
Thanks everyone,
Federico
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1658
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It really depends on HOW you are doing it... what does your code look like?
Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am doing it in the wrong way for sure smiley This code looks pretty stupid to me too but I have no clue on how to do it.
Code:
void loop() {
  if (i==1) {
   
    digitalWrite(9,HIGH);
    digitalWrite(11,LOW);
    led( ledPin, RGB(0,0,255) );
    i=0;
    }
  else {
   
    digitalWrite(11,HIGH);
    digitalWrite(9,LOW);
    led( ledPin, RGB(255,0,0) );
    i=1;
    }
  delay(3);
}

Basically I was testing with 2 rgb leds, connected with the 3 catodes R G B together to pwm's on arduino, and the two anodes on digital pin. "They" always say "switching fast enaugh" you get POV. But I imagine that it's not enaugh smiley smiley

Fede
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Los Angeles, CA
Offline Offline
Newbie
*
Karma: 1
Posts: 18
Cinematographer, Illustrator, Electronics Hobbyist
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

can you show me the led() function code?  or is that in a library?

Also, let my preface by saying I'm currently learning about multiplexing, myself.  Here's my code for a common anode 7-segment display I'm multiplexing using the arduino and one 595 shift register.  As a test, it just counts up in hundredths of a second.  I connected the anodes to digital pins 2, 3, 4, and 5 (digits 0, 1, 2, and 3 respectively).

Code:
long time;

//for communicating with the 595
int latchPin = 7;
int clockPin = 6;
int dataPin = 8;

int nums[] = {  //The numbers correspond to their indexes for ease of use
  B11000000,  //0
  B11111001,  //1
  B10100100,  //2
  B10110000,  //3
  B10011001,  //4
  B10010010,  //5
  B10000010,  //6
  B11111000,  //7
  B10000000,  //8
  B10011000 };  //9

void setup()
{
  //display digit anodes, [b]these will be doing the actual multiplexing[/b]
  pinMode(2, OUTPUT); //0th digit
  pinMode(3, OUTPUT); //1st digit
  pinMode(4, OUTPUT); //2nd digit
  pinMode(5, OUTPUT); //3rd digit
 
  //for communicating with the 595
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(latchPin, OUTPUT);
 
  //start with all the digits off
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  digitalWrite(4, LOW);
  digitalWrite(5, LOW);
 
  //zeroing out the counter for the timer
  time = millis();
 
}

void loop()
{
  //how much time has passed?
  long temp = millis() - time;
 
  //display the time in hundredths of a second (passed to the display function)
  display( temp / 10 );
}

void display( long num )
{
  num = num%10000; //prevents numbers larger than 4 digits
  burst( num/1000, 0 );  //gets the 0th digit, passed to burst function, 0th place
  burst( (num/100)%10, 1 ); //gets the 1st digit, passed to burst function, 1st place
  burst( (num/10)%10, 2 );//gets the 2nd digit, passed to burst function, 2nd place
  burst( num%10, 3 );//gets the 3rd digit, passed to burst function, 3rd place
}

void burst( int num, int place ) {
  boolean dot = false; //display a dot
  if( place == 1 ) {
    dot = true; //there will be a dot in the 1st position (I could do this in a less lazy way I'm sure)
  }
 
  //send the digit to the 595
  digitalWrite(latchPin, 0);
  int temp = nums[num];
  if( dot ) {
    temp = temp ^ B10000000;  //uses XOR to add the dot to the binary to be sent to the 595
  }
  shiftOut(dataPin, clockPin, MSBFIRST, temp);
  digitalWrite(latchPin, 1);


  digitalWrite(place + 2, HIGH);  //turns on the digit (again, lazy: 0th digit is digital pin 2)
  delay(4); //digit stays on for 4ms
  digitalWrite(place + 2, LOW);  //turns of the digit
}

I hope my annotation helps explain the process.  Basically each digit is turned on and off in order, and all the digits can share the same 595 shift register.
Logged

Wigan, UK
Offline Offline
God Member
*****
Karma: 19
Posts: 814
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

While we're on the subject of nixies...

What's the input voltage of the 74141 (the Vcc pin)?
Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have not tested the 74141 but the Vcc is 5v.
Btw, I have just lighted my first nixie. Too cool!

Unfortunatly I don't have a couple 7-seg display for testing your code but I am going to read it now and test it in some way...
I was doing basical test with the 595 so i suppose I am going to redo it all :-)



This was the first test to drive the 74141, and it's my backup option if I dont' get how to multiplex smiley-kitty

ps:
By the way, this is the whole code abot rgb leds, but it's not so useful for the nixies but it's useful for the rgb's smiley
Code:
/*
 * Set RGB Led Color
 * Use only pwm pins and common anode rgb leds
 */

int ledPin[] = {3,5,6};
int i=0;

void setup() {
  for (int i=0; i<3; i++){
    pinMode(ledPin[i], OUTPUT);
  }
}

short * RGB(short r,short g, short b){
  //short tmp[3];
  short *tmp=(short *)malloc(sizeof(short)*3);
  tmp[0]=abs(255-r);
  tmp[1]=abs(255-g);
  tmp[2]=abs(255-b);
  return tmp;
}

void led(int *pin,short *color) {
  for(int i=0;i<3;i++) {
    analogWrite(pin[i],color[i]);
  }
}

void loop() {
  if (i==1) {
   
    digitalWrite(9,HIGH);
    digitalWrite(11,LOW);
    led( ledPin, RGB(0,0,255) );
    i=0;
    }
  else {
   
    digitalWrite(11,HIGH);
    digitalWrite(9,LOW);
    led( ledPin, RGB(255,0,0) );
    i=1;
    }
  delay(3);
}
« Last Edit: January 26, 2011, 04:28:36 pm by Federico » Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Los Angeles, CA
Offline Offline
Newbie
*
Karma: 1
Posts: 18
Cinematographer, Illustrator, Electronics Hobbyist
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This may be a cleaner way to code your loop / led methods.

Code:
int onTime = 3;

void led(int *pin,short *color, int anode) {
  for(int i=0;i<3;i++) {
    analogWrite(pin[i],color[i]);
  }
  digitalWrite(anode, HIGH);
  delay(onTime);
  digitalWrite(anode, LOW);
}

void loop() {
  led( ledPin, RGB(0,0,255), 9 );
  led( ledPin, RGB(255,0,0), 11 );
}
« Last Edit: January 26, 2011, 09:34:47 pm by pmodernme » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34547
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure what you are trying to do but that code will flash alternate LEDs on and off. If you are sing the analogWrite function then you are using the PWM signals and these do not mix well with multiplexing due to the beats between the two frequencies.
Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As I suspected. My final goal is to multiplex the Nixies, I have seen that someone is able to do this:

http://www.elektronika.ba/786/warm-tube-clock-v1-nixie-clock/

I suppose that it is the same as multiplexing a 7-digit display (except the voltage, but this is not going to be a problem)
But, as I don't have 7-digit to try (and I don't want to get shoked while experimentig with the nixies) I thought that rgb leds were similar...

I'd like to wire toghetes all the "digits cables" and swithc the anodes with a tlc5940. The thing that I don't get is how to do this... I am studying right now the code posted by pmodernme
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34547
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
'd like to wire toghetes all the "digits cables" and swithc the anodes with a tlc5940. The thing that I don't get is how to do this
Simple, just connect the common anode to 5V and each of the three cathodes to a separate TLC5940 output.
Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
'd like to wire toghetes all the "digits cables" and swithc the anodes with a tlc5940. The thing that I don't get is how to do this
Simple, just connect the common anode to 5V and each of the three cathodes to a separate TLC5940 output.

I knew this, it's mostly a software problem the one I have (plus the language problem! sometimes it's hard for me to explain clearly  smiley-cry ) Thanks to yours advice I am starting to understand and tomorrow I am going to create a new test hardware and a new code to multiplex/pov with the 595, then I will switch to the tlc5940 wich is my optimal choice (but for now I know just how to use the 595 :-) )

I can't still try this with nixies because I still don't have optocouplers or transistors to work at 180v.
Fede
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1658
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm: I don't see why you need opto couplers.  The 74141 can directly drive NIXIE pins.  The 74141 (based on the original 7441 that was designed specifically for NIXIES)  has open collector, zener protected outputs.
Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I was planning to drive the anode of the nixies with the tcl5940, so I can do a bit of PWM to set "brightness" or create visual effect while wiring the cathodes to the 74141 so I can specify the cipher to light on. With this setup I think I need not to put high voltages on my 5940.
Am I wrong?
Thanks, Fede
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

0
Offline Offline
Full Member
***
Karma: 6
Posts: 200
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I find that processing+wiring is much too slow for multiplexing (commands like shiftout take way too long), but using some AVR-C I have been able to multiplex nixie tubes (or at least some neon tubes while I wait for my nixies to arrive) as well as vary the brightness to do fading effects.
Picture here.
What you are seeing is two separate groups of four neons. Tube 1x4 is at about 10% brightness, tube 1x3 is at about 70%, and tube 1x2 and 1x1 are at 0%. Tube 2x4 and 2x3 are at zero percent while tube 2x2 is at 70% and tube 2x1 is at 10%. These tubes are driven off of four cathodes and two anodes.

I'll probably post schematics and code on that site this weekend, once I have some more time, but basically, I just compute the values to send to the shift registers BEFORE my multiplex loop, then shift out the first set of data really fast, turn on the first tubes, turn them off, shift out the second set of data really fast, turn on the tubes, and turn them off a few hundred times. Of course, there are some delay routines involved as well to get variable brightness and ensure the transistors work properly.
« Last Edit: January 28, 2011, 12:47:32 am by wyager » Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That sounds interesting! Are you experimenting directly via arduino or with some IC? Can I ask you what type of transisrors are those? I have similar neon bulbs but I don't know wich transistor should I use...
Thanks!
Fede
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

Pages: [1] 2   Go Up
Jump to: