Simple constant current LED driver

Here’s a simple circuit for driving LEDs at constant current. I like this one because it can be built with a variety of different components based on what you have on hand. I built my version with two 2N2222A transistors and a sense resistor from my resistor kit.


How does it work?

A small current on the CONTROL line causes the DRIVE transistor to switch on and sink through the SENSE resistor. The FEEDBACK transistor only operates when the voltage at the SENSE resistor is greater than its VBE, or turn-on voltage. When it turns on, it draws some current away from the base of the DRIVE transistor, reducing its gain and causing it to drop more voltage. This negative feedback will cause the whole system to equilibrate such that the SENSE resistor is seeing exactly the FEEDBACK transistor’s VBE. 

Why is this better than a ballast resistor?

You can drive a variety of LEDs with different forward voltages without worrying about changing any of the components (provided that you are comfortable using the same current). The DRIVE transistor will just drop more or less volts as necessary.

Also, if you’re trying to drive some high-current LEDs, you’re more likely to have common transistors that can handle the power dissipation than you are to have high wattage resistors. This makes prototyping and experimentation easier.

Finally, depending on your LEDs and your power supply, you could end up using fewer components by driving multiple LEDs in a string, rather than driving each LED separately.

Sizing components and calculating current and power

LEDs: You can use as many LEDs as you’d like provided that their combined forward voltage is less than the supply voltage minus VBE.

Power supply: Your input voltage needs to be at least the sum of the forward voltages of your LED string plus the minimum drop across the DRIVE transistor plus the VBE of your FEEDBACK transistor. Otherwise there won’t be enough voltage to turn on the LEDs.

Transistors: Anything NPN (or N-channel, if you’re using MOSFETs) you have handy has the potential to work. The most important thing to think about is how much voltage you’re expecting it to drop for you and what that means for power dissipation. This transistor will be acting in its linear region, so any voltage it doesn’t pass on from collector to emitter will turn into heat! For instance, let’s use an example of a 12V power supply and two white LEDs with a 3.2V forward voltage. The drive transistor will have to drop 12 V – (2 * 3.2 V + 0.6 V) = 5 V. If your target current is, say, 200 mA, then the transistor will be dissipating 5 V * 0.2 A = 1 watt of power. For some transistors this is no problem, but for others that’s a death sentence. Read your datasheet!

Sense resistor: This resistor sets the amount of current you want to pass through the LEDs. You can compute its value by taking the VBE of your FEEDBACK transistor and dividing by desired current. For instance, if you’re using a 2n2222A transistor with a VBE of 0.6 V, and you want to sink 200 mA of current, you would need a 3 ohm resistor. Power dissipation is straight forward, since you know the voltage and the current. Using our existing example, a 3 ohm sense resistor would see 0.6 V * 0.2 A = 0.12 watts. That’s small enough that you can use 1/4 watt resistors from a part kit with little worry.

11 thoughts on “Simple constant current LED driver

  1. Brock Wood

    Just the circuit, and explanation, I needed for an LED hobby project. I love being able to make a circuit out of the transistors, resistors, and other common stuff in my parts bin without having to buy (and wait for delivery) of a dedicated IC. I also like the versatility and adapability of this circuit. Thanks so much! – Brock

  2. Jason Leung

    This is a pretty awesome circuit. Digging the feedback.

    I was curious about the control resistor, however. Do we need to carefully choose the value for the circuit to function properly? Does it even need to be there?

    1. bryanduxbury Post author

      Yes, the control resistor is necessary. The control resistor combined with the FEEDBACK transistor form a voltage divider which varies the input voltage to DRIVE transistor. Plus if you left out the control resistor, you wouldn’t have anything limiting current coming from the control input. If it was a microcontroller pin, it would be easy to go past the output limit and fry the pin!

  3. Henry

    Hi, I’ve implemented this driver with 2 MMBT4401-7-F transistors, a 10k resistor for feedback and 20 ohm resistor for sense. It works well driving a couple LEDs, but I have noticed now that it creates a ~23MHz oscillation across the sense resistor. I am wondering if this is normal in your circuit or if everything stays stable with yours.
    Do you think this high frequency oscillation could induce noise to other nearby electronics?
    Also, maybe you could provide a little more insight on the circuit analysis of this design so I may understand better what’s happening behind the scenes.



    1. bryanduxbury Post author

      Hey Henry —

      First off I’d have to say that my dinky little hobby scope only goes up to about 1MHz, so I never would have noticed the oscillation 🙂

      I’d guess the oscillation comes from the tiny capacitance of the wires and other components adding in a little time delay as the circuit tries to get to equilibrium. As to whether that noise will create interference, that’s beyond my level of comprehension, but its probably not much since the configuration would have such a tiny wattage.

      1. Ron

        This is a clever circuit. Thanks for sharing. In regard to the 23 MHZ oscillation, your feedback transistor hfe gain is probably way too high. 2N2222 transistors have hfe around 50 to 100. Your transistor hfe is listed between 50 min to 500 max. With a lower gain, the feedback transistor should work with a steady collector current to act as an analog regulator. But, if the feedback transistor gain is very high, the circuit turns into a very fast, pulse-width modulated system. Very interesting it works both ways! Adding a capacitor across the sense resistor may stop the oscillation. Also, lower your control resistor value to increase the feedback transistor collector circuit, so it is in a decent control range.

  4. Thampi

    Simple circuit and excellent explanation.
    The sensor resistor is also passing a current of .2 amp. So wouldn’t wattage be 2 times 2.7 = .54.Thanks.

  5. Naren

    Issue is with temp compensation, as the temperature increases the VBE will drop and hence your current will drop as well.

  6. Bruce Mardle

    Thanks for this circuit. I built it with BC547s, 33R, 1 old-style green LED and a 100k base resistor. Drew a graph of current vs. voltage and found the current wasn’t at all constant below about 8V. Changed the base resistor to 10k and the ‘shoulder’ of the graph is now around 4V. I would send you an image of the graph but I can’t figure out how.

    1. JIW

      Re “current wasn’t at all constant below about 8V”: If the 8V is your control voltage, you got a reasonable outcome, as follows (using R1 for the sense resistor, R2 for the control resistor, Q1 for the drive transistor, Q2 for the feedback transistor):

      Nominally, the base of the drive transistor sits at 2 Vbe. (R1 is across b-e of Q2, for 1 Vbe, and the b-e of Q1 is another Vbe on top of that.) Assuming Vbe about 0.75 V, the current through a 33 ohm R1 is .75/33 = 22.7 mA. Assuming an hFe of between 200 and 450 for a BC547B, we need between 50 and 113 μA into Q1 base to allow 22.7 mA LED current. That means between 5 and 11 volts across 100KΩ R2, which added to 2 Vbe requires 6.5 to 12.5 V control voltage.

      On the other hand, if R2 is 10KΩ, a 4 V control voltage can supply (4-2Vbe)/10000 = 250 μA into the Q1_b, Q2_c node. For example, if both of Q1 and Q2 have hFe = 200, we will have .0227/200 = 113.5 μA into Q1 base; about 136.5 μA into Q2 collector; and about 0.7 μA into Q2 base.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s