Chip manufacturers are always coming up with ever more sophisticated constant current driver chips for LEDs. We have included this design for those of you who prefer a more cheap and cheerful solution.
Current through the LEDs produces a voltage drop across resistor R1. As the current rises to a level to produce a voltage drop of 0.6 V across R1 it will cause T2 to start conducting and shunt the gate voltage of T1 to ground. This produces a constant current I = 0.6 V/R1 through the LEDs.
The control input allows the LEDs to be switched on by applying a voltage in the range of 5 V up to around 12 V and switched off by applying a voltage of 0 V. When this input is driven by a pulse width modulated signal it gives the possibility to change the LED brightness.
The supply voltage for all the series connected LEDs can be as high as practical providing the maximum drain-source rating of T2 is not exceeded. The choice of T2 and any necessary heat sink will depend on the power dissipated in this device. This can be calculated from:
(Supply voltage minus the voltage drop across the LEDs) × ILED