Seven segment displays control

Thread Starter

adrian.dmc

Joined Feb 22, 2007
53
Hi...

I'm building a small project in which I want to fully and independently control two seven segment display using a minimum number of pins. First I've planned to use two 8-bit shift registers, "inline" forming a 16-bit shift register, and directly connected to the displays. In order to reduce the number of ICs I though in using only one 8-bit shift register and some kind of multiplexing to control one display at a time. Multiplexing is done by connecting the common pin of each display to one of the I/O pins so that only one display is working at a time.

My first question is: a transistor is needed when connecting the common pin to the I/O port? Or because the current is furnished by the shift register it isn't needed anymore?

If I used only one I/O pin for both displays (plus a inverter) when data is being put in the shift register will a glitch appear in the appearance of the display?

Thx in advance...
 

davebee

Joined Oct 22, 2008
540
I would think that the only consideration for whether to use a transistor would be how much current your controller can provide. If it can drive all seven segments bright enough then no need for a transistor. But to get good brightness when all segments are on, my guess is that you will need a transistor (or a transistor array, like the UNL2803).

I don't think you'd see any glitch if your controller is fast enough, but I'm not sure.

But I can test this if you want -

I have a similar circuit already built on a breadboard at home that's running six digits as a fast pulse capture counter.

My program currently does turn off all segments when it's shifting the segment bits, but I can tweak the program to make it leave the previous segment on during the shift and see if it makes the display look bad.
 

Attachments

davebee

Joined Oct 22, 2008
540
Update - I tried shifting the segment bits into place in my circuit while the target digit was turned on.

It worked terrible - every segment lighted up and made it completely unuseable.

So at least for my circuit, the digits need to be off while shifting the bits.
 

Thread Starter

adrian.dmc

Joined Feb 22, 2007
53
But I can test this if you want -

I have a similar circuit already built on a breadboard at home that's running six digits as a fast pulse capture counter.

My program currently does turn off all segments when it's shifting the segment bits, but I can tweak the program to make it leave the previous segment on during the shift and see if it makes the display look bad.
You can... Great... Thx in advance...

Update - I tried shifting the segment bits into place in my circuit while the target digit was turned on.

It worked terrible - every segment lighted up and made it completely unuseable.

So at least for my circuit, the digits need to be off while shifting the bits.
Thank you very much... Unfortunately, as you say, it doesn't work very good...

So I'll really have to use two, instead of one, I/O pins for multiplexing the display.

About the use or not of a transistor: I came to the conclusion that a transistor is really necessary because the current (lot's of it coming from the display) entering the I/O pin must cause something. You say to use a transistor array... Isn't a transistor alone, connected to the common pin, enough?

EDIT: Cool board by the way...

Greetings...
 

SgtWookie

Joined Jul 17, 2007
22,230
Check to see if your 7-segment displays are common anode or common cathode.

Common anode displays are (IMHO) a bit easier to work with; you can sink current from the cathodes via current-limiting resistors using transistor arrays like the ULN2803s as Davebee mentioned.

Common cathode displays are more of a pain in the neck, as you have to source current to the anodes. You can get source type Darlington arrays, but they are more expensive and scarce than ULN2803's and the like.

Don't forget that each segment needs it's own current limiting resistor.
 

Thread Starter

adrian.dmc

Joined Feb 22, 2007
53
Check to see if your 7-segment displays are common anode or common cathode.

Common anode displays are (IMHO) a bit easier to work with; you can sink current from the cathodes via current-limiting resistors using transistor arrays like the ULN2803s as Davebee mentioned.

Common cathode displays are more of a pain in the neck, as you have to source current to the anodes. You can get source type Darlington arrays, but they are more expensive and scarce than ULN2803's and the like.

Don't forget that each segment needs it's own current limiting resistor.
But that way I'll have to use one more IC which is not what I want... Isn't a single mosfet/BJT transistor, working as a analog switch, enough?

Thx in advance...
 

SgtWookie

Joined Jul 17, 2007
22,230
But that way I'll have to use one more IC which is not what I want... Isn't a single mosfet/BJT transistor, working as a analog switch, enough?
Look at the specifications for the particular shift registers you're considering using. Don't rely on the "absolute maximum" specifications; look at "typical" for output sink current.

Yes, you could use discrete MOSFET/bjt's, but why go to that much trouble? ULN2803's have eight Darlington pairs (ULN2003's have seven) with input base resistors already integrated. I'd rather deal with a single output interface IC than seven discrete MOSFETs/bjt's and associated resistors.
 

SgtWookie

Joined Jul 17, 2007
22,230
Slight change of tactics... actually, a variation on a theme. ;)

Have a look at the attached; it's using a CMOS 4000-series 4543 BCD to LED/LCD driver. The 4553 is a 3-digit BCD counter and multiplexer. Q1 through Q3 source current to the 7-segment LED displays. You could use just six bits from your uC to control two 7-segment digits.
 

Attachments

Thread Starter

adrian.dmc

Joined Feb 22, 2007
53
Look at the specifications for the particular shift registers you're considering using. Don't rely on the "absolute maximum" specifications; look at "typical" for output sink current.

Yes, you could use discrete MOSFET/bjt's, but why go to that much trouble? ULN2803's have eight Darlington pairs (ULN2003's have seven) with input base resistors already integrated. I'd rather deal with a single output interface IC than seven discrete MOSFETs/bjt's and associated resistors.
There's some confusion in here... :confused: When I speak of using only one one transistor is using EXACTLY one transistor per display (not per LED), connected of course to the common pin of the display. I already tested this using a BD675 (the only reasonable transistor available) and a common cathode display and it worked perfectly. For the real thing I'll use a common anode display and a BC516. Is it a right choice? I don't know if this subject is worth to start a new thread but where do we should look for a component with our desired specifications? I usually go to the farnell.com and from their component listings I try to choose the best I can find but I always get that felling that tells me there's a better option than the one I just found...

Slight change of tactics... actually, a variation on a theme. ;)

Have a look at the attached; it's using a CMOS 4000-series 4543 BCD to LED/LCD driver. The 4553 is a 3-digit BCD counter and multiplexer. Q1 through Q3 source current to the 7-segment LED displays. You could use just six bits from your uC to control two 7-segment digits.
Really appreciate the effort ;) but that way I'm limited to the 4543 specification and I want to fully control all the displays...

Greetings...
 

Thread Starter

adrian.dmc

Joined Feb 22, 2007
53
The circuit will be something like whats in the attachment.

DxEN are the enable signals for the two displays.
SGx is the output of the 8-bit shift register.

If everything is correct there will be needed 4 I/O pins (D0EN, D1EN, CLK and DAT) to control both of the display.

The transistors will be saturated when ON so what's the voltage in the collector when it is ON? Do we consider the VceSat or VbeMax? (Consider that DxEN is 5V signal when ON.)

Thx in advance...
 

SgtWookie

Joined Jul 17, 2007
22,230
Why not consider PN2907's?
http://uk.farnell.com/on-semiconductor/pn2907ag/bipolar-transistor/dp/1653632
They're not Darlingtons, but you'll get away from the relatively high VceSAT of Darlingtons. Besides, PN2907's can source a good bit more than your displays will need, and they're dirt cheap compared to what you were considering.

The circuit will be something like whats in the attachment.
What attachment?

DxEN are the enable signals for the two displays.
SGx is the output of the 8-bit shift register.

If everything is correct there will be needed 4 I/O pins (D0EN, D1EN, CLK and DAT) to control both of the display.

The transistors will be saturated when ON so what's the voltage in the collector when it is ON? Do we consider the VceSat or VbeMax? (Consider that DxEN is 5V signal when ON.)
You use a current limiting resistor between your logic output and the transistor's base; 470 Ohms to 1k Ohms. If you used 470 Ohms, your Ib would be around 10mA and the transistor would be close to saturation (low Vce)
 

SgtWookie

Joined Jul 17, 2007
22,230
If your Vce is 0.4v with a Vcc of 5v, a 330 Ohm resistor will allow 13.9mA to flow from the collector to ground - without any LED.
(5-0.4)/330 = 4.6/330 = 13.9mA (approx).

You need to determine what the voltage @ current rating is for your 7-segment displays, and figure that into the equation. You also need to determine what the V(OL) of the 74xx164 IC will be when sinking the current required for the LEDs.

For example, if the LEDs are rated 1.7v @ 15mA, and Vce of the transistor is 0.3v and V(OL) of the '164 is 0.5v@15mA (it'll likely be higher), then:
(5v-(0.3+1.7+0.5))/15mA = (5v-2.5v)/15mA = 2.5v/0.015A = 167 Ohms (approx).
 
Last edited:

russ_hensel

Joined Jan 11, 2009
825
the ULN2003 is nice as a low side switch. Think is about 50 cents, has 8 in and out. Does not need a current limiting resistor on the base. Good to 1/2 amp.
 

SgtWookie

Joined Jul 17, 2007
22,230
If his shift registers are capable of sinking the current necessary, he won't require ULN2003's/ULN2803's. He will need to examine the datasheet of the particular 74xx164's under consideration to determine if they are capable.

ULN2003's have seven Darlington pairs.
ULN2803's have eight Darlington pairs.
 
Last edited:
Top