Searching \ for '[EE]: Inverting IR LED driver with 1 transistor' 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/io/irs.htm?key=ir
Search entire site for: 'Inverting IR LED driver with 1 transistor'.

Exact match. Not showing close matches.
PICList Thread
'[EE]: Inverting IR LED driver with 1 transistor'
2002\09\20@180541 by Robert E. Griffith

flavicon
face
Woops.  Forgot the tag on the first try. In the time since I sent the first
email without the EE tag, I think I think I have figured out the solution to
this, but it would be nice to have confirmation that there is nothing wrong
with this.  Solution at end…


I am making an IR transmitter.  I am using serial port to generate the IR
signal (with modulation).  The serial port output is idle high so I want to
drive the LED on a low signal so that the LED is not constantly on during
the idle time.  I also want to drive it with a transistor to get more
current than the uC output.

Is there a way to connect a transistor (either NPN or PNP) so that it
conducts when low signal is applied to the (base?) and is off for a high
signal?  I know how to do it with two NPN transistors – using the first as a
simple inverter.  Is this the way to do it or is there a simpler way?


Solution?

PNP (like 2N3906)
E --> +5V
C --> LED --> resistor --> GND
B --> resistor --> TTL output from uP

Is the resistor on the base actually needed?

Thanks,

--BobG

--
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\09\20@181122 by Roman Black

flavicon
face
Robert E. Griffith wrote:

> Is there a way to connect a transistor (either NPN or PNP) so that it
> conducts when low signal is applied to the (base?) and is off for a high
> signal?
>
> PNP (like 2N3906)
> E --> +5V
> C --> LED --> resistor --> GND
> B --> resistor --> TTL output from uP
>
> Is the resistor on the base actually needed?


Hi Robert, yes that will work fine, use a base
resistor of 10k. :o)
-Roman

--
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\09\20@182604 by Olin Lathrop

face picon face
>>
PNP (like 2N3906)
E --> +5V
C --> LED --> resistor --> GND
B --> resistor --> TTL output from uP
<<

Yup, that's it.

> Is the resistor on the base actually needed?

Yes, else there is no limit to the base current.  The B-E junction acts like
a diode, and would draw lots of current if the voltage were lowered
significantly below the diode drop.  Something would give, either the PIC
low side driver or the transistor B-E junction.  Pffft, smoke.


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

--
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\09\20@182613 by Robert E. Griffith

flavicon
face
Thank Roman for the quick reply.  You are incredible.

--BobG

-----Original Message-----
From: pic microcontroller discussion list [spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU]On
Behalf Of Roman Black
Sent: Friday, September 20, 2002 6:06 PM
To: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
Subject: Re: [EE]: Inverting IR LED driver with 1 transistor

Robert E. Griffith wrote:

{Quote hidden}

Hi Robert, yes that will work fine, use a base
resistor of 10k. :o)
-Roman

--
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

--
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\09\20@184726 by Robert E. Griffith
flavicon
face
Thanks for explaining that.  It makes perfect sense once its pointed out.  I
guess I am intimidated by discrete transistors.  So I guess you would want
to limit the current to just over the base saturation current.  (5V-
[BCjunction drop]) / (base saturation current) = R.  It's the same as
calculating the series resistor for an LED.  You also the man, Olin:)

--BobG

{Original Message removed}

2002\09\20@220702 by Russell McMahon

face
flavicon
face
Now the men have had their input :-) - there is an interesting variation you
can use here.
Instead of putting both LED and resistor in the collector lead, place the
resistor in the emitter. This then becomes a VERY rough current source as
the current is limited to (Vdrive-0.6)/R

E --> resistor --> +5V
C --> LED --> GND
B --> resistor --> TTL output from uP

Odds are its not much different in result than the other arrangement in this
case.
This would be of more affect if you drove the LED from a different voltage
source than the cpu - eg with an NPN drive & the LED supplied from the
unregulated battery supply while the processor runs on a regulated supply.

Have a look at the circuit inside typcal IR remotes and see what they do
(will vary no doubt)


           RM

--
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\09\21@081347 by Olin Lathrop

face picon face
> Thanks for explaining that.  It makes perfect sense once its pointed out.
I
> guess I am intimidated by discrete transistors.  So I guess you would want
> to limit the current to just over the base saturation current.  (5V-
> [BCjunction drop]) / (base saturation current) = R.  It's the same as
> calculating the series resistor for an LED.

Yes, but note that "base saturation current" is dependent on application.
What you really want is the base current at which the transistor is
guaranteed to be saturated.  In this case you are switching an LED, so the
collector current is well known.  Let's use 20mA as an example.  Most small
signal transistors (I would use 2N4403, but many others would be fine too)
can be counted on to have a gain around 100, so I like to use 50 to provide
some margin.  The base current therefore needs to be 20mA / 50 = 400uA.  The
base resistor should therefore be:

 (5V - BE drop) / 400uA =
 4.3V / 400uA = 10.75KOhms

So Roman had it pegged quite well at 10Kohms.


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

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


2002\09\21@082624 by Olin Lathrop

face picon face
> Instead of putting both LED and resistor in the collector lead, place the
> resistor in the emitter. This then becomes a VERY rough current source as
> the current is limited to (Vdrive-0.6)/R

Yes, this is a very useful approach.  I fact, if the digital signal is
powered from a regulated supply, the current is controlled quite nicely.  I
like doing this when an unregulated supply of 7V or more is available.  When
using LEDs, they often draw the bulk of the current, and this scheme keeps
that current draw from the regulated supply.  The dissipation is spread over
each of the LED driving transistors instead of the regulator, which can
sometimes make the difference between needing a heatsink and not.


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

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


2002\09\21@143840 by Mike Singer

picon face
Olin Lathrop wrote:
> Yes, this is a very useful approach.  I fact, if the digital
> signal is powered from a regulated supply, the current
> is controlled quite nicely.  I like doing this when an
> unregulated supply of 7V or more is available. When
> using LEDs, they often draw the bulk of the current,
> and this scheme keeps that current draw from the r
> egulated supply.  The dissipation is spread over each
> of the LED driving transistors instead of the regulator,
> which can sometimes make the difference between
> needing a heatsink and not.

Roman Black wrote:
> I tried all sorts of 3-transistor designs, with more gain
> and better switching, and even tried circuit variations with
> a comparator chip and a 555 timer chip. Not one of them
> performed as well as this beauty.

Well, I can't resist this kind of challenge. I'll order some
dc/dc converters next week and will test them as:
1. Efficient constant current drivers for LEDs.
2. Controlled by PIC, variable DC drivers for motors (as
   alternative to PWM by PIC itself). Hope I'll find a nice
   Bulgarian DC motor with tachometer winding, lost
   somewhere in my garage.

Mike.

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


2002\09\21@191305 by Olin Lathrop

face picon face
> 1. Efficient constant current drivers for LEDs.

Note that what I was talking about is not particularly efficient.  The
advantage is that the current is well controlled regardless of the supply
voltage.  The unregulated supply can therefore be used which reduces the
current requirements on the regulator.  This is not more efficient since the
LED current is drawn from the supply regardless of its voltage.


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

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


2002\09\23@115559 by Robert E. Griffith

flavicon
face
This is a nice modification - and I understand it (somewhat) which makes it
all the more sweet.  When I tested it I was getting much lower currents than
I expected (wanted 40ma, got 6ma - emitter resistor = 100ohm).  I removed
the 10K base resistor and I got the expected current.  This makes sense to
me since the base is now at 0V, current flows into the emitter until the
drop across the emitter resistor drops it down to 0+0.6V, hence
(Vdrive-0.6)/R.  However, if I drive it from the unregulated supply, it
seems that the current will be proportional to the drive voltage - not a
current source at all.  Am I missing something?

I tried putting a 560 ohm resistor on the base and found through
experimentation that a 33ohm at the emitter gave me 40ma.  With this setup,
the current is not so sensitive to varying the emitter resistor.  But it is
still linear WRT Vdirve.

P.S.  I am now interested in driving the LED from the unregulated supply
because the IR LED can take high currents (up to 1A) for the short transmit
pulses and I think having that large current surge before the regulator
seems like a good idea.  Does that make sense?

--BobG

{Original Message removed}

2002\09\23@170947 by Robert E. Griffith

flavicon
face
OK, I am still a little confused (largely because I got a package of 2N3906s
from radioshack which had an incorrect pinout, apparently).  This is what I
came up with.  The modified hookup diagram from Russell did not work (Ic
much lower than expected).  I thought he had just forgotten to remove the
base resistor when he copied and pasted my original diagram.  This seemed to
have worked as I mentioned in my last email, but only when I was testing
without the IR LED in place.  I did not want to burn out the LED if I made a
mistake and figured the added 0.6v drop would just .  When I put the LED in
the circuit, I got no Ic through the LED at all.  I think because the 1.1V
drop across the LED biased the collector positively relative to the base
which was at ground. I tried putting a small resistor back on the base but
it was very sensitive to the value of that resistor and the gain was lousy
(but maybe that was before I discovered the pinout error E and C were
reversed).

What seems to be working for me now is putting the LED up on the emitter
like...

2N3906
E --> IR LED --> 68ohm R --> +5V
C --> GND
B --> GND (while testing, will be uP output)

I got the 68ohms from (5V -0.6Vbc -1.2Vled) / 40ma = 75ohms  (68 is nearest
I had)

I measure with this setup...
Ic =  39.30ma
Ib =   1.45ma

Not so bad, but I still think I am not getting something.  I have a feeling
that if I could figure out the right value for the base resistor (I tried
10k, 5K, and a pot set to a value that yielded a base potential of 1.5v
(just above the 1.2v collector potential caused by the LED) and emitter
resistor, then not only would Russell's diagram work but it would be less
sensitive to the drive voltage as Olin refered to.

So, as you can see  -- a little knowledge is a dangerous thing and I still
need a little help!

--BobG

{Original Message removed}

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