A typical application of triode switching circuits is to drive some power devices, such as relays, relays drive current generally needs 30mA or more, driving voltage is mostly higher than MCU working voltage, common 5V, 12V. Because the relay current and voltage requirements are relatively high, it cannot be directly driven by the IO port of the single-chip microcomputer, so it is necessary to add a driving circuit. Transistors are often used to drive relays, and common circuits are as follows:
When the base input of transistor T1 is high, the transistor saturation is turned on and the collector becomes low, so the relay coil is energized and contact RL1 is closed.
When the base input of transistor T1 is low, the transistor is cut-off, the relay coil is de-energized, and contact RL1 is disconnected.
The role of each component in the circuit:
Transistor T1 can be regarded as a control switch, and the magnification β is generally selected between 120~240. Resistor R1 mainly acts as a current limiting to reduce the power dissipation of transistor T1. Resistor R2 reliably cut-off transistor T1. Diode D1 reverses freewheeling to suppress surges.
In the following simulation diagram, R3 simulates a load with an operating current of 50mA.
According to the Q1 specification, the DC magnification (n) is 100 times, so Q1 needs to work in the saturated state, even if the VCE is less than VBE, it is necessary to ensure that IB*n> IC, that is, IB requires at least 0.5mA. But it should not be too large, otherwise the power consumption of Q1 will increase.
The parameters shown in the figure below show that IB is 2.5mA larger. According to the following calculation method, a reasonable size of the current limiting resistor R1 can be calculated.
Since the VBE is about 0.7V after Q1 is turned on, it can be seen that the current on R2 is 0.7/10K=70uA, and IB has previously calculated that 500uA is needed to ensure that the IC can > =50mA。
Therefore, the current flowing through R1 is 570uA.
Therefore, R1=(3.3V-0.7)V/0.57mA=4.56K ohms, take 4.5K
After adjusting R1, the base current is reduced to 500uA, while the IC does not decrease. However, the power consumption of Q1 is reduced.
Depending on the load R3 resistance and the driving voltage V2, as well as the control voltage V1, the R1 resistance needs to be recalculated to achieve the best effect. Circuit parameters are not set in stone.