Searching \ for '[EE]:NPN LED current drive' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/displays.htm?key=led
Search entire site for: 'NPN LED current drive'.

Exact match. Not showing close matches.
PICList Thread
'[EE]:NPN LED current drive'
2002\10\18@132600 by Jan-Erik Soderholm

face picon face
I'v added [EE]: to the topic...

First, I think you should put the "R" between the LED and the collector.
And connect the emitter directly to ground.

Then. put an "R" between the PIC port and the transistor base  to limit the
base current to ( [LED current] / [gain of the transistor] ). There is no reason
to drive more current inte the base then is needed to get the wanted current
through the LED. That's wasted current.

It's the gain of the transistor that let's you drive a LED, or anything else
that needs a higher current then the PIC port can stand.

And hould the LED be missing, the base resistor will limit the current into the base
anyway.

So putting a resistor between the PIC port and the base, more or less
answers all your questions.

Is there any special reason why you thought that connecting the PIC port
directly to the base was a good thing ?


Jan-Erik Svderholm
S:t Anna Data
tel : +46 121 42161
mob : +46 70 5241690

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2002\10\18@154135 by Robert E. Griffith

flavicon
face
>> I'v added [EE]: to the topic...

Woops, I was thinking about this as I filled in the address, but I still
forgot:)

>> Is there any special reason why you thought that connecting the PIC port
>> directly to the base was a good thing ?

Yeah, the idea, (as suggested to me recently) was that configuration you can
drive the LED from a higher, unregulated supply and still get a fairly
constant current through the LED.  In the standard config that you suggest,
the base current is constant but the collector current will vary with the
unregulated supply voltage (I think because the gain of the transistor will
vary based on the Vce).

My product has two supply options. 1) unregulated wall wart (when the lower
pwr LCD option is installed), 2) external regulated 5V (when the higher pwr
VFD option is installed).  With the external supply option, there is plenty
of juice available because the PS is sized for the high startup current of
the VFD. But with the unregulated supply, I am thinking that it is better to
take the current surges off the regulated supply.

Since the LED (its an IR transmitter) is on for only short pulses, I am
thinking that a better alternative might be to put a large cap next to the
LED supply so the current pulses are supplied by it.  If I do this, should
the cap be physically close to the LED, or can I just make the PS filter cap
larger? (which is several inches from the LED).  I am thinking that the cap
should be low ESR and the size would be, worst case, the drive current times
the total on times for a signal times the a acceptable voltage drop (or
something like that).

Instead of just putting the cap and the LED on the supply rail, would it be
better to isolate them with a resistor like this...

Vcc -------R-----.--------.
                |        |
                C       LED
                |        |
                |        R
                |        |
                |        C
                |         B----R--- uP output
                |        E
                |        |
GND -------------'--------.

The idea being that this would isolate the supply rail from the current
surge so that the LED drive voltage might dip during a on pulse, but the
supply rail would not.



--BobG

{Original Message removed}

2002\10\18@184231 by Olin Lathrop

face picon face
> First, I think you should put the "R" between the LED and the collector.
> And connect the emitter directly to ground.
>
> Then. put an "R" between the PIC port and the transistor base  to limit
the
> base current to ( [LED current] / [gain of the transistor] ). There is no
reason
> to drive more current inte the base then is needed to get the wanted
current
> through the LED. That's wasted current.

Often systems have a regulated supply the PIC is running from derived from a
higher voltage, often unregulated, supply.  In such cases it can be useful
to connect the PIC output to the base of an NPN transistor, emitter to
ground via a resistor, and LED between the unregulated supply and collector.
When the PIC output goes high, the collector acts pretty much like a
controlled current sink, with current = (PIC output - Vbe) / R.  R is then
adjusted to get the desired LED current.

The advantage of this scheme is that the LED current is drawn from the
unregulated supply, but is still nicely regulated itself.  Often LEDs are
the major current sink of a supply, so keeping them from the regulated
supply can make quite a difference in the power the regulator must
dissipate.  The drawback is that a supply must be available that is at least
the PIC power voltage plus the LED on voltage.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2002\10\18@202753 by William Chops Westfield

face picon face
   Often systems have a regulated supply the PIC is running from derived
   from a higher voltage, often unregulated, supply.  In such cases it
   can be useful to connect the PIC output to the base of an NPN
   transistor, emitter to ground via a resistor, and LED between the
   unregulated supply and collector.  When the PIC output goes high, the
   collector acts pretty much like a controlled current sink, with
   current = (PIC output - Vbe) / R.  R is then adjusted to get the
   desired LED current.

This WILL cause the transistor to be operating in it's linear region, since
otherwise the voltages at the emitter would be Vunreg-Vled-Vcesat, which
could easilly be greater than Vout from the PIC, right?  This shouldn't be
a problem for typical LED currents, but it does mean that for higher
current loads (light bulbs?) you'll probably end up needing to go back to
base and collector resistors instead of the emitter resistor (or risk
blowing up your transistor due to excessive power dissipation.)

BillW

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2002\10\19@084202 by Olin Lathrop

face picon face
> This WILL cause the transistor to be operating in it's linear region,

Yes.

> since
> otherwise the voltages at the emitter would be Vunreg-Vled-Vcesat, which
> could easilly be greater than Vout from the PIC, right?

The voltage at the emitter is driven by the PIC voltage.  It will be the PIC
voltage minus the B-E junction drop.  The transistor is acting as an emitter
follower driving the resistor voltage from the PIC output voltage.  Since
the emitter load is a resistor, the emitter current will be the emitter
voltage divided by the emitter resistor value.  Assuming reasonable gain for
a small signal transistor, this also becomes the collector current for
practical purposes.

> This shouldn't be
> a problem for typical LED currents, but it does mean that for higher
> current loads (light bulbs?) you'll probably end up needing to go back to
> base and collector resistors instead of the emitter resistor (or risk
> blowing up your transistor due to excessive power dissipation.)

Let's say the unregulated supply was 20V (pretty high for linearly
regulating to 5V), the LED requires 2V and 20mA, and the B-E drop is 600mV.
The C-E voltage accross the transistor will be:

 Vce = 20 - 2 - 4.4 = 13.6V

At 20mA the power dissipation in the transistor is 270mW.  Yup, that's
pushing a TO-92 package but still doable.  However that represents another
300mW that the linear regulator doesn't have to dissipate.  Especially with
multiple LEDs, this can make a big difference in the regulator requirements.
The wasted power to run the LEDs is spread over multiple small transistors
and resistors instead of being concentrated in one package.

Also note that 20mA LED current is rarely needed anymore.  Nowadays for
simple indicators I use decent LEDs and run them at 2 - 10 mA even though
they are rated at 20mA.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\19@122103 by Dave Tweed

face
flavicon
face
William Chops Westfield <.....billwKILLspamspam.....CISCO.COM> wrote:
> > In such cases it can be useful to connect the PIC output to the base of
> > an NPN transistor, emitter to ground via a resistor, and LED between the
> > unregulated supply and collector.
>
> This WILL cause the transistor to be operating in it's linear region,

Not necessarily. Yes for a bare LED, but maybe not for a bulb.

> otherwise the voltages at the emitter would be Vunreg-Vled-Vcesat, which
> could easilly be greater than Vout from the PIC, right?  This shouldn't be
> a problem for typical LED currents, but it does mean that for higher
> current loads (light bulbs?) you'll probably end up needing to go back to
> base and collector resistors instead of the emitter resistor (or risk
> blowing up your transistor due to excessive power dissipation.)

A light bulb will drop much more voltage than a LED, and in fact may drop
more than the available Vunreg - Vpic.

Consider a bulb rated at 50 mA at 12V, fed from Olin's 20V supply, with a
5V PIC controlling the transistor. If the emitter resistor is set for 50 mA,
then the transistor will be in current limiting mode, with 12V across the
bulb and 3.7V across the transistor, which will be dissipating 185 mW.

However, if the unregulated voltage is less than 17V, then the transistor
WILL be saturated, and dissipating very little power.

Furthermore, this type of drive circuit provides a "soft start" for the
bulb by limiting the cold-inrush current. This should extend its life.

With an LED, you can always add a series resistor at the collector of the
transistor, which won't change the LED current (assuming it isn't too big).
It'll merely shift some of the power dissipation away from the transistor.
This retains all of the other benefits of using a current source and the
unregulated supply.

-- Dave Tweed

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\19@140221 by Dwayne Reid

flavicon
face
At 09:18 AM 10/19/02 -0700, Dave Tweed wrote:

>A light bulb will drop much more voltage than a LED, and in fact may drop
>more than the available Vunreg - Vpic.
>
>Consider a bulb rated at 50 mA at 12V, fed from Olin's 20V supply, with a
>5V PIC controlling the transistor. If the emitter resistor is set for 50 mA,
>then the transistor will be in current limiting mode, with 12V across the
>bulb and 3.7V across the transistor, which will be dissipating 185 mW.
>
>However, if the unregulated voltage is less than 17V, then the transistor
>WILL be saturated, and dissipating very little power.

This is where the current sink falls to pieces.  The transistor may be
dissipating very little power but the poor PIC and its power supply is
gonna be unhappy.  You see, as soon as the collector current drops because
the transistor is saturating, the base current INCREASES.  The best way to
visualize this is to simply disconnect the collector of the
transistor.  The E-B junction looks like a forward biased diode and the
base current is (Vdd-Vbe) / R .  In other words, this type of current sink
maintains constant EMITTER current.  If the collector current is too low,
the remaining current comes from the base.

This can be alleviated by adding a resistor in series with the base.  As
long as the transistor is operating in the linear region, the base current
is negligible and there is only a small voltage drop on that base
resistor.  If the transistor saturates or its load becomes disconnected,
the base resistor limits the current that the PIC has to supply.

One final note: as soon as you add that series base resistor, it becomes
real easy to add one more resistor so that the base is driven from a
voltage divider that is driven by the PIC.  This has a couple of benefits:
less voltage drop across the emitter resistor which can mean a smaller
(lower power) resistor, and more headroom (less chance of saturating the
transistor).  This is a real advantage when dealing with an un-regulated
supply that has LOTS of ripple.

dwayne

--
Dwayne Reid   <EraseMEdwaynerspam_OUTspamTakeThisOuTplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\19@141702 by Wagner Lipnharski

flavicon
face
Dave Tweed wrote:
{Quote hidden}

Just to add some old/new words;

As a LED switcher, a small transistor should not to be seen as a current
limiter or extra power heatsink, for this job a much lower cost resistor is
recommended, except of course if the supplied voltage is not known, so the
transistor should be used also as a current limit device.

As even unregulated power supply voltages can not change so much, few volts
as expected, the resulting current change will be in the same order, or
almost non perceptible by the user.  I would say that even when the
supplied voltage changes from 14 to 17V you still can use a simple current
limiting resistor in series with the LED and forgeting about constant
current controlling.

In this case, a small NPN transistor setup as a simple switcher, emitter to
ground, series resistor at base, led and resistor at collector will be most
than enough.

The good point of such simple and very common setup, is that you can
substitute the transistor by ANY logic gate (74HC00 family) without change
nothing, except if the supplied voltage is higher than the logic VCC, in
this case, a 7406/7 gate is in order.

The limiting current resistor calculation is easy as  (VPower - 2 / 0.01),
14V-2V/0.01 = 1kohms 1/4 or 1/8W is enough.

W46NER

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\19@183244 by Doug Butler

picon face
> Just to add some old/new words;
>
> As a LED switcher, a small transistor should not to be seen as a current
> limiter or extra power heatsink, for this job a much lower cost
> resistor is
> recommended, except of course if the supplied voltage is not known, so the
> transistor should be used also as a current limit device.

Actually as long as you need a transistor, the incremental cost of making it
a bigger transistor to handle the power as a current regulator is small.  It
may be cheaper to use a bigger transistor than to add a resistor as a new
component.  Also the bean counters tell us that reducing parts count
improves reliability (though I have my doubts that is a usefull rule).

Doug Butler
Sherpa Engineering

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\19@193127 by Wagner Lipnharski

flavicon
face
Doug Butler wrote:
>> Just to add some old/new words;
>>
>> As a LED switcher, a small transistor should not to be seen as a
>> current limiter or extra power heatsink, for this job a much lower
>> cost resistor is
>> recommended, except of course if the supplied voltage is not known,
>> so the transistor should be used also as a current limit device.
>
> Actually as long as you need a transistor, the incremental cost of
> making it a bigger transistor to handle the power as a current
> regulator is small.  It may be cheaper to use a bigger transistor
> than to add a resistor as a new component.  Also the bean counters
> tell us that reducing parts count improves reliability (though I have
> my doubts that is a usefull rule).
>
> Doug Butler
> Sherpa Engineering


As far as I understand, it will be no extra resistor,
since the emitter resistor would go to the collector,
except of course if you are just connecting the NPN
base directly to the uC port pin, what I would not
recommend at all - a simple short into the transistor
and you will end up with VDC-VLED volts via collector
-base short to the uC port pin, bang and smoke.

For this solution I use to choose a small FET unit,
no need any gate-uC resistor (it is already isolated),
and the rON is lower than a 2N2222.  Of course that
if any 7406/7 gate is available at the board, then
no transistor is needed (if the VDC is higher than
5V - or if 5V than any 74HC04 gate does the job).

W46NER

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\20@021310 by Russell McMahon

face
flavicon
face
> As a LED switcher, a small transistor should not to be seen as a current
> limiter or extra power heatsink, for this job a much lower cost resistor
is
> recommended, except of course if the supplied voltage is not known, so the
> transistor should be used also as a current limit device.

The place where a transistor current source IS a good idea, and the one
which I based my original comment on, is where the unregulated supply varies
for some reason. A very good example is with a battery power supply. The
processor is powered by a voltage regulator but the LED is run at constant
current directly from the battery.As the battery voltage falls the LED
remains at constant brightness. For example, a 9v "manganese alkaline"
battery will change from slightly over 9v to about 5.5v (0.9v endpoint per
cell) across its lifetime. This would lead to a factor of almost 2 change in
LED current and 4 times change in power dissipation in the LED circuit
across voltage with a 1.5v LED. Without constant current drive the LED can
be run at only about 53% of its rated current at battery endpoint.

9V batt        I = (9-1.5)/R = 7.5/R
5.5V batt     I = (5.5-1.5)/R = 4/R
I change = 4/7.5 = 53.3%

A specific example of the above is in typical IR remote controls where the
LEDs typically draw very large currents (maybe several hundred mA) for very
short periods. Here the constant current supply allows the LED to be run
near its destruction point as the battery fades from new to dead. Without
the current control capability the only choice is to spec operating current
that will be safe with a new battery and suffer performance degradation as
the battery voltage drops. Examination of most IR remote controls will show
that the current limiting resistor is indeed in the drive transistor's
emitter (whereas, if constant current was not a design aim, it would be in
the collector,)





       Russell McMahon







>
> As even unregulated power supply voltages can not change so much, few
volts
> as expected, the resulting current change will be in the same order, or
> almost non perceptible by the user.  I would say that even when the
> supplied voltage changes from 14 to 17V you still can use a simple current
> limiting resistor in series with the LED and forgeting about constant
> current controlling.
>
> In this case, a small NPN transistor setup as a simple switcher, emitter
to
> ground, series resistor at base, led and resistor at collector will be
most
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\10\20@165558 by Wagner Lipnharski

flavicon
face
Russell McMahon wrote:
[snip]
> A specific example of the above is in typical IR remote controls
> where the LEDs typically draw very large currents (maybe several
> hundred mA) for very short periods. Here the constant current supply
> allows the LED to be run near its destruction point as the battery
> fades from new to dead. Without the current control capability the
> only choice is to spec operating current that will be safe with a new
> battery and suffer performance degradation as the battery voltage
> drops. Examination of most IR remote controls will show that the
> current limiting resistor is indeed in the drive transistor's emitter
> (whereas, if constant current was not a design aim, it would be in
> the collector,)

That's 100% correct, where you need to force a constant current.
There is of course, some drawbacks with the emitter resistor technique,
when dealing with battery fading voltage.

Suppose you are using a 9V battery in a circuit fed directly by this
battery. This circuit will drives a transistor with a constant current
emitter resistor and a LED at collector.

Lets see what happens when the battery is 9V or 5.5V;



  Battery 5.5 or 9V
         o
         |
         |
 .-------o--------.
 |                |
 |                |
.-----.        D  _V_  _-->
|     |            |
| DRV |            C
|     |---R1-----B[NPN]
|     | A   B      E
'-----'            |
 |                R2
 |                |
_|_              _|_



NPN Beta = 100

ID = 20mA
                 1
IE = 20mA x (1+ -----)
               Beta

IE = 20mA x 1.01 = 20.2mA


     20mA
IB = ------ = 200uA
     Beta


R2   = 47 Ohms
IR2  = 20.2mA
VR2  = 0.9494 V
VBE  = 0.6V
VB   = VR2B = 1.594 V
IB   = 200uA
VR2A = 5.4 or 8.9V
hmmmm....

When VCC = 5.5V;
VR2A = 5.4V
VR2 = VR2A - VR2B = 5.4 - 1.594 = 3.806V
R2 = 3.806 / 200uA = 19030 ohms.

If R2 = 19030 ohms when VCC = 8.9V;
VR2A = 8.9V

       8.9V - Vbe
IB = ------------------
     19030 + 47 x Beta

IB =  7.5V / 23730 = 316uA
IE = 316uA x 100 = 31.6mA
VR2 = 47 x 31.6mA = 1.4852 V

hmmmm

It shows that constant current transistor configuration only works ok if
the base current is also constant, of course, it relies on that. The above
driver circuit is dependent of battery voltage (and it fades), doesn't
matter so much if using emitter resistor to fix current or not, the R2
voltage will change along with battery voltage.

The only way to keep the constant current would be to generate a fixed
driver voltage at the driver output, what seems not to be the case.  Some
drivers use an internal double diode to ground to clip the output driver
voltage to around 1.2V, even with a 3V battery application. It keeps VR2
fixed along with the LED current.

In a 3V application, as remote controls, VR2 should be as small as
possible, because when batteries fade out to less than 2.2V, less the
transistor VCE, a high VR2 can kill the IR signal not because the batteries
are low, but simple because there is not enough voltage around the IR LED.

In this cases, the VBE and the known BETA will be used as the constant
current controller.  With a knowing Beta of 100, driving 2V to a 7kohms
base resistor, will provide a 200uA base current, what will open 20mA
collector current for the LED. As a small NPN can goes down to a 0.3VCE
without saturating, it means the battery can fades down as much as
VLED+0.3V, with the same IR emission level.

It means what?  that if you have a constant base current, it will result in
a constant collector current, with a little more worries about making sure
all the transistor batch shows a relative small beta variations.

Using a very small REmitter (R2) will bend the constant current control to
the Beta and VBE factors, since now they can almost dictate IC, being VR2 a
small portion of it.  It means that using an emitter resistor to fix
current, it should develop a significative emitter-ground voltage, at least
higher than 0.6V, so variations in VBE will represent small variations at
the constant collector current.

The same effect can be seem on operation amplifiers as constant current
generators.  In the feedback network, if the compared voltage is very
small, the relation between the Compared Voltage and OPOffset (changes with
temperature) will be small, causing the constant current very instable and
sensible to temperature.

               __
Control > 3V __|  |__
o
|                    .------------.
|         0.10909V   |            |
R 1k         |      / \           |
|            |     /   \         _V_ Laser
|   100k     V    /     \         |  21.4mA
o----R----o------(+)___(-)        |  Const
|         |             |         |  Current
_V_ 1.2    R 10k         '--R10k---o
| VREF    |           0.10909V    |
_|_       _|_                      R 5.1ohms
                                 _|_

In the above (ideal) circuit, a probable offset of 5mV at the op-amp will
generate a change in the constant current, in the order of 5mV/109mV = 4.6%
or almost 1mA.  If by lack of VCC you need to reduce the compared voltage
to less than 50mV, then the ratio gets worse.

W46NER

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\10\21@121752 by Dwayne Reid

flavicon
face
At 07:24 PM 10/18/02 +0200, Jan-Erik Soderholm wrote:
>I'v added [EE]: to the topic...
>
>First, I think you should put the "R" between the LED and the collector.
>And connect the emitter directly to ground.

The configuration as drawn forms a constant current sink.  The LED current
is held relatively constant and is calculated by (Vdd-Vbe)/R.

The transistor operates in the LINEAR region in this mode and the base
current is approximately Iled / hfe.  The only downside to this
configuration is that the base current rises to about Iled if the LED
becomes disconnected or if the unregulated supply drops too low.

>Is there any special reason why you thought that connecting the PIC port
>directly to the base was a good thing ?

It is a great method for reducing the regulated power supply
requirements.  While it does not suit all methods of driving LEDs, it works
well when you have only a few LEDs to drive.

dwayne

--
Dwayne Reid   <@spam@dwaynerKILLspamspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...