Share this article to summarize the use and connection methods of NPN and PNP transistors.
In the microcontroller application circuit, the main function of the transistor is switching.
How to use PNP and NPN transistors
In the above picture, the pin on the left side is called the base b, the one with an arrow is the emitter e, and the remaining pin is the collector c.
First, let’s talk about the NPN type. When this type of transistor is used in a switching state, the emitter is mostly grounded, the collector is connected to a high level, and the base is connected to a control signal.
Secondly, for PNP transistors, when used in a switching state, the emitter is generally connected to a high level and the base is connected to a control signal. When the transistor is turned on, current flows from the emitter to the collector.
The switching principle of transistor
The transistor has three working states: cutoff, amplification, and saturation.
The amplified state is mainly used in analog circuits, and its usage and calculation methods are relatively complicated, so we will not use it for the time being.
Digital circuits mainly use the switching characteristics of transistors, and only use two states: cutoff and saturation.
The key point of the usage characteristics of the transistor lies in the voltage between the b-pole (base) and the e-pole (emitter). For PNP, as long as the e-pole voltage is higher than the b-pole by more than 0.7V, the e-pole and c-pole of the transistor can be smoothly connected.
Similarly, the conduction condition for the NPN transistor is that the voltage at the b pole is 0.7V higher than that at the e pole.
In short, if the starting end of the arrow is 0.7V higher than the end, the e and c poles of the transistor can be turned on.
Taking the PNP transistor in the above figure as an example, the base is connected to an IO port of the microcontroller through a 10K resistor, assuming it is P1.0, the emitter is directly connected to a 5V power supply, the collector is connected to a small LED lamp, and a 1K current limiting resistor is connected in series and finally connected to the negative pole of the power supply GND.
If P1.0 is given a high level 1 by our program, then there will be no 0.7V voltage drop from e to b. At this time, the emitter and collector will not be turned on. Then, looking vertically, the circuit is disconnected at the transistor, no current flows, and the LED2 light will not light up.
If the program gives P1.0 a low level of 0, then the e pole is still 5V, so there is a voltage difference between e and b, and the transistors e and b are turned on. There is about a 0.7V voltage drop between the transistors e and b, and there is a (5-0.7)V voltage on the resistor R47. At this time, e and c are also turned on, so the LED light itself has a 2V voltage drop, and the transistor itself has a 0.2V voltage drop between e and c, which we ignore. Then there will be about a 3V voltage drop on R41, and it can be calculated that the current of this branch is about 3mA, which can successfully light up the LED.
Transistor saturation state
The last concept is current control. As mentioned before, transistors have three states: cutoff, amplification, and saturation. If we want to make the transistor in saturation, which is what we call switching characteristics, a condition must be met. All transistors have an amplification factor β. To be in saturation, the current at the b pole must be greater than the current value between e and c divided by β. This β can be considered to be 100 for commonly used transistors.
Then we have to calculate the resistance of R47 above. We have just calculated that the current between e and c is 3mA, so the minimum current of the b pole is 3mA divided by 100, which is equal to 30uA. About 4.3V voltage will fall on the base resistor, so the maximum value of the base resistor is 4.3V/30uA = 143K. The resistance value can be smaller than this value, but it cannot be too small. If it is too small, the current of the IO port of the microcontroller will be too large and burn out the transistor or microcontroller.
丨The article is organized to spread relevant technologies, the copyright belongs to the original author丨
丨If there is any infringement, please contact us to delete丨
|