Searching \ for '[PIC]: Driving high voltage LED from a PIC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/displays.htm?key=led
Search entire site for: 'Driving high voltage LED from a PIC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Driving high voltage LED from a PIC'
2003\04\22@143729 by Tal

flavicon
face
Hello,

I noticed the following circuit in a friend design of a very cost
sensitive product and am curious what the people think about it.

The PIC (e.g. 16F73) is to drive an high voltage LED such as digikey
441-1009-ND
(http://rocky.digikey.com/WebLib/Sunbrite/Web%20Data/SSP-01TWB9WB12.pdf)
. The general idea is to drive the LED directly from the PIC, saving an
extra high voltage driver (actually, there are few LED in this circuit,
each is driven seperatly).

The circuit is as follows:


 [14V]----[A LED C]----[R1]---(A)----[R2]----[GND]

Where R1 is the current limiting resistor for the LED, point A is
connected to a PIC digital output and R2 is a relativly large resistor
(about 50K or so). The idea is that to turn the LED off, the PIC output
goes to HIGH or TRI_STATE and because of the 'knee' of the LED curve and
the resistor R2 that draws a minimal forward current, the voltage at the
PIC will not exceed its VDD.

Does this make sense ? How about if the PIC is operating on 3V only ?

Thanks,

Tal

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

2003\04\22@145620 by Mike Hord

picon face
That seems viable; I'm not sure I see the reasoning for the resistor tying
the pic's pin to ground.  It seems a bit extraneous; after all, you'll be
sinking the lion's share of the current through the PIC regardless of how
you do it.


Mike Hord



{Quote hidden}

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail

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

2003\04\22@162930 by Ned Konz

flavicon
face
On Tuesday 22 April 2003 11:55 am, Mike Hord wrote:
> That seems viable; I'm not sure I see the reasoning for the
> resistor tying the pic's pin to ground.  It seems a bit extraneous;
> after all, you'll be sinking the lion's share of the current
> through the PIC regardless of how you do it.

I think the point is so you don't draw current through the PIC
protection diodes when the LED's OFF.

But isn't the leakage current temperature sensitive? I don't know
whether this will make a difference or not...

{Quote hidden}

--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE

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

2003\04\22@165815 by Oliver Broad

flavicon
face
If the PIC doesn't have analog features it should wear a low value
protection diode current without needing the extra resistor.

Maxim have a data sheet showing almost the same thing using a display driver
chip and a large LED display. It really helps to have constant current drive
though.


{Original Message removed}

2003\04\23@031502 by Russell McMahon
face
flavicon
face
part 1 2250 bytes content-type:text/plain; (decoded 7bit)

> I noticed the following circuit in a friend design of a very cost
> sensitive product and am curious what the people think about it.

>   [14V]----[A LED C]----[R1]---(A)----[R2]----[GND]

> Where R1 is the current limiting resistor for the LED, point A is
> connected to a PIC digital output and R2 is a relativly large resistor
> (about 50K or so). The idea is that to turn the LED off, the PIC output
> goes to HIGH or TRI_STATE and because of the 'knee' of the LED curve and
> the resistor R2 that draws a minimal forward current, the voltage at the
> PIC will not exceed its VDD.

I'd have to say that this doesn't make sense.
When it's current flow is low the LED will drop LESS voltage than when
operating.
Even a white LED is liable to drop say 2.5v at little light output.
The voltage at the PIC pin is

Vpic =     (Vsupply - Vled) x R2/(R1 + R2)

or  R1 = ((Vs-Vl)/Vp -1) x R2

If Vdd PIC = 5v
VLED off = 2.5v
R2 = 50k

   R1 = ((14-2.5)/5 - 1) *50k = 65k

At turn on Iled = (14-3)/65k =~ 0.17 mA
Not at all bright !
At turn off current through the LED will still be more than half the
above!!!

ie it doesn't work (and can't)(according to me :-) ).

Really this is obvious by inspection as lowering and raising the bottom of a
resistor + LED chain by 5v when there is 14v at the top end is obviously
going to have a relatively small effect. If the lower resistor is sized to
limit swing to 0-5v range then the LED will see a less than 2:1 current
swing.
___________

A better method (that actually works :-) )

A circuit is attached with the same number of components (replace an R with
a transistor) produces a near perfect result at very little extra cost. LED
current is defined almost solely by (Vgo-0.6)/R1. Vin can be any sensible
voltage, limited only by transistor breakdown voltage when off and
transistor dissipation when on. Cost is measured in cents (if using such
currency :-) ). For a truly cost sensitive design this is probably surface
mount so the transistor mounting cost is about the same as for a resistor.


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




part 2 1906 bytes content-type:image/gif; (decode)


part 3 2 bytes
-

2003\04\23@065802 by Richard Graziano

picon face
I have used this approach for years.  I have never become aware of a
failure.  It is a very rliable circuit, providing the parameters are
properly determined.
{Original Message removed}

2003\04\23@075730 by Russell McMahon

face
flavicon
face
> I have used this approach for years.  I have never become aware of a
> failure.  It is a very reliable circuit, providing the parameters are
> properly determined.

I assume you mean his two resistor circuit.
But, unless I am missing some fundamental principle completely, it doesn't
work in the example he gave!
At 14 volts, either -

- The LED gets minimal current and doesn't light in a worthwhile manner or
- The LED always receives enough current to turn on enough to glimmer or
worse or
- The PIC pin sees more than Vdd when turned off.

I would genuinely welcome an explanation and/or analysis that shows how such
a circuit can sesnibly achieve the objective.


       Russell McMahon


> > > I noticed the following circuit in a friend design of a very cost
> > > sensitive product and am curious what the people think about it.
> >
> > >   [14V]----[A LED C]----[R1]---(A)----[R2]----[GND]
> >
> > > Where R1 is the current limiting resistor for the LED, point A is
> > > connected to a PIC digital output and R2 is a relativly large resistor
> > > (about 50K or so). The idea is that to turn the LED off, the PIC
output
> > > goes to HIGH or TRI_STATE and because of the 'knee' of the LED curve
and
> > > the resistor R2 that draws a minimal forward current, the voltage at
the
> > > PIC will not exceed its VDD.
> >

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

2003\04\23@081220 by Nigel Orr

flavicon
face
pic microcontroller discussion list <> wrote on Wednesday, April 23, 2003
12:09 PM:

>> I have used this approach for years.  I have never become aware of a
>> failure.  It is a very reliable circuit, providing the parameters are
>> properly determined.
>
> I assume you mean his two resistor circuit.
> But, unless I am missing some fundamental principle completely, it
> doesn't work in the example he gave!
> At 14 volts, either -
>
> - The LED gets minimal current and doesn't light in a worthwhile
> manner or
> - The LED always receives enough current to turn on enough to glimmer
> or worse or
> - The PIC pin sees more than Vdd when turned off.

And can I add:
- if the +14V comes up before the PIC power supply, bad things might
happen (latchup etc).

That is a problem if the PIC supply is derived from the +14 (is that an
automotive +14?), and in lots of other circumstances too.  Like Russell,
I'm puzzling as to any advantages of this circuit, even if it can be
tweaked to work for a particular LED.

Nigel
--
Nigel Orr, Design Engineer                 @spam@nigelKILLspamspamaxoninstruments.co.uk
Axon Instruments Ltd., Wardes Road,Inverurie,Aberdeenshire,UK,AB51 3TT
              Tel:+44 1467 622332 Fax:+44 1467 625235
                  http://www.axoninstruments.co.uk

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

2003\04\23@091659 by Mike Hord

picon face
Nigel brings up a very good point about the power supply rise time- it's
something we forget about often because on the scale WE see it on, it's
instantaneous, but to the PIC it usually isn't even linear, much less
instantaneous.  I lost a number of PICs during one project to an
"unexpected" 24-volt input.

A solution (although I'm not certain how good it is; feedback DEFINITELY
appreciated before I try it myself) would be to stick a FET in there to
switch the current through the LED.  You have the advantage of minimizing
the current flow into the PIC, which also gives you a nice spot of isolation
from that 14-V source.  With the current design, if that LED goes and the
voltage suddenly drops, you'll see a significant voltage/current spike, even
with the 50k resistor in place.  With the FET, it'll smoke, but the PIC will
(probably) be protected.

Comments?






{Quote hidden}

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus

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

2003\04\23@093740 by Alan B. Pearce

face picon face
>A solution (although I'm not certain how good it is; feedback DEFINITELY
>appreciated before I try it myself) would be to stick a FET in there to
>switch the current through the LED.  You have the advantage of minimizing
>the current flow into the PIC, which also gives you a nice spot of
isolation
>from that 14-V source.  With the current design, if that LED goes and the
>voltage suddenly drops, you'll see a significant voltage/current spike,
even
>with the 50k resistor in place.  With the FET, it'll smoke, but the PIC
will
>(probably) be protected.

If going this way, just use a logic level FET to drive the LED. My current
favourite is the Philips PHN210 - 30V, 3.5A logic level input dual FET in
SO-8 package 0.66p from RS components in the UK RS stock #198-4195 for those
interested.

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

2003\04\23@094532 by Nigel Orr

flavicon
face
pic microcontroller discussion list <> wrote on Wednesday, April 23, 2003
2:16 PM:

> A solution (although I'm not certain how good it is; feedback
> DEFINITELY appreciated before I try it myself) would be to stick a
> FET in there to switch the current through the LED.  You have the
> advantage of minimizing the current flow into the PIC, which also
> gives you a nice spot of isolation from that 14-V source.  With the
> current design, if that LED goes and the voltage suddenly drops,
> you'll see a significant voltage/current spike, even
> with the 50k resistor in place.  With the FET, it'll smoke, but the
> PIC will (probably) be protected.
>

Personally, my generic LED driving circuit when there is a larger supply
available (eg 9V, +12V), is usually a transistor+resistor current source.
For circuits where there is only +5V, I usually use a FET, Gate to PIC,
Source to GND, LED and series resistor from supply to Drain.

The current source has PIC output to transistor base, transistor emitter to
ground via suitable resistor (see below), + supply to LED anode, LED
cathode to transistor collector.  It only works if the PIC supply voltage +
the voltage required by the load is less than the power supply, so you
would need a >10V supply for a 5V PIC driving a 5V LED.

Transistor base voltage is 5V, transistor emitter voltage approx 4.3V,
current is 4.3/R, where R is the emitter-ground resistor.  Have a look at
current sources in Horowitz & Hill for more details (and better sources!)

Advantages are that it's fairly rugged, if you short out the LED, no more
current flows, you can add additional LEDs in series or change to an LED
with different Vf and they all get the same current, if the supply changes
from 9V to 24V, current remains the same, etc etc.

Nigel

--
Nigel Orr, Design Engineer                 RemoveMEnigelspamTakeThisOuTaxoninstruments.co.uk
Axon Instruments Ltd., Wardes Road,Inverurie,Aberdeenshire,UK,AB51 3TT
              Tel:+44 1467 622332 Fax:+44 1467 625235
                  http://www.axoninstruments.co.uk

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

2003\04\23@101904 by Spehro Pefhany

picon face
At 02:44 PM 4/23/2003 +0100, you wrote:


>The current source has PIC output to transistor base, transistor emitter to
>ground via suitable resistor (see below), + supply to LED anode, LED
>cathode to transistor collector.  It only works if the PIC supply voltage +
>the voltage required by the load is less than the power supply, so you
>would need a >10V supply for a 5V PIC driving a 5V LED.

An additional series base resistor of perhaps 0.3~1K is not a bad idea.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
speffEraseMEspam.....interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.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

2003\04\23@102939 by Olin Lathrop

face picon face
> Nigel brings up a very good point about the power supply rise time- it's
> something we forget about often because on the scale WE see it on, it's
> instantaneous, but to the PIC it usually isn't even linear, much less
> instantaneous.  I lost a number of PICs during one project to an
> "unexpected" 24-volt input.
>
> A solution (although I'm not certain how good it is; feedback DEFINITELY
> appreciated before I try it myself) would be to stick a FET in there to
> switch the current through the LED.  You have the advantage of
minimizing
> the current flow into the PIC, which also gives you a nice spot of
isolation
> from that 14-V source.  With the current design, if that LED goes and
the
> voltage suddenly drops, you'll see a significant voltage/current spike,
even
> with the 50k resistor in place.  With the FET, it'll smoke, but the PIC
will
> (probably) be protected.

I don't know why you guys are making a simple thing so difficult.  The
easy answer takes two parts and works very well.  PIC output goes to base
of NPN, emitter to resistor, other end of resistor to ground, collector to
LED cathode, LED anode to +V supply.  When the PIC output goes to 5V, the
transistor becomes a constant current sink at about 4.3V / R.  As long as
+V - 5V is enough to turn on the LED, this simple little circuit even
regulates the current thru the LED.  The +V supply can ripple a lot, and
the LED brightness will be quite constant.

I often use this scheme if the PIC 5V supply is regulated from an
unregulated supply of at least 7.5V or so.  The current thru the LED is
nicely regulated, but it comes from the unregulated supply.  Since a few
LEDs can easily draw more current than the PIC and associated 5V
circuitry, this keeps the regulated current draw down and can allow use of
a low power linear regulator.


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

2003\04\23@105048 by Olin Lathrop

face picon face
> >The current source has PIC output to transistor base, transistor
emitter to
> >ground via suitable resistor (see below), + supply to LED anode, LED
> >cathode to transistor collector.  It only works if the PIC supply
voltage +
> >the voltage required by the load is less than the power supply, so you
> >would need a >10V supply for a 5V PIC driving a 5V LED.
>
> An additional series base resistor of perhaps 0.3~1K is not a bad idea.

Actually, it is.  The emitter resistor will limit the current drawn from
the PIC nicely.  Additionaly base resistance only decreases the apparent
impedence of the current sink driving the LED.  The impedence of an ideal
current sink is infinite.


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

2003\04\23@105639 by Spehro Pefhany

picon face
At 10:47 AM 4/23/2003 -0400, you wrote:
> > >The current source has PIC output to transistor base, transistor
>emitter to
> > >ground via suitable resistor (see below), + supply to LED anode, LED
> > >cathode to transistor collector.  It only works if the PIC supply
>voltage +
> > >the voltage required by the load is less than the power supply, so you
> > >would need a >10V supply for a 5V PIC driving a 5V LED.
> >
> > An additional series base resistor of perhaps 0.3~1K is not a bad idea.
>
>Actually, it is.  The emitter resistor will limit the current drawn from
>the PIC nicely.  Additionaly base resistance only decreases the apparent
>impedence of the current sink driving the LED.  The impedence of an ideal
>current sink is infinite.

It prevents unwanted oscillation too.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
EraseMEspeffspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.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

2003\04\24@125230 by M. Adam Davis

flavicon
face
Get rid of R2, and use pin RA4.

According to the data sheet, RA4 is an open-collector driver, which
means that it will only sink current- never sourcing it.  Furthermore,
(according to the 18f242 data sheet) the only protection diode on RA4 is
to Vss(Gnd).  You can put a reletively high voltage on RA4 without
worrying about a diode shunting current to Vdd (V+).  I believe all the
other PICs to have the same essential design.

Just like the other ports you need to maintain a current of under 25mA.

Enjoy!

-Adam

Tal wrote:

{Quote hidden}

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

2003\04\25@033834 by Alan B. Pearce

face picon face
>I believe all the other PICs to
>have the same essential design.

The 16F630/676 do not seem to have an O/C output on any output. Do not know
about any others, but perhaps it is being dropped from some of the newer
designs?

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservEraseMEspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body

2003\04\25@104936 by Tal

flavicon
face
Can't you emulate an open collector output by changing the port
direction to input ?

Tal

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

2003\04\25@110428 by Russell McMahon

face
flavicon
face
> Can't you emulate an open collector output by changing the port
> direction to input ?

In general, no!, unfortunately.
This is why RA4 was mentioned.
All other pins (and all pins on some PICs?) have high side protection diodes
connected to Vdd. If an input pin rises to Vdd + about 0.6v the diode will
clamp to Vdd. RA4 does not have such a diode as it is used as the high
voltage 9+12v ish) programming voltage pin.

Using the simple emitter follower current source that I posted a few days
ago is arguably the simplest and cheapest way of getting a very capable high
voltage driver - and it only takes 1 resistor and 1 transistor.


       RM

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservSTOPspamspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2003\04\25@110703 by Alan B. Pearce

face picon face
>Can't you emulate an open collector output by changing
>the port direction to input ?

yes, but that does not give you the higher voltage capability of the older
part numbers RA4 output, which was a significant part of why the person
suggesting using it spoke up for this particular thread.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservSTOPspamspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body

2003\04\25@152158 by Wouter van Ooijen

face picon face
> RA4 does not have such a diode as it is used as the high
> voltage 9+12v ish) programming voltage pin.

A bit confused? HVP uses /MCLR, not RA4.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body

2003\04\25@153039 by Byron A Jeff

face picon face
On Fri, Apr 25, 2003 at 09:19:30PM +0200, Wouter van Ooijen wrote:
> > RA4 does not have such a diode as it is used as the high
> > voltage 9+12v ish) programming voltage pin.
>
> A bit confused? HVP uses /MCLR, not RA4.

Correct. Also I've been meaning to get into this thread. Even though RA4
doesn't have a clamp diode, every datasheet that I've seen recently does have
a maximum voltage specification for RA4. IIRC I've seen as low as 8V max.
I just took a quick peek at the 16F62X datasheet and it specifies 14V max.

Doom lies down the path of those who violate datasheet specifications.

Is this project so cost sensitive that it cannot afford a nickel transistor
and a penny resistor?

BAJ

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body

2003\04\25@212225 by Russell McMahon

face
flavicon
face
> > RA4 does not have such a diode as it is used as the high
> > voltage 9+12v ish) programming voltage pin.
>
> A bit confused? HVP uses /MCLR, not RA4.

Whoops & indeed :-)
OK - so they chose to make RA4 higher voltage capable for no good reason
then perhaps. In any case, the point here is that MOST IO pins do not allow
you to take them more than a diode drop(less if operating normally) above
Vdd.


       RM

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listserv@spam@spamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2003\04\26@155132 by Dwayne Reid

flavicon
face
At 10:47 AM 4/23/03 -0400, Olin Lathrop wrote:

> > >The current source has PIC output to transistor base, transistor
>emitter to
> > >ground via suitable resistor (see below), + supply to LED anode, LED
> > >cathode to transistor collector.  It only works if the PIC supply
>voltage +
> > >the voltage required by the load is less than the power supply, so you
> > >would need a >10V supply for a 5V PIC driving a 5V LED.
> >
> > An additional series base resistor of perhaps 0.3~1K is not a bad idea.
>
>Actually, it is.  The emitter resistor will limit the current drawn from
>the PIC nicely.  Additionaly base resistance only decreases the apparent
>impedence of the current sink driving the LED.  The impedence of an ideal
>current sink is infinite.

2 reasons why the series base resistor is a good idea: 1) eliminate
parasitic oscillation  2) keep current sourced from PIC to a reasonable
value if LED supply drops low enough that the transistor saturates.  Note
that the emitter current is going to remain constant whether or not the
collector can supply the current - that extra current will come from the base.

Like you, I've been using this technique for years.  I mostly use tiny
linear regulators (LP2950A) or simple zener regulated supplies and simply
can't tolerate an unexpected large current just because the current source
dropped out of regulation.  Adding that one resistor in series with the
base fixes the problem.  Having that resistor also stop a nasty spike at
100 MHz is an added bonus.

dwayne

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

Celebrating 19 years of Engineering Innovation (1984 - 2003)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
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: To leave the PICList
.....piclist-unsubscribe-requestspam_OUTspammitvma.mit.edu>

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