# Saving a resistor on an NPN transistor current source (sink) when driving LEDs

The typical circuit to drive an LED from a low-power microcontroller digital output pin, using a transistor, might look something like this (assume a 20mA/2V LED):

simulate this circuit – Schematic created using CircuitLab

Now, of course individual transistors have current gain values that vary widely from one to the next. However, when building a circuit myself, I know the exact individual transistor I'm going to use. Therefore, I could measure the current gain of that transistor when it's not in saturation, with a circuit like this, for various values of R1:

simulate this circuit

And then (in my example), I could keep trying different values of R1 from my stock of resistors until the output current is exactly 20 mA:

simulate this circuit

And then use that in the LED circuit, now omitting the current-limiting resistor and letting the transistor do that instead:

simulate this circuit

Of course if the transistor were swapped for a different one, the process needs to be repeated.

This saves one (potentially high-power) resistor per LED, by simply choosing an appropriately-measured resistor in series with the transistor base.

Is there any particular problem with this method?

• The current will drift with temperature including self heating. What was dissipated in the resistor is now dissipated in the transistor. You also risk damaging the multimeter if you accidentally turn the transistor hard on. – Transistor Jul 28 '16 at 20:08
• The multimeter isn't at risk in my case since I can set a current limit on my power supply. How much will the current drift with temperature? If it's something on the order of 10%, say, that would be fine. Could also leave it for 5 minutes or whatever and use the measurement then, rather than the immediate "cold" measurement. – JohnSpeeks Jul 28 '16 at 20:11
• If you're saving a "high-power" resistor, make sure the transistor a beefy enough and has a heat sink because the transistor will be dispating the same amount of power. – DoxyLover Jul 28 '16 at 20:20
• I wouldn't sacrifice the reliability and stability of a circuit for the nil cost of a resistor. – Claudio Avi Chami Jul 28 '16 at 20:27
• Also, you're talking about "saving a high-power resistor", but 20mA at some 2.5V drop is 50mW. That's a low-power resistor. If you want to save on parts, drive the led directly from the MCU with just a current-limiting resistor. Saves you a resistor AND a transistor. Most MCUs I've encountered can deliver at least 10mA on a digital output, which gets you plenty brightness with a decent led. – marcelm Jul 28 '16 at 21:11

simulate this circuit – Schematic created using CircuitLab

This would be a better circuit. It should work fine also if SW1 is replaced actually by 5V CMOS output. There is no need to rely on calibrating each transistor or the stability of beta.

• Op is attempting to cut out the resistor and provide a constant current supply to the led. How would this do that? – Passerby Jul 28 '16 at 21:19
• By virtue of the more or less constant voltage drop (~2.3V) across R1. Not much different from the very top schematic in this respect. – rioraxe Jul 28 '16 at 21:22
• @Passerby from the title and the description - it seems OP is looking to remove a resistor so that the entire circuit works only with 1 resistor and 1 led (rather than 2 resistors and an led). This circuit above does that. – efox29 Jul 28 '16 at 21:23
• +! I went to suggest this in a comment and then saw it was covered. A goodish method. About as good as you'll get with 1R – Russell McMahon Jul 29 '16 at 0:49

This is a bad idea. Beta can change drastically with die temperature:

Also there can be significant change with age of the device, especially at high temperature. Your die may be relatively hot if you're dissipating all the power in the transistor.

Any change in your supply voltage will also cause relatively large fluctuations in the LED current.

Bottom line is that you could get it to work for a time at one operating point, but it's bad design. It's not that bad to include the resistor and remove the strong dependence on an exact value of beta.