Seven segment displays control

Discussion in 'General Electronics Chat' started by adrian.dmc, Feb 23, 2009.

  1. adrian.dmc

    Thread Starter Active Member

    Feb 22, 2007
    52
    0
    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...
     
  2. davebee

    Well-Known Member

    Oct 22, 2008
    539
    46
    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.
     
  3. davebee

    Well-Known Member

    Oct 22, 2008
    539
    46
    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.
     
  4. adrian.dmc

    Thread Starter Active Member

    Feb 22, 2007
    52
    0
    You can... Great... Thx in advance...

    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...
     
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  6. adrian.dmc

    Thread Starter Active Member

    Feb 22, 2007
    52
    0
    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...
     
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  9. adrian.dmc

    Thread Starter Active Member

    Feb 22, 2007
    52
    0
    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...

    Really appreciate the effort ;) but that way I'm limited to the 4543 specification and I want to fully control all the displays...

    Greetings...
     
  10. adrian.dmc

    Thread Starter Active Member

    Feb 22, 2007
    52
    0
    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...
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.

    What attachment?

    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)
     
  12. adrian.dmc

    Thread Starter Active Member

    Feb 22, 2007
    52
    0
    My mistake...
    Here for correction...
     
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    That should work.

    You can use a Darlington if you wish. Your Vce(sat) will be higher than if you used a single bjt.
     
  14. adrian.dmc

    Thread Starter Active Member

    Feb 22, 2007
    52
    0
    That's what I'll do. I choose a 470 Ohm resistor for the transistors and 330 Ohm resistors for the LEDs.
     
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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: Feb 26, 2009
  16. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
    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.
     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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: Feb 26, 2009
Loading...