TPIC6B595 to drive 12V Seven Segment

Hi All

This is my second post after I went back to the drawing board. I was originally using 74HC595 with ULN2003 to drive a 12V seven segment display.

CrossRoads suggested that I use TPIC6B595 as it can handle higher load.

I am attaching the schematic diagram of the circuit I am using. Also below is the code I am using to count 0 to 9.

////Pin connect to Latch
const int latchPin = 5;
////Pin connected to Clock
const int clockPin = 6;
////Pin connected to Data
const int dataPin = 7;

//This is the hex value of each number stored in an array by index num
byte digitOne[10]= {
B11111001, //1
B10100100, //2
B10110000, //3
B10011001, //4
B10010010, //5
B10000010, //6
B11111000, //7
B10000000, //8
B10010000, //9
B11000000  //0
};

int i;

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

}

void loop() {
 for(int i=0; i<10; i++){
      digitalWrite(latchPin, LOW);
      shiftOut(dataPin, clockPin, MSBFIRST, ~digitOne[i]); // digitOne
      digitalWrite(latchPin, HIGH);
      delay(1000);
    }
}

I have tested this circuit with a small 0.5 inch seven segment display with appropriate resistors using 5V from Arduino. It worked perfectly.

However, when I tried to use the circuit with the large seven segment running on 12V I have encountered some problems. When the Arduino is loaded with the above code and powered along with the 12V going to the seven segment, the segments instead of lighting up just flickers quickly.

The strange thing is that when I hold the joints on the Vcc and GND wires going to seven segment and TPIC6B595 respectively the segments light up perfectly. But as soon as I let go of the joints the segments start flickering again.

All joints are properly soldered.

Specifications of the the power supply I am using are 12V 6A.

I have been googling and reading anything I could find on TPIC6B595 for the last few days and have come across this website:

They are selling exactly what I need but unfortunately they do not ship outside Romania. I am attaching the picture of their board. The reason I am attaching this is because Robotfun people have used a couple of diodes. I have tried emailing them to ask why have they used diodes and what are their values. I am still awaiting a reply. Could lack of these diodes in my schematic be the cause of my seven segment flickering or am I just being thick and missing something obvious.

Regards
T

You have 8 LEDs. Do they have Vforward of less than 1.5V? 8 x 1.5 = 12.
Usually with a 12V source, the most you can use is 4 or 5.
I would also strongy suggest a 0.1uF cap from pin 2, Vcc, to Gnd. Look like caps on their board (marked 103 =100nF caps), not diodes

This inverts the data going out?
~digitOne
as 1 into the shift register turns on the output.

Hi CrossRoads

Thanks for the reply.

I got the schematic for my segments wrong in the last post. I am attaching the revised schematic with this post.

Each segment in the seven segment has 4 LEDs connected in series with 220 ohm resistor. Four rows of 4 LEDs in parallel make up one segment. Hence each segment has 16 LEDs.

I have started putting together the schematic again with 0.1uF capacitor. Will post later once I have had a chance to test it.

I am not sure what is the purpose of ~ in the digitOne part of the code. I copied this code from an article on instructables so I am not sure what is the purpose of ~. I did however find out by hit and trial that the shift register output is up with a 0 and down with a 1.

Regards
T

That should work with the cap added. You have a lot of current being switched, adding a 1uF across pin 2 & gnd will help also.
If the ~ does not invert the bits, then you just need to flip them over in your font definitions.

B11111001, //1 >> B00000110 // 1 turns on B,C segments

Hi CrossRoads

Thanks for your reply.

I have drawn up the schematic with capacitors. I have added two 100nf capacitors between pins 2/8 and between pins 9/10. I have tried to replicate the circuit from the Robotfun image I attached with my earlier post.

I have put together a circuit with capacitors and tested it but its not working. I know what you said earlier about adding a 100nf cap between pin2 and GND. But I am a little confused as GND is going to 12V where pin2 is attached to 5V from Arduino.

The pin 2 connects to +5V, pin 8, and one end of the cap. The the end connects to Gnd.

G/ should just be connected to Ground. No cap there.

You need the 12V Gnd connected to the Arduino Gnd. I didn't realize you hadn't done that.

Hi CrossRoads

Thanks a lot for all your help. The circuit is finally working :). You are a legend.

I am attaching the final working version for anyone else's reference.

Just wondering if you can help point me in the right direction for the next bit that I want to do with my seven segment display. Basically my display is a clock module with four seven segment displays. I have figured out the code for countdown timer. But I ultimately want to control the clock using a networking shield attached to a wireless router. Could you possibly point in the direction of some good tutorials that can get me up to speed with this.

Regards
T

1 Like

Glad to see you have it working.

I'll have to pass on the networking part, I have not done any networking with Arduino yet.

1 Like