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.
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.
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.
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.
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.
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.
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!
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.
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:-
A LED and resistor in series connected to the i/o
A transistor either in common emitter or emitter follower config.
A MOSFET in common source config
Or if there are several LEDs to be driven and you want minimal load on the PIC - a CMOS buffer package.