Breadcrumbs

Bipolar Junction Transistors (BJT) as a Switch

By ValkaTR, 8 November, 2022

BJT is a current controlled device, where the output current is controlled by the input current.

In this article I provide formula to calculate base resistor. (and test MathJAX)

NPN transistor as a Switch wiring diagram

Voltage drop for red light emitting diode is 2,0 V. We also have to take into account voltage drop of the transistor. So current limiting resistor RD for LED is:

$$ R_D = \frac{U_{CC} - U_D - U_{CE}}{I_D} = \frac{5,0 \, \mathrm{V} - 2,0 \, \mathrm{V} - 0,7 \, \mathrm{V}}{20 \, \mathrm{mA}} = 115 \, \mathrm{\Omega} $$

where

  • RD â€“ load current limiting resistor, Ω;
  • UCC = 5,0 V – supply voltage, V;
  • UD = 2,0 V – light emitting diode voltage drop, V;
  • UCE = 0,7 V – transistor voltage drop between collector and emitter, V;
  • ID = 0,02 A – recommended current for a red general purpose LED, A.


Standard nominal resistance of current limiting resistor RD should be picked in increasing direction, because we don't want to exceed 20 mA current limit. It is 120 Ω. Let's check what current will actually be with standard resistor:

$$ I_D = \frac{U_{CC} - U_D - U_{CE}}{R_D} = \frac{5,0 \, \mathrm{V} - 2,0 \, \mathrm{V} - 0,7 \, \mathrm{V}}{120 \, \mathrm{\Omega}} = 19,2 \, \mathrm{mA} $$

Roughly estimate the base current. General purpose PNP transistors have DC gain around hFE = 100. It depends on the load and can be clarified in the datasheet of the transistor. For 2N2222 it is 75 at IC = 10 mA and UCE = 10 V.

$$ I_B = \frac{I_D}{h_{FE}} = \frac{19,2 \, \mathrm{mA}}{75} = 0,256 \, \mathrm{mA} $$

where

  • IB â€“ base current, A;
  • hFE – DC current gain of the transistor.


Now the base resistor:

$$ R_B = \frac{U_{CC} - U_{BE}}{I_B} = \frac{5,0 \, \mathrm{V} - 0,7 \, \mathrm{V}}{0,256 \, \mathrm{mA}} = 16,8 \, \mathrm{k \Omega} $$

where

  • RB – base resistor, Ω,
  • UBE = 0,7 V – base-emitter voltage drop, V.


When selecting the base resistor, it should be a bit less, than calculated. Because if the transistor doesn't close fully, then it will heat excessively. Closest standard resistor nominal in decrease direction is 16 kΩ. Let's recalculate the base current:

$$ I_B = \frac{U_{CC} - U_{BE}}{R_B} = \frac{5,0 \, \mathrm{V} - 0,7 \, \mathrm{V}}{16 \, \mathrm{k \Omega}} = 0,269 \, \mathrm{mA} $$

Make sure that the base current doesn't exceed transistor limit. Also need to check power dissipation of all the components in this circuit:

$$ P_{RD} = I_D^2 R_D = (19,2 \, \mathrm{mA})^2 \cdot 120 \, \mathrm{\Omega} = 44,2 \, \mathrm{mW} $$

$$ P_{RB} = I_B^2 R_B = (0,269 \, \mathrm{mA})^2 \cdot 16 \, \mathrm{k \Omega} = 1,16 \, \mathrm{mW} $$

$$ P_{VT1} = P_{BE} + P_{CE} = U_{BE} I_B + U_{CE} I_C = $$

$$ = 0,7 \, \mathrm{V} \cdot 0,269 \, \mathrm{mA} + 0,3 \, \mathrm{V} \cdot 19,2 \, \mathrm{mA} = 188 \, \mathrm{\mu W} + 5,76 \, \mathrm{mW} = 5,95 \, \mathrm{mW}  $$

where

  • PRD â€“ heat power dissipation of current limiting resistor for the load, W.
  • PRB â€“ heat power dissipation of current limiting resistor for the base of the transistor, W.
  • PVT1 â€“ heat power dissipation of the transistor, W.


When buying the current limiting resistor for the load, it should be able to handle heat power dissipation of 44,2 mW. The same goes for base resistor and the transistor itself.

Datasheets:

Download Diotec Semiconductor - 2N2222A - General Purpose NPN Transistor 40V 600mA datasheet.

Download CML Innovative Technologies - LED Indicator 8mm datasheet.


2N2222 datasheet - page1.png
2N2222 datasheet - page2.png
CML LED indicator datasheet.png

 

Comments