Hardware Academy
Semiconductors

Transistors: BJT and MOSFET

How a gate voltage opens a channel, and why MOSFETs run the world.

Day 2 · 55 min

After this lesson

  • You can describe BJT and MOSFET operation and their three regions.
  • You can choose a logic-level MOSFET to switch a load from a 3.3 V microcontroller.
  • You can explain Rds(on), gate charge, the body diode and why a 'hot but on' MOSFET happens.

A valve for electrons

A transistor lets a small signal control a large current, so it can amplify or switch. John Bardeen and Walter Brattain built the first one, a germanium point-contact device, at Bell Labs in December 1947; William Shockley's junction transistor followed in 1948, and Mohamed Atalla and Dawon Kahng demonstrated the MOSFET in 1959. The bipolar transistor survives in analog and RF niches, while MOSFETs are essentially every transistor in a processor: an estimated 1.3 × 10²² had been made by 2018, more than any other manufactured object.

The bipolar junction transistor

An NPN BJT is two junctions back to back: a heavily doped n⁺ emitter, a thin p-type base (well under 1 µm in modern parts) and an n-type collector. Forward-bias the base-emitter junction, Vbe ≈ 0.6-0.7 V at milliamp currents, and the emitter injects electrons into the base. The base is so thin that about 99% of them diffuse across before recombining, and the reverse-biased collector junction sweeps them up. The small base current that does flow sets the collector current: Ic = β · Ib, with β (also written hFE) between 50 and 300. A 2N3904 specifies 100-300 at 10 mA.

  • Cutoff: Vbe below about 0.5 V; no collector current.
  • Active: Vce above about 0.3 V and Ic = β·Ib; Ic rises tenfold per 60 mV of Vbe. Amplifiers live here.
  • Saturation: both junctions forward-biased, Vce(sat) ≈ 0.1-0.2 V; a closed switch. Designers overdrive the base with a forced β of about 10 to get there reliably.

The catch is that a BJT needs base current the whole time it is on: 10 mA of collector current at β = 100 takes 0.1 mA of continuous drive, and β itself varies two to three times between parts.

The MOSFET

An n-channel MOSFET (NMOS) starts with a p-type body. Two n⁺ regions, the source and drain, sit a channel length L apart, and above the gap lies a gate electrode separated from the silicon by a thin insulator: SiO₂, or hafnium oxide with an equivalent thickness near 1 nm in modern logic, or tens of nanometres in power MOSFETs. Because the gate is insulated it draws essentially no DC current; the MOSFET is controlled by voltage.

With Vgs = 0 the source-body-drain path is two back-to-back diodes and nothing flows. Raise Vgs and the gate field first pushes holes away from the surface, then pulls electrons in. At the threshold voltage Vth the surface inverts: electrons outnumber the body's holes and form a channel a few nanometres deep from source to drain. Vth is about 0.3-0.5 V in logic transistors, 1-2 V in logic-level power MOSFETs and 2-4 V in standard power parts.

Labelled cross-section of an n-channel MOSFETn⁺ sourcen⁺ draingate (poly-Si or metal)SDGB (body), usually tied to Sgate oxide: ~1 nm (logic) to ~50 nm (power)inversion channel, a few nm deep (Vgs > Vth)depletion edgep-type bodychannel length L
An n-channel MOSFET. A positive gate voltage above Vth inverts the surface of the p-type body into an electron channel that connects the n⁺ source and drain.

Three regions

  • Cutoff (Vgs < Vth): no channel. Only subthreshold leakage flows, falling about tenfold for every 70-100 mV below Vth.
  • Triode or linear (Vds < Vgs − Vth): the channel reaches the drain and acts as a resistor set by the gate, I_D = μCox(W/L)[(Vgs − Vth)Vds − Vds²/2]. A switch should sit here.
  • Saturation (Vds ≥ Vgs − Vth): the channel pinches off near the drain and the current levels out at I_D = ½ μCox(W/L)(Vgs − Vth)². Amplifiers live here.

Mind the vocabulary: "saturation" means a fully-on switch for a BJT but the constant-current region for a MOSFET.

MOSFETs as switches

Three datasheet numbers matter. Rds(on) is the channel resistance when fully on, specified at stated gate voltages: the IRLML6344 is rated 29 mΩ at Vgs = 4.5 V and 37 mΩ at 2.5 V. Conduction loss is I²·Rds(on), and Rds(on) rises about 1.5× between 25 °C and 125 °C. Vgs(th) is defined at a tiny current, typically 250 µA: it marks where conduction starts, not where the part is on. Gate charge Qg is what the driver must deliver: 10 nC from an MCU pin sourcing 20 mA takes 0.5 µs, while a 2 A gate driver does it in 5 ns. Logic-level parts guarantee Rds(on) at 4.5 V or 2.5 V so a microcontroller can drive them directly.

MOSFETs won for three reasons. They are voltage-controlled, so a gate holding a logic state draws no static current. They shrink well: Robert Dennard showed in 1974 that scaling dimensions and voltages together keeps power density constant while speed rises. And n- and p-channel devices sit side by side in one process, which makes CMOS logic possible. BJTs remain in precision analog circuits such as bandgap references, in RF as SiGe heterojunction transistors, and, with a MOS gate added, as the IGBTs in many high-power inverters.

Power MOSFETs and gate driving

A discrete power MOSFET turns the structure on its side. Current flows from source contacts on top through thousands of channel cells in parallel (planar or trench), then down through a lightly doped n⁻ drift region to the drain on the back of the die. The drift region sets the voltage rating and the parallel cells give milliohm resistance. Because the p-body is tied to the source, every power MOSFET also contains a body diode from source to drain. It conducts whenever the drain is pulled below the source, which H-bridges use for freewheeling, and it has the reverse recovery of any PN diode.

The gate is a capacitor of a few nanocoulombs, so a good drive circuit has a series resistor of a few to tens of ohms to tame ringing, a 10-100 kΩ pull-down to keep the part off while the microcontroller is still in reset, and enough voltage to reach the Rds(on) rating without exceeding the absolute maximum Vgs, typically ±20 V, or ±12 V for many logic-level parts.

Interactive: open the channel

NMOS transistor: gate opens a channel

Raise V_GS past the 1.5 V threshold and an electron channel forms under the gate (brighter means more electrons). Raise V_DS and the channel thins toward the drain until it pinches off: the current stops growing and the transistor saturates.

NMOS cross-section at V_GS 3.00 V and V_DS 2.00 V, region Saturationp-type bodydepletion edgen⁺ sourcen⁺ drainpinch-offgateS · 0 VD · 2.00 VG · 3.00 VB (body) · 0 VSaturation1234551015I_D (mA)V_DS (V)3 V4 V5 Vtriodesaturationdashed: V_DS = V_GS − V_th
Region
Saturation
Drain current I_D
2.43 mA
Overdrive V_GS − V_th
1.50 V
On-resistance at small V_DS, 1/(k·V_ov)
333 Ω
Power in the channel V_DS·I_D
4.86 mW
Threshold V_th, gate current
1.50 V, ≈ 0 (insulated gate)

Things to try:

  • Hold V_DS at 0.5 V and raise V_GS from 1.5 V to 5 V: the on-resistance falls from kilohms to 143 Ω.
  • At V_GS = 3 V, sweep V_DS: the current rises until 1.5 V, then flattens as the channel pinches off at the drain.
  • Compare the channel power at V_GS = 5 V, V_DS = 0.5 V (triode, about 1.7 mW) with V_GS = 2.5 V, V_DS = 5 V (saturation, about 6 mW): the half-on transistor passes less current yet burns more than three times the power.

In practice

Practice

Pick a MOSFET for a 2 A motor on a 3.3 V microcontroller

A 12 V DC motor draws 2 A while running and is switched by a 3.3 V GPIO. Choose a low-side N-channel MOSFET, estimate its loss, and list the parts around it.

text
Requirements
  Vds rating      ≥ 2 × 12 V             → 30 V class
  Gate            Vgs(th) max < 2 V, Rds(on) specified at Vgs = 2.5 V
  Current         ≥ 2 × running current, survive the stall current

Candidate: IRLML6344 (30 V, 5 A, SOT-23, Vgs(th) 0.5-1.1 V)
  Rds(on) at 2.5 V  = 37 mΩ max
  P (25 °C)          = I² × R = 2² × 0.037 = 0.15 W
  P (hot, ×1.5)      = 0.22 W
  ΔT (~100 °C/W pad) ≈ +22 °C

PWM at 20 kHz, Qg ≈ 5 nC from a 20 mA pin → edges ≈ 0.25 µs
  P_sw ≈ ½ × V × I × (t_r + t_f) × f = ½ × 12 × 2 × 0.5e-6 × 20e3 = 0.12 W

Answer: a logic-level 30 V part such as the IRLML6344 dissipates about 0.15-0.22 W in conduction, comfortable on a SOT-23 with a modest copper pad. Add a Schottky flyback diode across the motor, a 100 Ω gate resistor and a 100 kΩ pull-down. For on/off control or PWM up to a few kHz the GPIO can drive the gate directly; at 20 kHz switching loss rivals conduction loss, so a small gate driver earns its place. If the motor can stall at 6 A, conduction loss jumps ninefold, so size for stall or add current limiting.

Real-world scenario

Real-world scenario

The MOSFET is 'on' but too hot to touch

A greenhouse controller uses an ESP32 to switch a 12 V, 2 A irrigation pump. The designer picked an IRF540N from the parts drawer (100 V, 33 A, 44 mΩ) and drove its gate straight from a 3.3 V GPIO. On paper the loss is 2² × 0.044 = 0.18 W, so no heatsink was fitted. Within two minutes of the pump starting, the TO-220 tab is too hot to touch.

Symptoms

  • The tab reaches about 110 °C in a 25 °C room; the datasheet math predicted a barely warm part
  • Vds measures 0.7 V with the gate high, instead of the expected 0.09 V
  • The pump runs noticeably slower than when wired straight to 12 V
  • The same board driven from a 5 V Arduino runs much cooler, and two boards built from the same reel behave differently

Interview questions

screenHow does an n-channel MOSFET turn on?
An NMOS has n⁺ source and drain regions in a p-type body, with a gate electrode separated from the silicon by a thin oxide. With no gate voltage the path is two back-to-back p-n junctions, so no current flows. A positive gate voltage first pushes holes away from the surface and then pulls electrons in, and above the threshold voltage the surface inverts into a thin n-type channel connecting source and drain. Because the gate is insulated it draws essentially no DC current, so the MOSFET is controlled by voltage, not current.
screenWhat are the operating regions of a MOSFET, and which do you use for a switch and for an amplifier?
Below threshold the device is in cutoff, with only subthreshold leakage that falls about tenfold per 70-100 mV. With Vgs above threshold and Vds below the overdrive Vgs − Vth, it is in the triode or linear region and behaves like a resistor set by the gate. When Vds exceeds the overdrive, the channel pinches off at the drain and the current saturates at about ½μCox(W/L)(Vgs − Vth)². Switches should sit deep in the triode region with a low Rds(on), while amplifiers sit in saturation, where the gate voltage sets the current.
deepYou need to switch a 2 A motor from a 3.3 V microcontroller. How do you choose the MOSFET, and what can go wrong?
I start with the gate drive I actually have, so I want a logic-level part with Rds(on) specified at 2.5 V and a Vgs(th) maximum well below that, such as 1-2 V. Then I size Vds at about twice the supply, so 30 V for a 12 V motor, and check the I²R loss: 2 A through 37 mΩ is 0.15 W, about 0.22 W hot, which a SOT-23 handles on a decent copper pad. I add a flyback diode across the motor, a small gate resistor and a 100 kΩ pull-down so the motor cannot twitch during reset. The classic mistake is a standard 10 V part driven at 3.3 V, which sits half on in the linear region and cooks; for fast PWM, gate charge and switching loss also start to matter, and a gate driver becomes worthwhile.
deepCompare BJTs and MOSFETs. Why did MOSFETs win for digital logic, and where are BJTs still used?
A BJT is current-controlled, with Ic = βIb, and it needs base current the whole time it is on, while a MOSFET's insulated gate draws essentially no static current. That matters enormously for logic: a CMOS gate holding a state burns almost nothing, and MOSFETs scale geometrically, so Dennard scaling let each generation shrink dimensions and voltages together. NMOS and PMOS devices also sit side by side in one process, which makes CMOS possible. BJTs remain in precision analog circuits such as bandgap references, in RF as SiGe heterojunction transistors, and combined with a MOS gate as the IGBTs in many high-power inverters.
screenWhat is the body diode of a power MOSFET, and when does it matter?
In a vertical power MOSFET the p-body is shorted to the source to stop the parasitic bipolar transistor from turning on, and that leaves a p-n diode from source to drain. It conducts whenever the drain is pulled below the source, for example during dead time in an H-bridge, where it carries the inductive freewheeling current. It has a forward drop around 0.7-1 V and real reverse recovery, which adds switching loss, so synchronous designs turn the channel on to bypass it. It also means a single MOSFET cannot block current in both directions, which is why reverse-polarity and load-switch circuits often use two back to back.

Quiz

1. An NPN transistor with β = 100 has a base current of 50 µA in the active region. What is the collector current?
2. An NMOS with Vth = 1.5 V has Vgs = 3 V and Vds = 0.5 V. Which region is it in?
3. With I_D = ½·k·(Vgs − Vth)², k = 2 mA/V² and Vth = 1.5 V, what is the saturation current at Vgs = 3.5 V?
4. A datasheet lists Vgs(th) = 1.0-2.0 V at I_D = 250 µA. What does that tell you?
5. A MOSFET with Rds(on) = 20 mΩ carries 5 A. What is its conduction loss?
6. Why does every vertical power MOSFET contain a body diode?
7. A MOSFET has a total gate charge of 20 nC and is driven by an MCU pin that can source about 20 mA. Roughly how long does a switching edge take?

References and further reading

Where the ideas in this lesson come from, and what to read next. Books are the standard texts; papers are the original sources; standards are what employers work to.

  1. Documentationfree online

    Fairchild Semiconductor, now onsemi (2014). PN2222A: NPN General-Purpose Amplifier (datasheet, Rev. 1.1.0). onsemi.com.

    Read: The same part number family with the opposite E-B-C order; the reason to check every TO-92.

  2. Documentationfree online

    onsemi (2013). P2N2222A: Amplifier Transistors, NPN Silicon (datasheet, Rev. 7). onsemi.com.

    Read: The pinout page: the P2N2222A is C-B-E, and the encyclopedia drawing follows it.

  3. Paper

    John Bardeen and Walter H. Brattain (1948). The Transistor, A Semi-Conductor Triode. Physical Review 74(2), 230-231.doi:10.1103/PhysRev.74.230

    Read: One page: the first transistor announcement.

  4. Paper

    Dawon Kahng and Mohamed M. Atalla (1960). Silicon-Silicon Dioxide Field Induced Surface Devices. IRE-AIEE Solid-State Device Research Conference, Pittsburgh.

    Read: The first MOSFET; cite it when asked who invented the device.

  5. Book

    Adel S. Sedra and Kenneth C. Smith (2020). Microelectronic Circuits. Oxford University Press, 8th edition.

    Read: The MOSFET chapter: threshold, the three regions, the switch model.

  6. Book

    S. M. Sze and Kwok K. Ng (2007). Physics of Semiconductor Devices. Wiley, 3rd edition.

    Read: Power MOSFET structure and the body diode.