Skip to content
UPEEC

BJT as a Switch

Drive a load from a microcontroller pin by saturating an NPN transistor.

Easy
Comments 0
          +12 V
            │
          Load (relay/LED strip)   ← flyback diode across inductive loads
            │
MCU ──[ Rb ]── B   NPN
               E
               │
              GND
  1. Load current, e.g. ICI_C = 200 mA.
  2. Required base current with margin: use a "forced β" of 10–20 → IBI_B ≈ 10–20 mA (check the pin can supply it).
  3. RB=Vpin−VBEIB=3.3−0.70.013≈200R_B = \dfrac{V_{pin} - V_{BE}}{I_B} = \dfrac{3.3 - 0.7}{0.013} \approx 200 Ω.

The transistor then saturates and dissipates only VCE(sat)×ICV_{CE(sat)} \times I_C. For larger currents a logic-level MOSFET is usually better.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.