Tuesday, 1 July 2014

IV-9 Clock - Prototyping!

IV-9 tubes are vintage Russian tubes which were a precursor to 7 segment LED displays. They are now sold on the internet along with other display tubes mostly for hobby applications. Most people are turning them into clocks, which I will also be doing - but I'm going to take it up a notch, and hopefully add a radio too!


Each of these tubes have 9 pins on them. 7 are for the segments, one is for a decimal place and the final pin is a common pin. I've decided to build my own hardware and to use a microcontroller to multiplex the tubes, or in other words, only one tube will be on at a time, and a different number pattern will be sent on the same data lines while a certain tube is selected. I did some research on this, and many people simplified (not necessarily a bad thing) their projects by using chips meant for driving LED 7 segment displays or using chips meant for building clocks.

Before I solder anything or get too far ahead of myself, I wanted to trouble shoot and sort out issues on a solderless bread board. I only put two tubes on, as these things take up a lot of space and use a lot of components. I'm also using an Arduino to speed up the prototyping. The final clock will hopefully be using a PIC18.


On this prototype all the inputs drive transistors, so the only component between the Arduino and the transistor base is a current limiting resistor. I'm using 2N3906 transistors for driving the characters, and 2N3904 on the tube selection (common pins on the tube).

I used 10K resistors on the base of the 2N3906's - they're only about 20mA's per segment.
I used 1K resistors on the base of the 2N3904's as the common pin on the tubes can possibly be handling each segments plus a decimal or roughly 160+mA.

The sad news is that I originally had segments from one tube bleeding into the same segment on the other tube, so I ended up installing diodes on each pin for each segment on each tube. 8 diodes a tube, I am not looking forward to soldering this board. It also drops the voltage down a bit, 5V-0.7V=4.3V, which is fine, the data sheet says a max of 4.5V anyway.

I would like to post a schematic, but I will need some serious time to figure out how to lay it out, things got pretty busy fairly quickly!


My 6 tube board will have the following materials:
6     IV-9 tubes
8     2N3906 Transistors
6     2N3904 Transistors
48   1N4007 Diodes
8     10K resistors
6     1K resistors

These parts were selected because I already had them, a lot of different variations could be used.


This code sample doesn't really have anything to do with what I'll have as a final product, I just used it for testing, but hopefully it will be of use to someone. Also - I was playing around with this, and stuffed some junk code in to simulate another 4 tubes being put in, and I had some stuttering issues, so I ended up completely removing the delays. I'm curious to see how changing the clock speed on my PIC18 will impact the tube intensity, which I have started porting this code over to it. Another concern I have is that when I have I2C devices attached, will they cause enough delay to stutter the tubes? I guess I'll find out!

/*
TEST SOFTWARE FOR 2 MULTIPLEXED IV-9 TUBES - REVISED
THIS IS TEST SOFTWARE AND WAS WRITTEN QUICKLY WITHOUT THE INTENT OF EXPANDING ON IT LATER,
IT IS NOT INTENDED AS A FINE CODING EXAMPLE.

JARRET CHESSELL
JULY 2nd 2014
http://awesomejarret.blogspot.ca/

OBJECTIVE IS TO TEST HARDWARE TO ENSURE OPERATION AND DEBUG HARDWARE
8 PNP 2N3906 TRANSISTORS ON CHARACTER BUS (ACTIVE LOW)
2 NPN 2N3904 TRANSISTORS ON TUBE SELECT BUS (ACTIVE HIGH)

*********************************************************************
DESCRIPTION:
WILL COUNT FROM 0-99 ON TWO IV-9 TUBES AT APPROX 1 SEC INTERVALS
COUNTER WILL ROLL OVER ONCE IT REACHES THE END.
BASICALLY A SUPER COMPLEX EGG TIMER
*********************************************************************

*/

//initialize an array which holds the patterns for numbers 0-9
byte numberPattern[] = {0x84, 0x9F, 0xA8, 0x89, 0x93, 0xC1, 0xC0, 0x8F, 0x80, 0x83, 0xFF};

//initialize counters to 0 with global scope
byte tensCounter = 0;//counts up for tube one
byte onesCounter = 0;//counts up for tube two
unsigned int loopCounter = 0; //delay counter

void setup() {
  //only thing done here is setting first ten pins to output and turning everything off
  PORTD = 0xFF; //PORTD is active low character bus -8bit
  PORTB = PORTB & 0xFC; //we're only manipulating the 2 lsb's, others are left unchanged
  for (byte i = 0; i < 10; i++){
    pinMode(i, 1);
  }
}

void loop() {
    if (loopCounter >= 500){ //chose 500, as each tube gets a 1ms delay, so should increment ~1sec
    loopCounter = 0;
    onesCounter++;
  }

  if (onesCounter >= 10) {
    onesCounter = 0;
    tensCounter++;
  }

  if (tensCounter >= 10) tensCounter = 0;

  PORTB = PORTB & 0xFC; //common pins off on both tubes
 
  PORTD = numberPattern[tensCounter]; //insert desired pattern and assign it to port
  PORTB = PORTB | 0x01; //"tens" tube common pin turned back on
  delay(1);
 
  PORTB = PORTB & 0xFC; // common pins off on both tubes
 
  PORTD = numberPattern[onesCounter];//insert desired pattern and assign it to port 
  PORTB = PORTB | 0x02; //"ones" tube common pin turned back on
  delay(1);
  loopCounter++;
}


In the YouTube video at the top I also gave mention to a website that I've ordered stuff from in the past, and many of the components I used I purchased from them. YourDuino.com I've used them more than once, and it's a cost effective away to bulk up your parts for prototyping!

1 comment:

  1. Casino - DrmCD
    Discover 거제 출장마사지 over 500 Vegas-style slot machines, including classic 이천 출장마사지 Texas hold'em machines, 속초 출장안마 along with 세종특별자치 출장샵 the latest slot machines and video poker machines 영천 출장마사지 from the best  Rating: 4 · ‎2 reviews

    ReplyDelete