Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC Transistor LED

Status
Not open for further replies.
The calculations are attached.
 

Attachments

  • LED Calc.gif
    LED Calc.gif
    54.5 KB · Views: 237
I think the whole argument is moot in that both circuits provided by Lj are essentially emitter followers. In the left diagram, a PNP transistor is shown, while the right uses an NPN.

For my projects using a transistor-driven LED, I generally use an NPN with 1K resistor on the base, put the LED in the collector lead with a 220 ohm resistor for 5 volts, or 470 for 9 V, resulting in a nice, bright LED.

As Nigel says, it isn't super critical.

AllVol
 
AllVol said:
I think the whole argument is moot in that both circuits provided by Lj are essentially emitter followers. In the left diagram, a PNP transistor is shown, while the right uses an NPN.

For my projects using a transistor-driven LED, I generally use an NPN with 1K resistor on the base, put the LED in the collector lead with a 220 ohm resistor for 5 volts, or 470 for 9 V, resulting in a nice, bright LED.

As Nigel says, it isn't super critical.

AllVol
The point I was trying to make is that the emitter followers provide a smaller load on the PIC. And only need one resistor. However, it is only suitable for low voltage LEDs since the 5V supply does not leave much headroom.
 
ljcox said:
The point I was trying to make is that the emitter followers provide a smaller load on the PIC.

But the difference is miniscule, and too small to be relevent.

And only need one resistor.

Yes, you save one resistor - but leave the potential for damaging the PIC if the transistor goes S/C.

However, it is only suitable for low voltage LEDs since the 5V supply does not leave much headroom.

Yes, it's really rather limiting, which is probably why it's rarely used?.
 
Nigel Goodwin said:
But the difference is miniscule, and too small to be relevent.
For a collector current of 10 mA, you need 1 mA to saturate the common emitter option. But for the emitter follower, it is Ic/Beta which is in the tens of :mu:A range.

Nigel Goodwin said:
Yes, you save one resistor - but leave the potential for damaging the PIC if the transistor goes S/C.
Agreed but I thought I read one of your posts recently where you said the PIC i/o is "virtually indestructable".
Nigel Goodwin said:
Yes, it's really rather limiting, which is probably why it's rarely used?.
I prefer to use a CMOS buffer.

I tend to use the emitter follower for situations where I need a temporary indicator of whether an output (not necessarily a PIC output) is high or low.
 
ljcox said:
For a collector current of 10 mA, you need 1 mA to saturate the common emitter option. But for the emitter follower, it is Ic/Beta which is in the tens of :mu:A range.

Why would you need to saturate the transistor?, as I said way back in this thread we're only feeding an LED at low current - feeding the same uA drive to the base of a common emitter stage will probably produce more current though the LED than an emitter follower (due to lower gain with the base voltage nearer the collector. If you don't saturate the transistor, then it will dissipate more heat - but probably still less than the emitter follower version.

Agreed but I thought I read one of your posts recently where you said the PIC i/o is "virtually indestructable".

They are certainly robust, but shorting an output pin directly to 5V, then taking the pin low is going to give it some pain - which is completely avoided by the usual method.

I prefer to use a CMOS buffer.

I tend to use the emitter follower for situations where I need a temporary indicator of whether an output (not necessarily a PIC output) is high or low.

Don't forget to wave your flag, because you're out there alone! :D
 
Nigel Goodwin said:
Why would you need to saturate the transistor?, as I said way back in this thread we're only feeding an LED at low current - feeding the same uA drive to the base of a common emitter stage will probably produce more current though the LED than an emitter follower (due to lower gain with the base voltage nearer the collector. If you don't saturate the transistor, then it will dissipate more heat - but probably still less than the emitter follower version.
If you want to drive a higher voltage LED such as a Blue one from a 5 V supply, then you need all the voltage you can get between the collector and the supply rail.
And, you also need to ensure that it will work over a reasonable temperature range.
If it is on the verge of the active region, it is likely to drift into the AR if the temp changes significantly.
Nigel Goodwin said:
Don't forget to wave your flag, because you're out there alone! :D
I'm always happy to be the odd man out.
 
ljcox said:
If you want to drive a higher voltage LED such as a Blue one from a 5 V supply, then you need all the voltage you can get between the collector and the supply rail.
And, you also need to ensure that it will work over a reasonable temperature range.
If it is on the verge of the active region, it is likely to drift into the AR if the temp changes significantly.

But no more than your emitter follower suggestion, which is in the active region to start with - at least with common emitter you have the option of saturating the transistor.
 
Nigel Goodwin said:
But no more than your emitter follower suggestion, which is in the active region to start with - at least with common emitter you have the option of saturating the transistor.
Of course the emitter follower is in the active region, so the only drift is the -2 mV / degree C in the base emitter voltage which will cause virtually no change in the emitter current. There will also be some thermal drift in the LED but I can't recall the magnitude.

All I'm trying to say is that the emitter follower option is one of several for driving a LED from a PIC. The options are:-

  1. A LED and resistor in series connected to the i/o
  2. A transistor either in common emitter or emitter follower config.
  3. A MOSFET in common source config
  4. Or if there are several LEDs to be driven and you want minimal load on the PIC - a CMOS buffer package.
 
I often use a small MOSFET like the 2N7000 for this sort of application because it saves power.
 
Hero999 said:
I often use a small MOSFET like the 2N7000 for this sort of application because it saves power.
I agree, and the only calculation required is to determine the value of resistor in series with the LED.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top