Transistors as Switches
Drive loads reliably with BJTs and MOSFETs: choose the device, design the gate or base drive, and calculate the switching and conduction losses that decide whether it survives.
Two ways in. Work the material, or if you already know this, go straight to the project and prove it.
Where this sits
How this skill is structured
- 1. Concepts — the ideas stated plainly, with the equations worth memorising.
- 2. Worked example — one real problem solved end to end, numbers included.
- 3. Tool demonstration — do the thing in a real open-source tool.
- 4. Resources — the specific free readings and videos, and what part of each to use.
- 5. Project — built alone, producing something a reviewer can check.
- 6. Competence checklist — what you must be able to do. This is also the audit rubric.
1. Concepts
Read these first. Tick each one when you could explain it to someone else without notes.
2. Worked example
Low-side MOSFET driving a 12 V, 1 A LED strip from a 3.3 V MCU
ProblemA 3.3 V microcontroller GPIO must PWM a 12 V LED strip drawing 1 A at 1 kHz. Choose a MOSFET and design the drive.
- 1Topology: low-side N-channel. Drain to the strip's negative terminal, source to ground, gate to the GPIO.
- 2Gate drive available: 3.3 V. So we need Rds(on) specified at Vgs = 2.5 V or lower. This rules out most 'standard' MOSFETs specified only at 10 V.
- 3Candidate: a logic-level part with Rds(on) max = 40 milliohm at Vgs = 2.5 V (check a real datasheet; many small SOT-23 parts qualify).
- 4Conduction loss at 100% duty: P = I^2 x R = 1^2 x 0.040 = 40 mW. Comfortable.
- 5But Rds(on) rises with temperature, roughly +0.4%/C for silicon. At 100 C junction: 0.040 x (1 + 0.004 x 75) = 52 milliohm. P = 52 mW. Still fine.
- 6Switching loss: at 1 kHz with, say, 200 ns transitions: P = 0.5 x 12 x 1 x 400e-9 x 1000 = 2.4 mW. Negligible at this frequency.
- 7Gate resistor: gate charge Qg = 5 nC (typical small part). Without a resistor the GPIO would try to source Qg/t. A 100 ohm series resistor limits peak gate current to 3.3/100 = 33 mA, within GPIO limits, and gives a turn-on time of roughly Rg x Ciss ~ 100 x 500 pF = 50 ns. Acceptable.
- 8Gate pull-down: 100 k from gate to source, so the strip is off while the MCU is in reset.
- 9Thermal: total 55 mW in an SOT-23 with Rth(j-a) = 250 C/W gives a 14 C rise. Tj = 25 + 14 = 39 C. Safe with large margin.
- 10The LED strip is not purely resistive but it is not inductive either, so no flyback diode is needed. If this were a motor or relay, one would be mandatory.
AnswerLogic-level N-channel MOSFET with Rds(on) <= 50 milliohm at Vgs = 2.5 V, 30 V Vds rating minimum. 100 ohm gate series resistor, 100 k gate-source pull-down. Total dissipation 55 mW, junction 39 C.
3. Tool demonstration
Simulate the switch, measure the actual Vds when on, and see how the gate resistor changes the switching waveform and loss.
4. Resources
Free and, wherever possible, openly licensed. The note tells you which part to actually use — do not read them cover to cover.
5. Project — build this on your own
About 3 hours. This is the artifact that proves the skill. Work it without a walkthrough.
Design a three-channel load driver board on paper: channel 1 is a 12 V/2 A resistive heater, channel 2 is a 12 V relay coil, channel 3 is a 5 V/500 mA brushed motor under 20 kHz PWM. All are commanded by a 3.3 V microcontroller.
Deliverables
Acceptance criteria — how you know it is good enough
If you want to push further
- Add current sensing to the heater channel with a shunt resistor, and calculate the shunt value, its power dissipation and the amplifier gain needed for a 0-3.3 V ADC input.
- Redesign the motor channel as a high-side P-channel switch and compare the part cost, drive complexity and losses.
6. Competence checklist
Tick these honestly. If you are auditing this skill, this is your rubric — you should be able to demonstrate every line from the project you just built.