# How many transistors does it take to light up an LED

#### alexfreed

Joined Oct 8, 2012
72
Why simple solutions are not always the best one.

I another thread there was a question about driving 15 LEDs from a 12 V supply.
Let's consider several options. In all cases either an NPN transistor or a MOSFET turns it on/off.

1. One resistor per LED, all LED-resistor pairs in parallel. If the LED has a 3 volts drop, the resistor drops 9 volts. So 3/4 of all the power goes to heat up the resistor. Not very efficient, but the resistor values are not critical.

2. 5 branches with 3 LEDs in series in each. Again the LEDs drop 3 volts each, 9 volts total. The resistor will drop another 3 volts. Now only 25% of power is wasted, but there is another issue. For a 12 V supply the resistor will be 150 ohm to limit the current at 20 mA.<snip>

3. Same thing, but there is a switching transistor in each of 5 branches and another one to set the current at 20 mA. Now we'll always drive the LEDs at 20 mA regardless of the voltage variations, but we use 10 transistors.

So is there a better solution? You bet. For example to use a switching DC/DC converted. There are specialized ICs for it, some quite inexpensive. Like the good old MC34063 - $0.5 or so. It has built-in current limiter that can be set to our 20 mA and drive all the 15 LEDs in series. Or if we have a microcontroller in the circuit anyway, we can roll our own step-up converter. The PIC drives a MOSFET with a PWM wave. The duty cycle should depend on the voltage across C2 measured by the PIC's ADC. At 20 mA that will be 200 mV. There is a danger in this circuit: if for whatever reason the pin controlling the MOSFET is stuck in the ON state, the MOSFET and/or L1 will release the magic smoke. Better to drive the MOSFET with a fail safe circuit. #### Attachments • 66.5 KB Views: 50 Last edited by a moderator: #### WBahn Joined Mar 31, 2012 24,970 Does your$0.50 for the MC34063 include the cost of the inductor and other external components?

Whether its a "better" solution depends entirely on the relevant metric for "better".

If the way in which it is "better" is immaterial for a particular application, then it isn't "better" and may well be, in fact, worse.

#### alexfreed

Joined Oct 8, 2012
72
WBahn: I don't understand your confrontational approach. I have described several possible solution with their pros and cons. Never implying the switching regulator solution was the right one in every case. It is by far the most difficult to implement and the cost of the parts including the passives is likely to run to a whole $1 or so. It is however the most efficient one in terms of power consumption. Not important in a car. Very important in a portable device. #### wmodavis Joined Oct 23, 2010 739 Like W said "Whether its a "better" solution depends entirely on the relevant metric for "better". You do not define your parameters to qualify as 'better' so it's anyone's guess or assumption what better means. Better is in the eye of the beholder. Your post title and lead-in sentence leave one bewildered as to your real point. Thread Starter #### alexfreed Joined Oct 8, 2012 72 I thought I have clearly defined "better" as "the most efficient one in terms of power consumption". My point was to show the relative merits of different solutions to a rather simple problem. If such posts are not welcome here, sorry. I was just hoping that somebody with little or no experience may learn something. #### THE_RB Joined Feb 11, 2008 5,438 Don't let WBahn get to you, he's been rather grumpy lately. And don't let it stop you posting things you think might be of use to others. I would like to see how simple you can get the MC34063 boost circuit, if you use its internal current limiting I think you can get the entire circuit down to a handful of parts, and cut costs by using a 1N4148 diode and cheap 680uH RF inductor etc. #### WBahn Joined Mar 31, 2012 24,970 I thought I have clearly defined "better" as "the most efficient one in terms of power consumption". My point was to show the relative merits of different solutions to a rather simple problem. If such posts are not welcome here, sorry. I was just hoping that somebody with little or no experience may learn something. Where did you clearly define that? Parts of your post make it appear that the issue you were concerned with was power, other parts makt is sounds like it's parts count, and others hint that it is cost. What's so "confrontational" about asking if the cost for the alternative you gave included the cost of all of the parts that are needed to implement it? What's so "confrontational" about pointing out that "better" only has meaning within the context of a metric by which to gauge it? Thread Starter #### alexfreed Joined Oct 8, 2012 72 I would like to see how simple you can get the MC34063 boost circuit Before drawing another circuit in LTSpice I did a lazy thing: googled for "MC34063 LED driver" thinking that I can't be the only one to come up with this obvious idea. Sure enough got an instant hit on http://threeneurons.wordpress.com/miscellaneous-projects/ The internal current limiter is not used here but the FB input normally used to set the output voltage (fed from the output voltage divider) is used here to set the current at 18 mA. The advantages of this circuit are: 1. High efficiency. There are more efficient ICs but they are a lot more expensive. 2. Maintains constant LED current over a huge voltage range. Naturally the question of this circuit being "better" than say just a resistor depends on the application. #### Attachments • 40.3 KB Views: 43 #### ErnieM Joined Apr 24, 2011 8,009 Does your$0.50 for the MC34063 include the cost of the inductor and other external components?

Whether its a "better" solution depends entirely on the relevant metric for "better".

If the way in which it is "better" is immaterial for a particular application, then it isn't "better" and may well be, in fact, worse.
All excellent points. "Better" by itself is meaningless without a context for comparison.

#### SgtWookie

Joined Jul 17, 2007
22,210
Just a reminder that we don't support discussions on automotive modifications, and the regulator mentioned is not suitable for use in an automotive environment. Automotive lighting is not something for experimentation; as the fatalities you may cause may include your own.

#### alexfreed

Joined Oct 8, 2012
72
Sorry if I inadvertently broke some rules: never did I say or imply that any of the circuitry discussed should or could be used for "automotive modifications". I only mentioned a car battery as an example of a power source that is NOT sensitive to a few milliwatts wasted. So the switching regulator will only be a proper solution for PORTABLE battery powered devices, like a back light for an LCD screen.

#### Le Khanh

Joined Jul 15, 2015
1
Why simple solutions are not always the best one.

I another thread there was a question about driving 15 LEDs from a 12 V supply.
Let's consider several options. In all cases either an NPN transistor or a MOSFET turns it on/off.

1. One resistor per LED, all LED-resistor pairs in parallel. If the LED has a 3 volts drop, the resistor drops 9 volts. So 3/4 of all the power goes to heat up the resistor. Not very efficient, but the resistor values are not critical.

2. 5 branches with 3 LEDs in series in each. Again the LEDs drop 3 volts each, 9 volts total. The resistor will drop another 3 volts. Now only 25% of power is wasted, but there is another issue. For a 12 V supply the resistor will be 150 ohm to limit the current at 20 mA.<snip>

3. Same thing, but there is a switching transistor in each of 5 branches and another one to set the current at 20 mA. Now we'll always drive the LEDs at 20 mA regardless of the voltage variations, but we use 10 transistors.

So is there a better solution? You bet. For example to use a switching DC/DC converted. There are specialized ICs for it, some quite inexpensive. Like the good old MC34063 - \$0.5 or so. It has built-in current limiter that can be set to our 20 mA and drive all the 15 LEDs in series. Or if we have a microcontroller in the circuit anyway, we can roll our own step-up converter.

The PIC drives a MOSFET with a PWM wave. The duty cycle should depend on the voltage across C2 measured by the PIC's ADC. At 20 mA that will be 200 mV. There is a danger in this circuit: if for whatever reason the pin controlling the MOSFET is stuck in the ON state, the MOSFET and/or L1 will release the magic smoke. Better to drive the MOSFET with a fail safe circuit.
Why not using potential dividers?