Dave Tweed wrote: > William Chops Westfield 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 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