Constant current with transistor as switch - advanced question, please help!

Thread Starter


Joined Jul 23, 2015

This is not a basic question about why a base resistor is required for a transistor. -_-

I am switching a LED with a constant current circuit. The LED must have a minimum of 5mA triggering current, but should be immune to supply variations. As such, I designed a basic constant current driver using a 2N2222A transistor (MMBT2222). The appeal is that a single resistor and transistor is required.

The supply line ranges from 10-24V. The transistor is switched using a 5V microcontroller pin.
This circuit simulated fine and works well. However, in my research I found an untraceable picture of a similar circuit, with a fundamental difference of a base diode.


My question is why is this circuit recommended? I wish to avoid adding any circuitry more than is required.

Thank you


Joined May 20, 2015
The diode can be useful in the breakdown of the transistor. For example, if an overvoltage (crash). Diode current will not flow into the microcontroller.


Joined May 20, 2015
Anything can happen. For example, if you switch the circuit from car batteries (from the car). But if the voltage is as indicated on your figure does not exceed 24 V, there is no point in a further diode. Applied easily withstand 60V transistor.


Joined Jun 19, 2012
I agree that the transistor alone should isolate the logic output pin from the LED supply.
The diode is useful to reduce the burden voltage across the constant current sink, so you can operate more LED's or use a lower supply voltage and still remain in constant current mode.