1
\$\begingroup\$

I want to light some LEDs (from 1 to 5 at the same time) using a shift register. I read that the shift register is supposed to output 6mA per pin: ±6-mA output drive at 5 V, which seems a bit low so I figured I could use transistors like described below. I'm a bit confused though:

  • Are the transistors actually required or could I send the shift register output directly to the LED ?
  • What if I connect the shift register output directly to the LED (with or without a resistor) ? Will the current be safely limited to 6mA, or is it going to raise and damage the chip ?
  • I'll use the shift-register to multiplex with other outputs, which means the leds won't be turned on continuously. Does that change anything to the maximum current I can send in the LEDs/shift register ?

[edit]: the LED should be moved to the collector-side, as mentioned by @vir.

Option A: with transistors

with bjts

Option B: The more basic approach:

enter image description here

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You pretty much have to use a transistor if you also want to use the chip output to drive other logic. \$\endgroup\$
    – Dave Tweed
    Commented Jan 9 at 22:57
  • 1
    \$\begingroup\$ the LED should be on the collector of the transistor \$\endgroup\$
    – jsotola
    Commented Jan 10 at 0:18

5 Answers 5

1
\$\begingroup\$

The use of a transistor may be required, be desirable, be optional or be superfluous depending on how much peak current you need to pass through the LEDs.

Driven continuously, a few mA is often plenty for an indicator. If you are multiplexing LEDs and they are on 1/n of the time you need roughly n times as much peak current to get similar visual brightness to the brightness with continuous drive.

If you are driving directly, it's often better (in terms of voltage drop in the output under load) to sink current than source it as you've shown when dealing with CMOS outputs. So low = 'on'.

A series resistor (with or without a transistor) is required in order to get a predictable and reasonable current from the output and through the LED.

Exceeding the maximum current from the chip may cause short term damage or long term reduction in reliability. There is also an absolute maximum total current for GND or Vcc (70mA in the TI datasheet) which also should be respected (in that your circuit should pass nowhere near that much current, less if temperature is elevated or if you want really good reliability). If you limit yourself to 40mA that's 5mA per output if they can all be sinking or sourcing at once.

\$\endgroup\$
6
  • \$\begingroup\$ I just read the TI data sheet for SN74HC595 and the maximum supply pin limits are 70mA, not 50mA. \$\endgroup\$
    – Justme
    Commented Jan 9 at 23:17
  • \$\begingroup\$ @Justme See 6.1 Absolute maximum ratings where ±50mA is specified. Of course there may be other datasheets. \$\endgroup\$ Commented Jan 9 at 23:50
  • \$\begingroup\$ The version I linked says +/- 70mA, here: ti.com/lit/ds/symlink/… \$\endgroup\$ Commented Jan 9 at 23:53
  • 1
    \$\begingroup\$ @SpehroPefhany OK, difference is you are reading SN74HC165 data sheet and I was reading the SN74HC595 data sheet as it was in OP's schematics. So obviously different chips have different properties; likely depends on manufacturer too. Like you said, it makes more sense anyway to stay away from abs max ratings. \$\endgroup\$
    – Justme
    Commented Jan 10 at 0:23
  • 1
    \$\begingroup\$ @Justme Ah, makes sense, thanks. I see Onsemi has one with 75mA rating, which is similar enough to 70mA. \$\endgroup\$ Commented Jan 10 at 1:58
1
\$\begingroup\$

This depends on the LED and how strongly you want to drive it. 5mA should be fine for a small LED as an indicator; the first circuit will work for higher currents if you move the LED to the collector end of the transistor. There are also dedicated LED drivers that incorporate a shift register and current sink; they will probably be able to cascade with a general purpose shift register.

\$\endgroup\$
1
  • \$\begingroup\$ Oh, of course I should move the led to the upper side, thanks. Also, my leds will be arcade buttons for a game, so I'd like them to be quite bright (without destroying everything, obviously) \$\endgroup\$
    – aherve
    Commented Jan 9 at 22:44
1
\$\begingroup\$

So you are using the 74HC595.

It does boast "6mA drive at 5V", but it does not mean you get 5V output at 6mA.

It means, at 5V supply, the outputs are rated to provide 6mA while fulfilling some specific voltage specs, listed in the data sheet, which could be at least 3.84V when sourcing 6mA current, and 0.33V while sinking 6mA current.

So the outputs are not ideal but have some output impedance which depends on if the output is sinking or sourcing current.

And since the specs are rather arbitrary, you can use more current if you don't need the given voltage levels.

For example TI data sheet says recommended conditions are not to exceed 35mA per pin, but also not to exceed total of 70mA per part. For reference, these are also the "Absolute Maximum Ratings" so it is weird that the datasheet basically says the recommended conditions but also to do anything you like but don't exceed max ratings, as usually there is an area between recommended and maximum ratings that the chip does not damage but also is not required to operate properly or within specs.

Which sort of means if you really want to drive only one or two LEDs at a time from each chip, you could drive 1 or 2 of them at 35mA.

But if you need to drive 8 LEDs simultaneously, you cannot exceed 8.75mA per LED.

So if you are happy under these limitations and you can light up the given LED amount you want brightly enough then you don't need transistors.

If not, then you need transistors.

You can drive directly but you need resistors to limit the current to safe levels. You cannot leave out resistors or too much current will flow.

Multiplexing may affect your consumption, but the point is not to even momentarily exceed the per-pin and per-chip limits. As I mentioned, depending on how exactly you do the multiplexing, in theory you can drive up to 2 LEDs per shift register with up to 35mA per LED.

But in practice, it makes sense to be well within these limits.

If you feel say 6 to 8 mA per LED is not bright enough, consider more efficient and brighter LEDs. For example I have needed much less than 5mA and the LEDs on PCB are still too bright to look at.

For multiplexing, there are many factors. The multiplexing ratio or duty cycle (e.g. each LED is on only 1/8th of the time) will define the average current, the peak current being high means brighter light pulses at the multiplexing frequency, so a multiplexed display, given a suitable multiplexing frequency and ratio, can even appear brighter than a non-multiplexed display with same average current.

The LED data sheet will tell safe average current and safe peak current given a duty cycle and frequency or on-time and off-time.

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

With a 6mA spec at 5V, this implies that the output Rds(on) for high-drive is 125 ohms or less for Voh = 4V / Vdd=4.5V. Considering you also have a series resistor per LED, you will not likely burn the chip even if you are driving a bit above that level. We'll get into that below.

Where you will get into trouble is if you exceed the 'HC595 total package limit of 70mA (8.75mA/pin x 8), either to Vdd or to GND. This will certainly be the case if you don't have resistors. As it is, 220 ohms is marginal - you're likely to exceed the package limit if you use red (Vf 1.8V) LEDs.

How to estimate the resistor then? We compute the target current based on Vf:

  • R(led) = (Vdd-Vf)/I(led) - Rds(on)

For a red LED at 6mA then:

  • R(led) = (5V - 1.8V) / 6mA - 125 ohms = 408 ohms.

At max allowed (8.75mA):

  • R(led) = (5V - 1.8V) / 8.75mA - 125 ohms = 240 ohms.

As you can see, 220 ohms is still too low of a value.

The color of the LED changes things, since Vf changes.

Example: white LED at 6mA:

  • R(led) = (5V - 3.1V) / 6mA - 125 ohms = 316 ohms.

Which is a lower value than for red.

That said, 4mA per LED is usually enough for indicators, especially if you use high-efficiency LEDs. If you need more current than that it's perfectly valid to use an external transistor like you've shown, or a FET (e.g., 2N7001, BSS138), or a high-drive IC buffer.

You may also choose an LED driver IC that has built-in current source drive, like the TI TLC59284 which can handle 35 or 45mA. This device uses a single resistor to set the LED current, so you don't need series resistors on each LED.

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

For multiple LEDs you might look at a Darlington array such as the ULN2003. This will reduce your circuit complexity as you'll only need the one IC and a resistor for each LED. The ULN2003 has a 2.7k resistor on each input built in, this should limit the shift register output currents to less than 2 mA each. The LEDs and current limiting resistors would go between the outputs and your positive supply, which doesn't necessarily have to be the same supply as the shift register. The ULN2003 will do up to 7 LEDs, there’s also an 8 driver version, ULN2803.

\$\endgroup\$

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.