> Georg Hager wrote: > > > On Thu, 18 Jun 1998, Thomas McGahee wrote: > > > > > A better solution is to use an NPN transistor with a base resistor of about > > > 330 ohms. Connect the emitter to ground (Vss), connect the cathode > > > of the IR LED to the collector. Connect a current limiting resistor > > > from the anode of the IR LED to +5. A high out from the PIC will > > > cause the IR LED to emit infra-red light. > > > > I see. But I think one could spare the base resistor by using an emitter > > follower, right? I mean connecting base to PIC output, collector to +5V > > and placing diode/resistor between emitter and GND. This cuts the drive > > voltage for the diode/resistor combination by 0.7V, but has better > > switching characteristics as the transistor is not put into saturation. > > Right? > > Time for a lesson ? > > Let's say you need a pulse of 100mA. Let's assume a gain of at least 200. > You only need a base current of 100mA/200 = 500uA! If you have > 5V to run into the base, you need a series resistor of (5-0.7)/0.0005 > = 8600ohm. The next value down is 8k2. With this, you get a full 5V, > (@ at least 100mA) over the load. > > But now you want to switch an IR LED, and you don't want to pop it, > so you need some current limiting. You can put a resistor in series with > the LED, or you can do it the fancy way by putting it in as an emittor > resistor. This is called feedback. Let's say you want to hit the IR LED > with no more than 100mA pulses. Let's assume again that you have > 5V to go into the base. The emittor resistor will see 4.3V, right? > Now 4.3V/0.1mA = 43ohm minimum. > > How can this limit the current ? - if more than 100mA flows through > the emittor, the emittor voltage goes higher than 4.3, effectively > switching the transistor off. > > The same priciples apply when you want to get the base resistor as in > situation A. > > Right! Let's take a 47ohm emittor resistor, 8k2 base resistor, and a > NPN transistor with a gain of more than 200. Hook the collector to your > LED's cathode, and the anode to any voltage you like (remember it is > current limited, so any voltage above the LED drop will do), say 5V. > > You will get 4.3V/47ohm = 91mA (I'd say that's close enough!) > To control if the base resistor is not too large : (5-0.7)/8200 = 524uA > base current, that can give you at least 104mA. > > _ Positive > | > | > _|_ > \ / IR LED > V > --- > | > | > | > | > 8k2 ohm |/c > PIC------/\/\/\/\-----| NPN > |\e > | > | > / > \ 47 ohm > / > \ > / > | > | > ----- > --- > - > > BTW make sure you don't leave the LED on - it > will pop @ 100mA. -- Friendly Regards Tjaart van der Walt mailto:tjaart@wasp.co.za Add your voice !! Vote at the Great G Com Public Vote. Go to : http://www.wasp.co.za/~tjaart/gcomvote.html |--------------------------------------------------| | WASP International | |R&D Engineer : GSM peripheral services development| |--------------------------------------------------| |SMS mailto: 0832123443@wasp.co.za (160 chars max)| | http://www.wasp.co.za/~tjaart/index.html | |Voice: +27-(0)11-622-8686 Fax: +27-(0)11-622-8973| | WGS-84 : 26¡10.52'S 28¡06.19'E | |--------------------------------------------------|