Welcome back to Electronics, this is Dr. Robinson. In this lesson we are going to look at a bipolar junction transistor used as an electronic switch. In the previous lesson, we examined the parameters of a BJT. And our objectives for this lesson are to introduce the BJT switch. Let's look at a schematic that I'm going to use to illustrate how we can use the BJT as a switch. In the circuit Vin acts as a control voltage to determine whether the BJT is off or on. When the BJT is on, current flows around this loop from collector to emitter. When the BJT is off no current flows through this loop. In this loop, the loop through Vin, through RB, and across the base emitter junction, this Pin junction, we can analyze the behavior here using techniques we learned about in our previous diode lectures. Remember, if we forward bias the Pin junction we make Vin greater than about 0.65 or 0.7 volts, then we know that current will flow into the base of the transistor, around this loop. And remember for a BJT in it's active region, IC is equal to beta IB. So if we've made Vin large enough to forward bias this junction to cause base current to flow, then we know that collector current will flow. And we have turned the transistor on, so current is now flowing around this loop. And we know this behavior to be true from our examination previously of the EJT transfer characteristics. If Vin is small, then VB is small, the transistor is off, and no collector co, current flows. IC is equal to zero. But if we make Vin large enough, then IC is non-zero, and the transistor turns on. Now let's look at how the voltage here at the collector, VCE varies with changing, changes in Vin. When Vin is small, we know that no base current flows, so no collector current flows. The transistor is in its cutoff region, and the voltage drop across RC, given by ICRC is equal to 0. So when Vin is equal to 0, the voltage here is equal to the voltage here, is equal 12 volts. But as we increase the Vin and we increase th Ic the voltage drop across this resistor increases, causing the value of VCE to decrease. So let's plot this behavior on the outlet characteristic curves of the BJT. When Vin is equal to 0, we know the transistor is in it's cut off region, along this red line, and the voltage VCE is equal to 12 volts, approximately here. Then as I increase Vin which increases IB will move out of the cut off region in this direction, because remember IB is increasing in this direction. So each one of these curves represents a different, different IB and it increases in that direction. So, as Vin increases, IB increases. But, as IB increases, IC inc, increases, which causes VCE to decrease. So, VCE we're moving in this direction. So, as Vin increases, we move from cutoff, and we move along a line in this direction. And you can imagine that as I continue to increase Vin, we move from the cut-off region, this red line, through the active region, eventually reaching the saturation region, where the transistor is maximally on. The collector current is at its maximum. So when operating the BJT as a switch we typically want to vary the region of operation from cut off to saturation without ever entering the active region. So the control voltage here typically has two possibilities. A say, a small voltage of 0 volts to put the BJT in the cut off region, where no current flows through this loop. And say large voltage of, for example, 5 volts that puts the transistor into the saturation region where the transistor is maximally on and the current is at, at it's maximum. So in this circuit we can control. The behavior of this portion of the circuit by varying the voltage in this portion of the circuit. Now let's look at how IC varies specifically with Vin in the circuit. When Vin is small we know that the junction here is not forward biased and the transistor is off. We're in this region here. So for small Vin no collector current flows. Then as the input voltage becomes larger, collector current begins to flow. And you can see the exponential relationship that we would expect here between Vin and IC. Then if we continue to increase Vin the transistor enters saturation. Where we can model the transistor as approximately a voltage source of 0.2 volts. And then once we're in the saturation region further increases in Vin do not increase the collector current. Now we can calculate the level of this collector current here knowing that the voltage from collector to emitter of the transistor when it's in saturation is about 0.2 volts. So I can write here, that VCC, minus VCE, divided by the resistor, RC, is equal to IC. When the transistors in saturation we know that this is about .3 volts. So I can write that 12 minus 0.2 volts divided by 1K is equal to IC, is equal to about, or is it exactly 11.8 milliamps. And you can see that on the scale, that level of IC is approximately 11.8 milliamps. So here I'm showing a plot of how VCE, the collector emitter voltage for the BJT, varies with changes in Vin. When Vin is small, we know the junction here is not forward biased. So the transistor is in its cutoff region. There's no drop across the resistor RC, so the voltage here, is equal to the voltage here, is equal to 12 volts. But as Vin increases, the transistor turns on. Until we put the transistor in its saturation region of operation. And in this region, we know that the voltage across the transistor is equal to VCE SAT, is equal to approximately 0.2 volts. So here, we can label this as VCE SAT. Or saturation. Is approximately equal to 0.2 volts. Now you can see that it only takes a small change in Vin to move the transistor from it's cut off region here to it's saturation region here. And another thing to notice about the voltage between collector and emitter, is that it has an inverting characteristic. When Vin is small, the voltage output, or the voltage at the collector, is large. But when Vin is large, the collector voltage is small. So, if we thought of this as a circuit where the output is taken at the collector and the input is here then we can consider this circuit to be an inverting circuit or a BJT inverter. So I wanted to show you an example circuit where we use an LED load on the switch and we're going to determine the proper resistor values to have this func, this circuit function correctly. So, our input voltage, you could consider this to be an output from say, a microcontroller, where the input to the microcontroller is a temperature sensor. So say, the temperature is greater than some threshold. Then we'd have the microcontroller put out a high voltage of 5 volts, which would cause this BJT to turn on. Which would cause current to flow in this loop, and have the LED illuminate. The light emitting diode. But if the temperature is less than the threshold determined by our sensor and micro-controller combination, Vin would be equal to 0 volts, the BJT would be off and the LED would not be lit. Now, from the LED data sheet we can find that for a diode current of about 20 milliamps. We have good elimination, or good light output. And we can also see from the data sheet that when the diode is on, that the forward voltage drop across the diode VD is equal to about 1.8 volts. So what I want to do is pick RC such that when the BJT is on or when the switch is in its fully on position, that the current through the diode is 20 milliamps. We know when the BJT is on, that the voltage here is equal to 0.2 volts. So we can write that VCC, the voltage here, minus a diadrop minus the drop across RC, which would be ICRC must be equal to VCE. So to solve this for RC we can write VCC minus VD minus VCE over IC is equal to RC. When the BJT is on we know that VCE is equal to VCE SAT of point 2 volts. So I can write 12 minus 1.8 minus 0.2 divided by the collector current that we want, 20 miliamps. Will give us the value of collector resistor that we need. It turns out to be 500 ohms. So, this resistor value RC of 500 ohms limits the current to 20 milliamps when the BGT is fully on. Now let's look at how we would calculate a value for RB. RB is here to limit the base current into the transistor. And we know that when the transistor is on, this junction is for biased, so the voltage here when the transistor is on, is about 0.7 volts So, I can write here on the base circuit that Vin minus 0.7 volts divided by RB is equal to IB. Now remember, in the active region, IC is equal to beta IB. Now, IB is equal to IC over beta, and if we assume the minimum value of beta for this transistor, is 50, then we know at the verge between the active region and the cut-off region that IB is equal to 20 milliamps. Divided by 50, is equal to 0.4 milliamps. So we can use this value of IB to determine a value of RB here. But typically, when you operate a BJT as a switch, you want to overdrive this transistor to take into account any changes in the load here. So in other words, we put far more base current into the transistor than is required to put the transistor in the saturation region. And a typical overdrive factor is ten. So we let, IB equal 10 times 0.4 milliamps. Is equal to four milliamps. And we use this base current to calculate the value of RB. So we have RB is equal to Vin, which when the transistor is on is 5 volts minus 0.7 divided by 4 miliamps, which gives us a value of 1.1 KM's. So a value of RC equal to 500 Ohms limits the diode current to 20 miliamps and value for RB results in a base current sufficient to put the transistor into the saturation region. So in summary, during this lesson, you were introduced to the BJT switch, and we examined BJT switch characteristics. In our next lesson, we'll examine the BJT used as a common emitter amplifier. So thank you, and until next time.