3
\$\begingroup\$

Pictured here is a 4-digit 7-segment display: enter image description here Datasheet

I'm designing this to have a microcontroller controlling it through a shift register (2, actually). The shift register doesn't have much power output, I can only provide ~6mA per pin at 5V.

I've implemented transistors to control the common cathodes, which is rather simple as they can be placed in common-emitter configuration, simply allowing current through to ground without any more complexities.

The problem comes with the anodes. Not only isn't the shift register powerful enough to sink the cathodes, it can't source more than a couple anodes at once without going past its limits. This means I have to use transistors to control the anodes as well, but I'm not sure how, as I think I can only put them in common-collector configuration which everything I've read online says isn't a good way to make switches.

How can I control my anodes with transistors without drawing more than 6mA per segment?

\$\endgroup\$
9
  • 1
    \$\begingroup\$ Provide the value of your uC power supply (DIO voltages). Also, the datasheet for your shift register. \$\endgroup\$ Commented Jun 10 at 14:07
  • \$\begingroup\$ The microcontroller is not present in this circuit, other than that it tells the shift registers what to output. The power supply for the whole thing is 5V, current undecided as I'm not designing it until everything else is done. Shift register datasheet. Hopefully you'll agree with me that I haven't read it wrong, and that I only have 50mA to split between 8 outputs. \$\endgroup\$ Commented Jun 10 at 14:15
  • \$\begingroup\$ To confirm, the DIO voltage range, that is controlled by your uC, is 0 to 5V (and not say, 0-3.3VDC)? \$\endgroup\$ Commented Jun 10 at 14:42
  • \$\begingroup\$ Yes, my microcontroller can output 0 to 5V, logic lows and highs respectively, but the microcontroller isn't involved in this circuit. The shift register also outputs 0 to 5V, and I have a 5V supply available of abitrary current to put through the transistors. \$\endgroup\$ Commented Jun 10 at 14:45
  • 1
    \$\begingroup\$ Please realize that this type of display needs to be scanned, and if shift registers are driving the transistors and/or LEDs, you can easily have ghosting. You really should draw the relevant portion so we can critique it. \$\endgroup\$
    – Mattman944
    Commented Jun 10 at 15:40

3 Answers 3

8
\$\begingroup\$

You can use common-collector (emitter-follower) NPN transistors at each anode, but you'll only get a maximum of +4.3V or so at the emitter, when the base is held at +5V:

schematic

simulate this circuit – Schematic created using CircuitLab

Note that you do not need a base resistor for Q1.

Q1's emitter will always be 0.7V or so lower than the base, so A will have to be very close to 5V to have the expected +4.3V at the emitter. This is fine if you are using CMOS output logic (such as 74HCXXX ICs) to provide that signal, but it will perform poorly with TTL outputs (like 74LSXXX).

Base current (provided by the IO pins of your register ICs) will be tens or hundreds of microamps for Q1, and a little under 5mA for Q2.

The most common solution is to employ PNP transistors at each anode, in a common-emitter configuration:

schematic

simulate this circuit

Note that now you do need the base resistor for Q1.

This will allow the anode to reach very close to +5V, so I've increased R1 (current limit for the LED) commensurately. A will have to be low to illuminate the segment, unlike the previous design, which required A to be high.

Notice that Q2's base resistor is small, to produce sufficient base current for the transistor to light 8 or more segments simultaneously. Q1 is only ever driving a single LED (when multiplexing), so its base resistor can be significantly larger.

\$\endgroup\$
6
  • \$\begingroup\$ Here Q2 is representing the transistors on the common cathodes? Also, I don't need 5V for the display segments, only 2V, does this mean it's alright to use the NPN setup? \$\endgroup\$ Commented Jun 10 at 14:48
  • 1
    \$\begingroup\$ @SteamRanger Your mention of 2V doesn't make sense to me. All signals are either 0V or 5V, and unless you have some other way of producing 2V or 0V, then you'll use the usual current limiting resistor for each LED, and power the resistor+LED pair from a potential difference of 5V. \$\endgroup\$ Commented Jun 10 at 14:55
  • 1
    \$\begingroup\$ The LEDs need 2V forward voltage, so I need to drop the 5V to 2V. I'm mentioning 2V as you said the reason to use the PNP setup would be to get a voltage closer to 5V, which I don't need as I'm going to be dropping it anyway. Does the PNP setup draw more or less power from the base pins than the NPN setup? \$\endgroup\$ Commented Jun 10 at 15:25
  • 1
    \$\begingroup\$ @SteamRanger Drop to 2V is the job of R1. The transistors don't do that, they just switch on or off. The PNP setup will be slightly less efficient, drawing more current from the register IC outputs. Both designs will use less than 1mA Q1 base current. \$\endgroup\$ Commented Jun 10 at 15:31
  • 1
    \$\begingroup\$ @SteamRanger if you are worried about total IC current budget (50mA), you only have one digit on at a time, so base current for lower transistors is never more than 5mA, and even when all segments are lit, total upper transistor current is \$8\times1mA=8mA\$. Total pin current is 13mA or less at all times, even for the PNP solution. \$\endgroup\$ Commented Jun 10 at 15:44
5
\$\begingroup\$

If you don't need to use the decimal points you might consider using something like a CD4511B BCD to 7 Segment Latch/Decoder/Driver.

This is designed specifically to drive common cathode LED displays.

The input to it is Binary Coded Decimal which takes 4 bits, so you can use one 8 bit shift register for every 2 digits.

There is an example of using it with multiplexed digits in the datasheet.

\$\endgroup\$
0
\$\begingroup\$

I suggest you use a single ULN2003A to drive all 4 cathodes. You could also use 4x MOSFETs or 4x BJTs with base resistors.

The SR LED chemistry is quite efficient and you can probably get adequate brightness for your application simply driving the anodes directly from the shift registers through resistors. 6mA would give you an average 1.5mA per 'on' segment and a total Vdd draw of the SR of 48mA including the decimal points (this would also be the maximum total current draw of the display). In any case you need 8 resistors on the anode side (or 7 if you don't need the decimal points).

If you actually need more current than suggested above (sunlight readable or whatever) then you can drive the high side with either emitter followers as you suggest (plus 8 emitter resistors) or you could use PNP 'digital transistors' which include the base resistors inside (and, again, you need the 8 series resistors).

Using PNP transistors will give you a bit more voltage to work with, which is unnecessary with a 5V supply and SR LEDs but if you ever need to change to blue or white displays it will help. In the latter case, I would also eschew the ULN2003A and use SOT23 MOSFETs such as AO3400 for the low side (digit) drivers. Driving a blue or white display from a 3.3V supply would be the most challenging and you'd probably want MOSFETs on both sides.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ (a single ULN2003A to drive all 4 cathodes, possibly tying pairs of outputs&inputs in parallel) \$\endgroup\$
    – greybeard
    Commented Jun 10 at 17:01
  • \$\begingroup\$ @greybeard Could, though the ULN2003A has only 7 drivers so it would not be symmetrical. The 2803 has 8. \$\endgroup\$ Commented Jun 10 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.