This question made me wonder. Say I want to drive a LED when a small level audio signal is present. I understand how to do this with an opamp, but how about a transistor. You'd have to bias it so that it just doesn't conduct without the signal, so that any extra voltage on the base will cause collector current to flow, right? Can anybody please explain how you do that: bias the transistor so that it just doesn't conduct, independent of temperature variations and such? Or is this the wrong approach?
Electronic – detecting low signal levels with a transistor
amplifiertransistors
Related Solutions
You can do this a number of ways. I usually drive transistors in common-emitter mode when using them as switches. The emitter of the NPN transistor goes to the common (ground) rail, the collector to the cathode of the LED and then a current limiting resistor to B+. The transistor will turn on when the base voltage is approximately 0.7V above the emitter voltage. Use a resistor on the base of the transistor (to the I/O pin) since BJTs are current controlled devices.
When the I/O line goes high (say +5V), you will have 5V across the resistor and the B-E junction of the transistor. The transistor B-E junction will drop 0.7V with the remainder (4.3V) across the resistor. Say you use 1k for the base resistor. This will give you 4.3/1000 or 4.3mA of base drive current. This is TONS of current, and since the B-E junction is forward-biased it will amplify the base current by the gain of the transistor (usually between 50 and 200) and limit the C-E current to this level. (When using transistors as switches you usually don't care about the actual collector current, you just want to make sure the transistor is allowing much more current than you will actually draw.) The end result is that the transistor is fully on and your LED will light, limited by the series resistor you chose to limit the LED current to something like 10-20mA.
When the I/O line is low, the B-E junction has no appreciable voltage across it and the transistor is considered "off." I like to include a 4.7k-ish resistor between the base and emitter to make sure that the transistor doesn't accidentally switch on due to noise or a floating I/O pin.
This basic NPN switch circuit works well as long as your C-E voltage is under about 30V and your load is mainly resistive and relatively low current (under a few Amps). When you're trying to control higher voltages you have to start looking at either more specialized (high voltage) transistors or more complex drive circuits. When driving inductive loads (relays, motors, etc.) you need to protect the transistor from the inductive kickback that occurs when current stops flowing through an inductor. When driving high current loads you may have to again look at specialized transistors or more complex drivers to ensure the transistor remains fully switched-on.
If your load must be connected to common (instead of the transistor emitter) then you can use a PNP transistor. Emitter to B+, collector to the LED anode, LED cathode to a current limit resistor and the other end of the resistor to common. Now a logic '1' should turn the LED off and a logic '0' should turn it on, but you've got a problem. The problem is that your I/O line cannot turn the transistor off, because the highest voltage it can reach is 5V (in our example). This would maintain 1V across the B-E junction and the transistor would remain on, even only if partially on. In this case I like to "cheat". You can turn the I/O line into an input to turn the transistor off (remember I like to have a 4.7kish resistor between the base and emitter). This is not ideal because it slows down your turn-off (which may or may not be a problem) but also because you now have (in this example) 6V going to an I/O line. It may not be able to withstand this kind of voltage and you can damage the line or the internal protection circuitry on the input. What I do to mitigate the problem is to use an NPN transistor to turn on the PNP transistor. This doesn't solve the turn-off problem but for most general cases it's nothing to worry about.
So from this plot it looks like it's about 2.9K. Is this correct?
Yes
Obviously with the bias high enough the impedance of the transistor is 0 - it's just a diode. Right?
Probably not. The diode model probably includes parasitic resistance in the base and emitter contacts, so the input resistance will never go all the way to zero. Also, your R3 (multiplied by the transistor beta) will set a lower limit on how low a resistance you measure looking in to the base of the transistor in your circuit.
Best Answer
You're probably thinking of the common emitter circuit which is typically used for a switching transistor, i.e. with the emitter directly to ground. This is OK for switching, where two extreme states occur: one where there's no base current (base voltage is 0V) and one where there's a set base current of several mA to saturate the transistor.
Now suppose you place a resistor between the emitter and ground, R2 in the schematic below:
This resistor provides negative feedback, which stabilizes the circuit. A small increase in base current, for instance because of temperature changes, will cause a large change in base voltage. That's because the extra base current isn't the only current flowing through R2, there's also \$I_C\$, which is \$H_{FE}\$ larger than \$I_B\$. This higher current will cause a large voltage drop across R2, in turn causing the base voltage to increase by the same amount.
Example: R2 = 10\$\Omega\$, \$H_{FE}\$ = 100, \$I_B\$ = 1mA. Then
If for some reason the base current would rise by just 10\$\mu\$A, then
so the base voltage will also rise by 10mV, which would counteract the current rise. This effect will be stronger when R2 is larger.
edit
Now place a capacitor parallel to R2. That means that the impedance between emitter and ground is (much) lower than R2 for AC signals. So for AC the negative feedback is not as high, and the signal will be properly amplified, while the DC setting remains stable.