You are on page 1of 18

LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

Home Contact Projects Experiments Circuits Theory BLOG PIC Tutorials Time for Science RSS
Terms of services Privacy policy

Home Projects Experiments Circuits Theory BLOG PIC Tutorials

Author
Giorgos Laz
February 5, 20

Presentation Worklog References

1 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

PAGE 3 of 6 -

2 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

Single Transistor Constant Current Driver with voltage regulation

Before we begin let me inform you that i have upload an on-line calculator to speed-up your calculations fo
circuit. You will find this calculator in the Dr.Calculus section of my site in this link.

The previous circuit works very well, but it has one serious disadvantage: any change at the supply voltage
cause a change at the LED current. That is because the base voltage will follow the supply voltage.

A small change can make the previous circuit more stable. The simplest and most logical is to add a zener d
to maintain the base voltage constant. Here is the circuit:

The only thing that changes here is the biasing method. Here is h
works: The Zener diode maintains a fixed voltage at the base of t
transistor, regardless of the supply voltage. Of course the supply
voltage must be higher than the Zener voltage (plus the voltage d
across RB). As a result, the voltage at the emitter will also be fixe
equal with VB - VBE. Thus, the emitter current will be constant (f
since RE does not change.

This solution is also very simple to calculate the biasing compone


The emitter base is calculated with the following formula:

VE = VZ - VBE

VBE is typical 0.7 for silicon and 0.3 for germanium transistors. The emitter current (and therefore the colle
current) is defined by the resistor RE. Using the Ohm's law we define RE:

RE = VE / IE

That's it actually! RB is now easily defined as a result of the transistor's current amplification and the requir
collector current. Using the worst case scenario (lowest hfe for highest collector current), we can calculate t
base current:

3 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

IB = IC / hfe_min

Do not forget to add some 1-2 mA for the Zener to achieve proper regulation. Usually, 1mA is enough. So w
the Ohm's law we can approximate a value for RB:

RB = (VDD-VZ) / (IB + 1mA)

Now we only need to calculate the power dissipation on the components to see if we are out of limits. First
dissipation on the transistor. To calculate this, we need to know the forward voltage across the LED for the
specific current setup. ATTENTION!!! A 3.2 volts LED at 30mA will NOT have 3.2 volts drop if it is driv
with less current, for example 20 mA!!! Here is how to calculate the power dissipation on the transistor. Fir
need to calculate VCE:

VCE = VDD - Vf_LED - VE

The power dissipation on the transistor is:

PT = VCE x IC

For the resistor RE we simply apply this formula:

PRE = I2C x RE

Now we must calculate the base resistor power dissipation. We will use the Ohm's law to calculate the max
current through this resistor first:

IRB_MAX = (VDD_MAX - VZ) / RB

We use the maximum supply voltage possible for VDD_MAX. Now we can apply the I2R formula to calcula
power dissipation on the resistor. If you want to be academically correct, you need to add the base current t
IRB_MAX, but since this is usually very small you can omit it:

PRB = I2RB_MAX x RB

To calculate the power dissipation on the Zener diode, we only need to multiply the zener voltage by the
maximum current through the base resistor.

4 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

PZ = VZ x IRB_MAX

5 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

An Example
This time we will drive 2 LEDs connected in series with 20mA. The LEDs are
completely different, so we will expect to see different forward voltages for the
same current. Instead of a voltage divider, we will use a Zener diode with voltage
5.1 Volts. The transistor is a 2N2222 with hfe=100. The supply voltage is 12
Volts.

Since the Zener regulates the base voltage at 5.1V, the emitter voltage will be
5.1-0,7 = 4.4 Volts. To regulate the LED current at 20mA (20 mA = 0.02 A), we The circuit on a
need to calculate the resistor RE for this current: breadboard for test.
LEDs are connecte
series
RE = VE / IE => RE = 4.4 / 0.02 => RE = 220 Ohm

As for the base resistor, first we need to calculate the base current. I use the 2N2222 which has a typical hfe
So the base current is 20/100 = 0.2mA. I add 2mA more for the Zener diode, so:

RB = (12 - 5.1) / 2.2 = 3.1 KOhm

I will use a 2.2K resistor instead, to be on the safe side. Here are the results:

The current through the transistor is 20.4mA. Notice that the voltage
across the white LED is 3.08 Volts while on the green LED is 2.27 Volts.

6 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

Let's calculate now the power dissipation on the transistor. The VCE is:

VCE = VDD - Vf_LED1 - Vf_LED2 - VE = 12 - 3.08 - 2.27 - 4.4 = 2.25 Volts

PT = VCE x IC = 2.25 x 0.02 = 45 mW

Comparing with the previous circuit, it is obvious that this one has 3.5 times less power dissipation on the
transistor. The reason is not the circuit itself, it is the second LED! This LED has an additional voltage drop
therefore the voltage drop across the transistor (VCE) is decreased. Let's see the power dissipation on RE:

PRE = I2C x RE = 0.022 x 220 = 88mW

Obviously the power that dissipates on the emitter resistor has radically increased, and that is due to the hig
base voltage of the transistor. To avoid such problems it is recommended to use as small Zener voltage as
possible.

CNC Stepper

Basic Electronics

Electronic Circuit

CNC Routers

Used Industrial

We need now to calculate the base resistor power dissipation. First we calculate the maximum current throu
the resistor:

IRB_Max = (VDD_MAX - VZ) / RB = (12 - 5.1) / 2200 = 3.1 mA

The power dissipation on the resistor is:

PRB = I2RB_Max x RB = 3.12 x 2200 = 21.1 mWatts

For the Zener diode we have:

PZ = VZ x IRB_Max = 5.1 x 3.1 = 15.81 mWatts

7 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

I found an interesting alternative to the Zener diode here. That guy uses two diodes in series instead of a Ze
diode to get a stable base voltage. But does it work? As a matter of fact, yes - almost! The theory behind th
simple: A diode has a typical 0.7 minimum forward voltage to turn on. This voltage appears as a voltage dr
across its leads. Actually it is the same voltage as the transistor VBE voltage. By adding 2 diodes in series, t
base voltage is regulated at 2x0.7 = 1.4 volts. This voltage is maintained stable regardless of the supply vol
You can connect as many diodes in series as you want. Each diode adds another 0.7 volts to the base voltag
course, one diode won't work, because the emitter voltage will then be 0. This method is perfect to maintain
low emitter voltage and therefore having low power dissipation on the emitter resistor. The theoretical analy
the same as if a Zener diode was used, with Zener voltage equal to 0.7 multiplied by the number of diodes i
series.
One big disadvantage that this circuit has is that it cannot maintain a very stable current if the supply voltag
changed. That is mainly because the emitter resistor is very small. As we know from the BJT transistor theo
the bigger the emitter resistor, the better the stability.

8 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

An Example
We will drive an LED with constant current 30mA powered from a 12V source. Instead of a Zener we will
two diodes connected in series to achieve 1.4 volts at the transistor base. This will result in 0.7 volts at the
emitter of the transistor. Therefore, i need a 23.3 Ohms emitter resistor to achieve 30mA. Since i do not hav
such a resistor, i will use two 47 Ohm resistors in parallel with total resistance of 23.5 Ohms:

This is the schematic diagram of the circuit It works just fine!

The voltage across the LED is 3.3 volts (measured with a multimeter). So the VCE is 12-3.3-0.7=8 volts. So
power dissipation on the transistor is:

PT = 8 x 0.03 = 240 mW.

This is quite a high power for a small TO92 transistor to dissipate without heatsink. For ambient temperatur
bellow 20o the circuit might operate normally, although the transistor will heat up.

9 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

A more extreme example: Driving a 1 Watt and a 3 Watts LED


All these 3 last circuits with the single transistor driver (including the one with the voltage divider) are capa
drive high power LEDs. You'll need to use a more powerful transistor though, probably some kind of a
Darlington pair to provide all the current needed. For this reason, i used the mighty TIP142 power darlingto
transistor. Keep in mind that a darlington transistors have doubled VBE voltage. It is a typical of 1.4 inst
0.7.

One more point to take into account is the power dissipation. A 1 Watt LED with 3.4 volts forward voltage
draw about 300mA, and a 3Watts LED will draw about 1 ampere. This means that if the transistor is called
drop 7 volts, it will dissipate 7 Watts of power! It will get really really HOT in seconds, so hot that it can m
breadboard.

The best thing to solve this problem is to use lower voltage for the circuit. I used 7 volts instead of 12 that i
for the previous experiments. Additionally, a heatsink on the transistor is a good idea. Finally, for the 3Watt
LED, i used 5Watts sense resistors. You can use 1 Watt resistors as well, but i did not have them in stock at
moment. To keep the dissipation on the resistor low, i used the circuit with the diodes in series. But this tim
used 3 diodes in series to have a 2.1 volts at the base and therefore 0.7 volts at the emitter (2.4-1.7).

Setup for 1 Watt LED: Setup for 3 Watts LED: The circuit under 24-hours
VDD: 7 Volts VDD: 7 Volts Worked like charm.
Base voltage: 2.1 Volts with 3 Base voltage: 2.1 Volts with 3
diodes in series diodes in series
Emitter voltage: 0.7 Volts Emitter voltage: 0.7 Volts
Sense resistor: 2 Ohms Sense resistor: 0.7 Ohms
Measured LED current: 270mA (measured with ohm-meter)
Measured LED current: 950mA

ADVANTAGES:
It can handle higher power than a simple resistor - Depends on the transistor ratings, package and coo
The current is kept stable regardless of the voltage supply

DISADVANTAGES:
Not very efficient since a lot of power is lost across the transistor

10 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

Any temperature change in the transistor package will result in output current change

Continue reading. Click here to go to the


next page >>>.
OR click here to view the
presentation.

Name

Email (shall not be published)

Website

Notify me of new posts via email

Write your comments below:


BEFORE you post a comment:You are welcome to comment for corrections and suggestions on this pag
But if you have questions please use the forum instead to post it. Thank you.

11 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

At 19 October 2015, 14:13:48 user Jakoos wrote: [reply @ Jakoos]

There seems to be an inconsistency in your measured values.

The sum of the voltmeter readings should be around 11.3V 0.7 for Rs = 12V for Vdd.

The actual values in the first picture is:

Vdd = 3.36V 8.03V 0.7V = 12.06V Correct.

The value for the second picture is:

Vdd = 3.36V 4.43V 0.7V = 8.49V Which is wrong. It should have been 12V.

Two errors is visible. a) the Vled would be higher in the second instance most probably at 3.5-3.6V
while the Vfet should be the difference. You cant loose voltage in a circuit. It must be somewhere a
we know it is not on Rs as the transistor will keep it at 0.7V,

At 19 October 2014, 16:40:28 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@Charles For 1W led better use a constant current driver, like the single transistor one.

At 18 October 2014, 2:28:07 user Charles wrote: [reply @ Charles]

I know most all of your suggestions talk about how the resister is a loss of power. If one was to use
buck converter to step the V down to 3.2, what option would be best to limit current to 1w LED's.

At 14 September 2014, 15:15:54 user Kothandapani wrote: [reply @ Kothandapani]

12 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

please send some notes of led and led driver then and there

thanks for services

truly yours,
kothandapani

At 3 September 2014, 6:03:09 user duncan wrote: [reply @ duncan]

Just wanted to say thanks for sharing. Your presentations are very clear and informative.

At 2 August 2014, 2:56:09 user Ancel wrote: [reply @ Ancel]

@Giorgos Lazaridis Hi, I'd like to create a 7 segment constant current driver using these transistors
there a way to use a single resistor current reference or will I need one for each segment?

At 6 May 2014, 7:44:48 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@oliver You can connect the output of the arduino at an open-collector transistor circuit. Say a 1K
resistor goes to the base of an NPN, the emitter goes to the ground and the collector goes to the inpu
this circuit. It will provide enough sink current.

At 20 April 2014, 16:23:39 user oliver wrote: [reply @ oliver]

@Giorgos Lazaridis

Thanks for the great tutorials. With the transistor-MOSFET driver, when connecting an Arduino PW
pin, only half the current is flowing through the LED, even at 100% duty cycle. I assume this PWM
not sinking current? How to connect an arduino (or any microcontroller PWM output) properly?

At 18 April 2014, 10:51:40 user MaxiD wrote: [reply @ MaxiD]

I can put another transistor that controls the gnd bjt transistor for use with pwm?

At 22 March 2014, 16:13:13 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@Leon Not quite sure, sorry

13 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

At 18 March 2014, 19:55:22 user Leon wrote: [reply @ Leon]

can we apply this to operate a laser diode?

At 2 February 2014, 9:34:02 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@karthikeyan check out the datasheet of the LED, this is where you find the info

At 2 February 2014, 9:28:06 user karthikeyan wrote: [reply @ karthikeyan]

dear sir can you send to my email about ampere and voltage of one led

At 27 December 2013, 5:21:45 user thiru wrote: [reply @ thiru]

VR voltage 230vAc and LED voltage is 15vAc now resistor value? so please send the formula as so
as possible.

At 14 December 2013, 23:58:32 user fabelizer wrote: [reply @ fabelizer]

Very helpful! Thanks for all your work!

At 14 October 2013, 19:14:30 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@yony Simply provide PWM pulses to the proper PWM input of the circuits is the easiest way. Foe
more sophisticated solutions you have to do the research yourself

At 14 October 2013, 13:44:32 user yony wrote: [reply @ yony]

Can you please show how can these circuits be incorporated with a microcontroller?

I'm in a search for an efficient way to drive a 1 watt LED via Arduino (right now I'm using a non-
efficient way to do this with a TIP120 transistor and 2 resistors which one of them needs to be at le
watt resistor).
Thank you

At 16 June 2013, 8:03:14 user jai ochani wrote: [reply @ jai ochani]

14 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

please advice me the circuit diagrm for 12v out put, 2Amp led driver.

At 14 February 2013, 17:14:10 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@shamim get a n-channel

At 11 February 2013, 11:46:22 user shamim wrote: [reply @ shamim]

we wanted to drive a LED using Mosfet. what Mosfet to use???

At 16 January 2013, 15:39:39 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@Ian for 90% efficiency you will need other type of circuits, not a linear driver. An SMPS instead

At 14 January 2013, 13:22:32 user Ian wrote: [reply @ Ian]

Hi Giorgos,

I'm wishing to use currents between 10mA and 1A depending upon the type of LED connected. I'd
the efficiency to be 90% plus if possible. I've seen Rds(on) values as low as 0.021 ohm, which I'd g
would translate into less power losses?

I'm guessing that from a 5v PIC micro that a logic level mosfet is the only way to go as opposed to
normal mosfet?

Thank you, Ian

At 14 January 2013, 9:17:48 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@Ian depends on the current and your efficiency requirements. Typically, on resistance of mosfets
very low. In many cases it is lower than 1Ohm (not high current mosfets). What current requiremen
you have? More than 1 amp?

At 11 January 2013, 17:49:19 user Ian wrote: [reply @ Ian]

Hi Giorgos, Thank you for your help with current measurement. Can you also tell me in the selectio
a power MOSFET if Rds(on) should be as low as possible or doesn't it matter? I'm presuming the
MOSFET is operating in saturation mode or would be if PWM was applied to the gate? Thank you,

15 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

At 7 January 2013, 5:34:43 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@Ian I put the scale of the multimeter to amperes and connected it in series with the LED

At 6 January 2013, 22:01:19 user Ian wrote: [reply @ Ian]

Hello Giorgos, Could you tell me how you measured the current through the LEDs as shown in you
photos please? Thank you, Ian

At 3 January 2013, 8:41:11 user adithyan wrote: [reply @ adithyan]

Circuits are plenty for pwm control of led brightness. It is agreed that there cannot be a linear contr
led brightness. Assuming that the pwm controls applied and the led current exceeds the 20ma limit
case of 4mm and 5mm Leds and 350ma in one watt, how a feed back control either shuts off the led
keeps the led current at maximum is yet to be published

At 2 October 2012, 15:17:29 user Ajay wrote: [reply @ Ajay]

Pls. give detail related to LED Driver Design.

Regards
Ajay

At 28 September 2012, 18:38:22 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@kwstas there is no "specific" number. I would not go above 3.3 volts though, just to maintain the
power dissipation on the emitter resistor low.

At 27 September 2012, 7:44:27 user kwstas wrote: [reply @ kwstas]

@Giorgos Lazaridis Thank you very much but i'm asking about the zener diodes..

At 26 September 2012, 17:48:15 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@kwstas same diodes (1n4001 if i remember well or similar)

16 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

At 26 September 2012, 17:15:07 user kwstas wrote: [reply @ kwstas]

I would like to tell me what diodes did you use for the 1w Led.
Thank you

At 9 March 2012, 8:53:16 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@Ghlargh although i plan to use such drivers, i will not go into details.

At 9 March 2012, 8:46:17 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@Alvie it is the most stable of all. i tried it with 10w led. i prepare video for this.

At 9 March 2012, 7:46:04 user Ghlargh wrote: [reply @ Ghlargh]

You should, if possible, explain how multiple constant current drivers with a single reference resisto
work. Such as the Allegro A6282

At 8 March 2012, 22:13:28 user Alvie wrote: [reply @ Alvie]

Regarding the BJT MosFET circuit:

Can you prove it's stability ? Just by looking at the diagram I think it might oscillate, eventually at h
frequencies, and eventually amplify the thermal noise.

At 7 March 2012, 20:10:23 user Daniel wrote: [reply @ Daniel]

hey you should take a look at how leds could be used as sensors(ldrs)
http://www.instructables.com/id/Light-Sensing-LEDs/

At 26 February 2012, 6:32:30 user Giorgos Lazaridis wrote: [reply @ Giorgos Lazaridis]

@Lupin Thank you very much for pinpointing those mistakes. You are right for both. The first one
already corrected, as for the second i will recompile the video. Thanks for noticing it soon.

At 25 February 2012, 22:54:05 user Lupin wrote: [reply @ Lupin]

Just wanted to mention, tha in the example it seems you forgot to subtract V_Z in the calculation of

17 de 18 06/09/2017 03:06 p. m.
LED driving and controlling methods http://www.pcbheaven.com/userpages/LED_driving_and_controlling_...

I_RB_MAX.

On the other hand, I got an issue on how you calculated P_RB in the video (around 5:50). You adde
the base current to I_RB_MAX. Isn't that already included?

Still many thanks for all the explanations and videos! I'm teaching a beginners electronics course
(diodes, transistors, opamps) next semester at uni. Teaching applications, when you got to do theory
first always falls short. I guess I'll refer some students to your page if they want to know more.

Contact Forum Projects Experiments Circuits Theory BLOG PIC


Tutorials Time for Science RSS

Site design: Giorgos Lazaridis


Copyright 2008
Please read the Terms of services and the Privacy policy

18 de 18 06/09/2017 03:06 p. m.

You might also like