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

Discussion in 'General Electronics Chat' started by DuanC, Jun 28, 2016.

  1. DuanC

    Thread Starter New Member

    Jul 23, 2015
    2
    0
    Hello

    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.
    Circuit.jpg
    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.

    Circuit2.jpg

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

    Thank you
     
  2. Bordodynov

    Active Member

    May 20, 2015
    638
    188
    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.
     
  3. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,986
    745
    D2 prevents the 12v led supply from feeding back to the microcontroller.
     
  4. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    763
    Do you mean V2 going too high?
     
  5. Bordodynov

    Active Member

    May 20, 2015
    638
    188
    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.
     
  6. DuanC

    Thread Starter New Member

    Jul 23, 2015
    2
    0
    Thank you. I'm glad I'm not missing something obvious. :)
     
  7. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,130
    267
    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.
     
  8. MrSoftware

    Active Member

    Oct 29, 2013
    500
    122
    If the transistor fails as a short, the diode could save your micro controller.
     
Loading...