I am trying to control some power LEDs using a microcontroller. For this I plan to use a transistor based constant current source to protect the LEDs from getting damaged and PWM on the base of the transistor to control the brightness.
The circuit is set to obtain 300mA across the LED. The transistor is 2n2222 NPN.
Problem: The Vin is 12V. The LED consumes only 3V. This leaves about 9V that drops across the transistor and the resistance in series. The power consumed by the transistor is high enough to burnt it. After a few seconds of working it gives up and the current in the circuit increases to about 1A before it burns out.
I want to understand what can be done to stop this from happening. I also tried using a 5V zener in series to consume 5V before the transistor. This did the job somewhat but the zener got extremely hot (enough to melt plastic) and that can't b good for the life of product.
Some help here will be highly appreciated.
- I cannot use a voltage regulator to decrease voltage as there is absolutely no space left on the PCB.
- I cannot change the power source from 12V to something less.
Update (solution for me):
So inspired by @indraneel answer down below, I understood I had to either utilize the remaining voltages in an efficient way or make sure the extra wattage was dissipated in a dafe manner.
What @indraneel suggests is very efficient as you get to actually make use of the extra wattage you have after the first LED and this also won't give too much heat. But it just wasn't the right solution for me as the LEDs are quite expensive. But, this inspired me to understand that the only way is to consume this power. So I decided to use a 5V zener in series. Obviously, the zener diode will heat up too much to dissipate this power. For that I placed the zener on the aluminium PCB where all my LEDs are. That acted as a heat sink for the zener. Now obviously the aluminium PCB does get warm but it neither affects the LEDs, nor does the transistors get burnt/damaged.
I hope this post helps someone. :D