Pages: [1]   Go Down
Author Topic: TPIC6B595 to drive 12V Seven Segment  (Read 1663 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Code:
////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:
http://www.robofun.ro/electronice/led/driver-8led-tpic

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


* TPIC6B595_schematic.png (189.74 KB, 2148x1242 - viewed 110 times.)

* Robotfun.ro design.png (350.34 KB, 808x342 - viewed 40 times.)
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 1
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* TPIC6B595 schematic.png (143.57 KB, 846x1343 - viewed 67 times.)
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 1
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* TPIC6B595 schematic with cap.png (203.39 KB, 1079x1719 - viewed 42 times.)
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 1
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi CrossRoads

Thanks a lot for all your help. The circuit is finally working  smiley. 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


* TPIC6B595 schematic with cap revised.png (204.47 KB, 1110x1752 - viewed 99 times.)
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: