Step 8: A little micro makes all the difference

Picture of a little micro makes all the difference
Now what? connect to a micro-controller, PWM or a computer!

now you've got a fully digital controlled high-power LED light.

the micro-controller's output pins are only rated for 5.5V usually, that's why the zener diode is important.

if your micro-controller is 3.3V or less, you need to use circuit #4, and set your micro-controller's output pin to be "open collector" - which allows the micro to pull down the pin, but lets the R1 resistor pull it up to 5V which is needed to fully turn on Q2.

if your micro is 5V, then you can use the simpler circuit #5, doing away with Z1, and set the micro's output pin to be normal pull-up/pull-down mode - the 5V micro can turn on Q2 just fine by itself.

now that you've got a PWM or micro connected, how do you make a digital light control? to change the brightness of your light, you "PWM" it: you blink it on and off rapidly (200 Hz is a good speed), and change the ratio of on-time to off-time.

this can be done with just a few lines of code in a micro-controller. to do it using just a '555' chip, try this circuit. to use that circuit get rid of M1, D3 and R2, and their Q1 is our Q2.
diy_bloke2 years ago
Though circuits 1-2 will most likely work with almost any power NFET, for the circuits 3, 4 and 5 it is pretty important that indeed a 'Logic' type NFET (usually with an 'L' behind the typenumber) is used because 5 Volts may not be sufficient to completely open up non-logic level NFET completely. Now ofcourse this won't alwaysbe necessary, but if drawing higher currents it might well be.

One may want to consider taking circuit 4 and replacing the zener with a transistor that has its base pulled low via 1 M resistor and that receives its PWM signal via a (say 4k7) base resistor
whitehawk824 years ago
I ran across this post recently as I kept buring high power LED's or had very hot resistors. So, I tried this method, I already had a fet connected in the manor shown in Circuit 5. So I disconnected the Source on my fet and put R3 (3x1ohm 1/2 watt resistors) and the Q1 parts in. For the FET @ Q2 I was already using a NTD5806N and had a 3904 transistor laying around to use for Q1. R1 from my ATTINY85V was 500ohm as anything more and the FET doesnt fully turn on. So, I rigged this up and tried it to limit the current to 1.6Amps on 13.8vdc,. I fried yet another LED. When I put my meter in the line I was hitting close to 8 amps of current! I know I did the calculations right.. Any thoughts and wisdom?
suguimoto4 years ago
Hi Dan! Thank you very much for your article!
I´m building my own RGB LAMP, I bought a 9W (350mA per color) RGB 6 Pins (Chinese-Star) Led and i´m using an Arduino to control it.
My main problem was that I couldn´t find many of the IC described above, so I bought similar IC´s that are working quite fine:
Q1: BC 547
R1: 100k 1/4W
R3: 1ohm 1W

I really dont know how efficient it is, but it´s working fine and the components didn´t get so hot.

I hope this can help some other people that are willing to work with high power leds.
pmj_pedro4 years ago
If i use one of this circuits like the 5, and d the supply font is 18V, and the 4 high power leds only need 13.6V, should i use a resistor or something to not burn the leds?
No, the point of these circuits is that you can use most any power supply that meets the LEDs min total forward voltage without changing the circuit. Q2 acts as a variable resistor and steps down the voltage. Read through page 6 completely, it's explained more completely there.
larams4 years ago
Does the value for R1 matter in circuit #5?
dan (author)  larams4 years ago
not much, 10k should work.
popeyescu6 years ago
Hi Dan,

it seems that the link to "555 circuit" doesn't work. Do you have a schema/link for this circuit?
I found another schema for 555: http://www.dprg.org/tutorials/2005-11a/index.html
Is it good?

You can find the 555pwm ckt here:
rhosman6 years ago
if I changed Q2 to something like http://www.fairchildsemi.com/ds/FD%2FFDB52N20.pdf and added a Bridge Rectifier that was 120V 20A rated I should be able to hook this circuit up directly to a US power main? Maybe through a light socket?
jasmclbs6 years ago
Hi Dan, Can you kindly help me with the components' selection? Do you mind sharing with me the part no. of Q1 and Q2 that you have used? As I am adopting circuit #5, what will be the preferred R1 and R3 values for an 5V output from my MCU I/O pin. The voltage supply to the LEDs will be +5V too. For my LEDs, I am using OSRAM LUW W5AM which has a IF of 350mA and VF of 3.2V. (White) Please kindly advise. Thank you in advance.
Hi Dan. I want to drive 3W RGB led (1W per color) 350mA per color 2.2~2,8v red 3,0~3,8v green and blue. Can you teach me how to calculate R3 for Circuit 5 and can you give me some easy to find substitutes for Q2? Can I use somethin like TIP31? Thanks a lot.
gigi_boeru6 years ago
how can I use the 555 circuit? i don't understand from that link... can you post the complete circuit (555 & this led driver)? thank you
kdris6 years ago
would circuit #5 work for an led array with a source voltage of 36V or would the zener diode still have to be used since it is over 20v. Thanks in advance!
sjmusic27 years ago
Dan, If I wanted to use an LED array of 6 strings containing 3 SSC p7's (3.6Vf; 2.8A each) how would your 555 timer circuit look ? Secondly, would it be better (more consistent lighting) to provide individual Q2's & R's for each string - how would this circuit look and would it change the value of R1 or R3 ? PSU will be 12v, 20A (cctv psu) TIA (from a noob)
batchku7 years ago
Hello, I'm working with a mictrocontroller whose output PWMs go from 0 to ~ 3.2 V. In the instructions, it is indicated: "if your micro-controller is 3.3V or less, you need to use circuit #4, and set your micro-controller's output pin to be "open collector" - which allows the micro to pull down the pin, but lets the R1 resistor pull it up to 5V which is needed to fully turn on Q2." what exactly does that mean? does it mean change the value of R1 according to the voltage range of your microcontroller? or do i simply need a different Q1 or Q2....? thank you in advance. batchku
xsmurf7 years ago
I'm not very familiar with Zeners, what voltage/rating should be used for a 3.3v µC? Thanks