Transistors

Transistors are the fundamental active component in electronics. Every logic gate, amplifier stage, and memory cell is built from transistors. They do two things: switch and amplify. Understanding the basic types and how to use them in simple circuits unlocks most of practical electronics design. The two major families you'll encounter are BJTs and MOSFETs — different physics, different strengths.

BJTs — Bipolar Junction Transistors

A BJT has three terminals: Base, Collector, Emitter. A small current into the base controls a larger current between collector and emitter. The ratio of collector current to base current is the current gain β (beta or hFE), typically 50–300.

PolarityHow it turns onCurrent directionCommon parts
NPNPositive voltage at Base (relative to Emitter)Collector → Emitter2N2222, 2N3904, BC547, TIP31
PNPBase pulled low (relative to Emitter)Emitter → Collector2N2907, 2N3906, BC557, TIP32

BJT Operating Regions

RegionConditionBehaviourUse
CutoffVbe < 0.6V, no base currentTransistor fully off — acts like open circuitSwitch in OFF state
Active (linear)Vbe ≈ 0.7V, base current controlledIc = β × Ib — linear amplificationAmplifier stages
SaturationVbe > 0.7V, base driven hardVce ≈ 0.2V, transistor fully onSwitch in ON state

NPN as a Switch

To turn the NPN transistor ON, you must provide enough base current to guarantee saturation (fully on). To turn it OFF, you remove the base current.

Calculating the base resistor:
Example: switching 100mA load, β = 100
Minimum Ib = Ic / β = 100mA / 100 = 1mA
Target Ib = 10mA (overdrive for reliable saturation)

Control voltage = 5V, Vbe = 0.7V
R_base = (5V - 0.7V) / 10mA = 430Ω → use 470Ω or 560Ω

MOSFETs — Metal-Oxide-Semiconductor FETs

MOSFETs have Gate, Drain, Source terminals. They're voltage-controlled — a voltage on the Gate controls current between Drain and Source with essentially zero gate current. This makes them more efficient as switches than BJTs.

TypeTurns on whenUse caseCommon parts
N-channel enhancementVgs > Vth (gate above source)Low-side switching (load between VCC and drain)2N7000, IRF540N, IRLZ44N
P-channel enhancementVgs < Vth (gate below source)High-side switching (load between drain and GND)IRF9540N, SI2307

N-Channel MOSFET as a Switch

For logic-level control from a 3.3V or 5V microcontroller, use a logic-level MOSFET with Vth well below your control voltage. Standard power MOSFETs often need 8–10V on the gate to fully turn on — they won't work reliably directly from a GPIO pin.

BJT vs MOSFET low-side switches Side-by-side schematic diagrams of an NPN BJT and an N-Channel MOSFET used as low-side switches with flyback diodes across inductive loads. BJT (Current Controlled) VCC Load Flyback NPN R_base GPIO Ib (mA) Ic = β × Ib MOSFET (Voltage Controlled) VCC Load Flyback N-Ch GPIO Vgs > Vth Id (Amps) Ig ≈ 0
Low-side switching. The BJT needs continuous base current (Ib) limited by a resistor to saturate. The MOSFET needs only a gate voltage (Vgs) above its threshold (Vth) and draws practically zero continuous current. Both need a flyback diode to clamp inductive voltage spikes when turning off loads like motors or relays.

BJT vs MOSFET — Comparison

PropertyBJTMOSFET
Control typeCurrent (base current required)Voltage (no gate current in DC steady state)
Input impedanceLow (base-emitter junction ~0.7V drop)Very high (gate is insulated)
On-resistanceVce_sat ≈ 0.2V (moderate loss)RDS_on can be milliohms (very low loss)
Switching speedSlower (charge storage in base)Faster, especially at high frequencies
Parallel operationDifficult (thermal runaway risk)Easy (positive temperature coefficient for RDS_on)
Best forLinear amplifiers, audio, precision analogPower switching, motor control, digital logic
Drive complexitySimple — just enough base currentGate capacitance matters at high frequency; needs gate driver for fast switching

Common Part Numbers and Specs

PartTypeIc / Id maxVce / Vds maxNotes
2N3904NPN BJT200 mA40 VClassic small-signal NPN. Everywhere.
2N3906PNP BJT200 mA40 VComplement to 2N3904
2N2222ANPN BJT600 mA40 VSlightly higher current than 2N3904
TIP31CNPN BJT3 A100 VPower transistor, TO-220 package
2N7000N-ch MOSFET200 mA60 VSmall signal, logic-level gate
IRLZ44NN-ch MOSFET47 A55 VLogic-level, low RDS_on — good for 5V Arduino projects
IRF540NN-ch MOSFET33 A100 VPower switching, requires 10V+ gate drive

Darlington Pairs

Two BJTs cascaded so the first drives the second — the combined gain is β₁ × β₂, which can reach several thousand. Useful when driving a high-current load from a very small signal (e.g., a microcontroller output driving a large relay):

Darlington Pair Two NPN transistors Q1 and Q2. The emitter of Q1 drives the base of Q2. Their collectors are tied together and connected to the load. Q2's emitter is grounded. VCC Load (high-current) Q2 C B E Q1 C B E Control signal
Darlington pair: Q1’s emitter drives Q2’s base while their collectors share the load, multiplying the two NPN transistors’ current gain.
Combined β ≈ β1 × β2 (e.g., 100 × 100 = 10,000)

The ULN2003 and ULN2803 ICs are arrays of 7–8 Darlington drivers in a single package, each capable of 500 mA. The downside: higher saturation voltage (~1.2–1.5V instead of 0.2V), which means more power loss.

Safe Operating Area and Heat

Both BJTs and MOSFETs have a Safe Operating Area (SOA) — a region of voltage and current they can handle simultaneously without damage. At high current AND high voltage, even a brief spike can destroy the transistor. For power applications:

  • Attach a heatsink when the case temperature will rise more than 20–30°C above ambient
  • Use thermal paste between the transistor and heatsink
  • Add a flyback diode across any inductive load (relay, motor) to suppress voltage spikes when switching off

References