I'm planning to put together a simple shift-register driven array of LEDs as a first project, something akin to this: Simple LED array But using a 74HC595 shift register (two, eventually) and a transistor to drive each individual LED alone.

It's been twenty years since my (limited) formal electronics education, and I have a few questions:

  1. I believe understand why the resistors in line with the LEDs are necessary, because an LED essentially behaves like a short circuit, and will draw a lot of current from the register, right up until either it dies or the register dies. Is this correct?
  2. Why the "1K or 2.2K" resistor on the base of the transistor? Will I need one on each of the bases? Is this to limit the current between the base and emitter of the transistors? How do I know what value to use?
  3. Should I use 2N2222 transistors or should I use something like a 2N3904? What is the difference, other than the 2N2222 seems to have a much higher collector-emitter capacity? Does that affect the choice of resistor I need?
  1. Yes

  2. Yes. You can calculate the resistor by calculating base required current (you will need to know 'hfe' of your transistor). But you can just try. Working range is quite high, so if you will just use 500 Ohm for example, it should just work.

    For example, if max total current is 100mA, voltage is 5V, and hfe is 150mA, you need 100mA / 150mA = 0.6mA base current, so resistor should be 5V / 0.0006 = 8.3kOhm or less.

  3. There are lots of differences, but yes, it depends on how much current you will need in the worst case. If these LEDs are usual 10mA ones, almost any BJT will work so you can take what's cheaper or what you already have.

BTW. Don't see your shift register :-)

  • \$\begingroup\$ Yeah, this was a schematic I got from another site, it just showed the right resistors in the right places :) \$\endgroup\$ – Mark Mar 12 '11 at 4:03
  1. Yes, you need a current-limiting resistor for each LED in this kind of circuit.
  2. If, hypothetically, you use BJT transistors, then yes, you will also need a second resistor (per LED) on the base of each and every transistor to limit the current between the base and emitter of the resistor (that base-emitter junction acts like a diode). There is a wide range of resistor values that will work just fine -- BarsMonster shows how to calculate it.

However, if I didn't already have plenty of BJT transistors, I would consider using something that doesn't need base resistors, perhaps

  • 2N7000 or 2N7002 transistors, since FET transistors don't need a base resistor, or
  • transistor arrays such as the SN75468 or ULN2803, which have base resistors built into the IC, or
  • ICs that integrate both the transistor array and the shift register into the same IC. Several of them have the same interface as the 74HC595 (so you can use the same software), but can drive LEDs directly. W5VO kindly mentioned these chips to me at another question about driving LEDs.

Even the cheapest BJT or FET transistor can handle far more current and far higher frequencies than a single display LED is ever likely to require. So use whatever transistors are easily available to you.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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