A GPIO pin drives a MOSFET
What is in this lab?
Chapters build on each other: know the load, pick the switch, drive it properly, then protect it. Every chapter has at least one lab panel you can play with using sliders.
Simulator
Circuit simulator
Drive 12/24 V loads from logic with real parts.
APPApplication circuits: motor, LED, heater, position, pulse
Live simulations: LED dimming, motor, heater, solenoid.
Fundamentals
Know your load: current and power
Steady, peak and RMS current of each load.
02How does a BJT work?
Base current, β, saturation and the load line.
03How does a MOSFET work?
Channel, VGS(th), RDS(on) and the body diode.
04The microcontroller pin: how much can it give?
What a GPIO pin can really source and sink.
04bOutput types: push-pull, open-drain, open-collector, open-emitter
Sinking, sourcing, pull-ups and 24 V sensors.
Driving
Driving a BJT from a microcontroller
Base resistor, forced β and pull-down.
06Driving a MOSFET: gate voltage and resistors
Logic-level parts, gate resistor and pull-down.
07Low-side, high-side, half-bridge, H-bridge
Low-side or high-side, bootstrap and H-bridge.
08Inductive loads and flyback
Turn-off spike, flyback diode, zener and TVS.
Fast switching
The switching instant: gate charge and the Miller plateau
Gate charge, Miller plateau and switching loss.
10Gate drivers, dead-time and layout
Driver ICs, dead-time and ringing.
Protection
Inrush current
Switch-on current, soft start and NTC.
12Overcurrent, short circuit and SOA
Current sensing, fuses, SOA and reverse polarity.
13Heat: losses, thermal resistance, heatsinks
Losses, junction temperature and copper area.
Practice
BJT or MOSFET? First look
| BJT (NPN/PNP) | MOSFET (N/P) | |
|---|---|---|
| Controlled by | Base current (IB) | Gate–source voltage (VGS) |
| Steady drive current | IC/β … IC/10 | ≈ 0 (leakage only) |
| On-state drop | VCE(sat) ≈ 0,05–0,3 V (roughly fixed) | ID · RDS(on) (resistive) |
| Sweet spot | Small currents (< 0.5 A), cheap, turns on at 0.7 V | High current, PWM, low loss |
| Speed limit | Coming out of saturation (storage time) | How fast you charge the gate capacitance |
| Typical mistake | Forgetting the base resistor, too little IB | Choosing a MOSFET that won’t fully turn on at 3.3 V |
Color language
Copper = power
Load current, drain/collector path, losses and heat.
Blue = control
Gate/base signal, the microcontroller side.
Red = danger
Overvoltage, overcurrent, outside SOA, a limit exceeded.
Current animations use conventional current (+ to −). Where electron flow is shown instead, it is labelled.