12  Transistor Selection Guide for IoT

12.1 Learning Objectives

  • Apply a systematic decision framework to choose between BJT and MOSFET transistors for a given IoT application
  • Evaluate transistor specifications including voltage rating, current rating, power dissipation, and switching speed against project requirements
  • Distinguish between logic-level and standard MOSFETs and explain why logic-level devices are required for 3.3V/5V microcontroller circuits
  • Design a complete transistor switching circuit for a real-world IoT load, including flyback diode protection and proper gate drive
In 60 Seconds

Choosing the right transistor for your IoT project comes down to a few key decisions: BJT vs MOSFET (usually MOSFET wins for IoT), logic-level vs standard gate drive, and proper voltage/current/power ratings. For most microcontroller-driven loads, a logic-level N-channel MOSFET with a flyback diode handles 90% of use cases.

A transistor is like an electronic switch that lets a tiny signal from your microcontroller control a much bigger load, like a motor or a bright LED strip. There are two main types: BJTs (controlled by current, simpler for beginners) and MOSFETs (controlled by voltage, more efficient for most IoT projects). This guide helps you pick the right one for your project without getting lost in the thousands of options available.

12.2 Systematic Selection Process

12.2.1 Decision Framework: BJT vs MOSFET

Start here to narrow down your choice between the two main transistor families:

Question Choose BJT Choose MOSFET
What’s your power budget? Mains powered, continuous operation OK Battery powered, need ultra-low power
What current are you switching? < 500mA (BJT adequate) > 500mA or need low losses
What’s your control signal? Have current available (>1mA) Limited current (<100µA GPIO)
How often does it switch? Infrequent (<1 kHz) High frequency (>10 kHz)
What’s your experience level? Beginner (BJT simpler biasing) Intermediate (MOSFET gate drive trickier)

Rule of Thumb: For modern IoT projects, MOSFET is usually the better choice due to voltage control (no base current drain), lower power losses (lower Rds(on)), and faster switching.

Consider switching a 2A DC motor with both BJT and MOSFET options. A power NPN BJT (TIP31C, rated for 3A) has \(V_{CE(sat)} = 0.5V\), giving power dissipation \(P_{BJT} = V_{CE(sat)} \times I_C = 0.5V \times 2A = 1W\). The BJT also requires base current: at \(I_C = 2A\), the TIP31C has \(\beta \approx 25\) (minimum guaranteed at high current), so \(I_B = 2A / 25 = 80mA\). This exceeds most GPIO limits, requiring a driver stage. For simplicity, assume a base driver provides adequate current. From a 5V driver: \(P_{base} = (5V - 0.7V) \times 80mA = 344mW\).

A logic-level N-channel MOSFET (IRLZ44N) has \(R_{ds(on)} = 28m\Omega\) (max) at \(V_{gs} = 5V\). Power dissipation: \(P_{MOSFET} = I_D^2 \times R_{ds(on)} = (2A)^2 \times 0.028\Omega = 0.112W\). Gate current is essentially zero (<1µA). Total MOSFET losses: 0.112W vs. BJT losses: 1.344W (1W conduction + 344mW base drive) – the MOSFET is 12x more efficient. For battery-powered IoT nodes operating 24/7, this translates to months of extended battery life.

\[\text{Efficiency gain} = \frac{P_{BJT}}{P_{MOSFET}} = \frac{1.344W}{0.112W} = 12.0\times\]

12.2.2 Transistor Switching Circuits for IoT

The most common transistor configurations you’ll encounter in IoT hardware design:

Electronics diagram illustrating low-side switching with N-Channel MOSFET connected to VCC 12V and load such as motor, LED, or relay, showing semiconductor components, transistor circuits, diode operation, and switching circuits used in sensor and actuator interfacing for IoT systems.
Figure 12.1: MOSFET Switching Circuits: Low-Side, High-Side, and H-Bridge Configurations

Key Insights:

Circuit Type When to Use Advantages Critical Design Note
Low-Side N-MOSFET Motors, relays, LEDs, most loads Simplest, cheapest, direct GPIO control Load not at ground potential (affects sensors)
High-Side P-MOSFET Battery disconnect, sensor power, reverse polarity protection Load at ground, true power-off Inverted logic (LOW=ON), higher Rds(on)
H-Bridge DC motors needing reversing, bidirectional control Forward/reverse/brake/coast modes Must implement dead-time (1-5µs), risk of shoot-through
Flyback Diode ALL inductive loads (relays, solenoids, motors) Protects transistor from voltage spikes (>300V) Cathode to VCC, anode to GND side of load
Complete NPN BJT switching circuit showing microcontroller input (Vin) controlling relay load through transistor, with base resistor RB limiting current, collector current Ic flowing through relay coil, flywheel diode protecting against inductive spikes, and timing diagrams showing input square wave and inverted output switching between Vce saturation and Vcc
Figure 12.2: NPN BJT as a switch: Complete relay driver circuit with flyback diode protection and input/output timing diagrams
N-channel FET switching circuit showing gate input (Vin) through input resistor RIN controlling lamp load connected to VDD supply, with gate-source resistor RGS providing defined off state, flywheel diode for protection, drain-source voltage Vout, and timing diagrams showing input square wave and inverted output switching characteristics
Figure 12.3: N-channel FET as a switch: Lamp driver circuit with gate resistors and input/output timing diagrams

12.2.3 Common IoT Application Transistor Recommendations

Based on real-world IoT projects, here are proven transistor choices for common scenarios:

Application Recommended Transistor Specs Why This One? Alternative
LED indicator (20mA) 2N2222 (NPN BJT) 40V, 600mA, β=100-300 Cheap ($0.05), easy to bias, overkill specs BC547 (smaller package)
Relay control (50mA coil) 2N3904 (NPN BJT) or 2N7000 (N-MOSFET) BJT: 40V, 200mA
MOSFET: 60V, 200mA
Both work well, MOSFET uses less power BC337 for higher current
High-power LED (350mA) IRLZ44N (N-MOSFET) 55V, 47A, Rds(on)=28mΩ max @ Vgs=5V Logic-level (works with 3.3V/5V GPIO), low losses FQP30N06L (cheaper)
Motor control (1-3A) IRLZ44N (logic-level) or IRF540N (N-MOSFET) IRLZ44N: 55V, 47A, Rds(on)=28mΩ @ 5V
IRF540N: 100V, 33A, Rds(on)=44mΩ @ 10V
IRLZ44N for 3.3V/5V GPIO; IRF540N needs 10V gate driver IRL540N (logic-level, 100V)
Solenoid valve (500mA) TIP120 (Darlington NPN) or FQP30N06L (N-MOSFET) Darlington: 60V, 5A, β=1000
MOSFET: 60V, 32A
Darlington simplest, MOSFET more efficient TIP122 (100V higher voltage)
High-side switching (12V+) IRF9540 (P-channel MOSFET) -100V, -23A, Rds(on)=117mΩ @ Vgs=-10V Standard gate: needs Vgs=-10V, use with gate driver or >10V supply FQP27P06 (lower Rds(on))
Load switching (ultra-low power) AO3401 (P-channel SOT-23) 30V, 4A, Rds(on)=35mΩ, leak<1µA SMD compact, near-zero leakage for battery Si2333DS (even lower leak)
H-bridge motor driver 4x IRLZ44N with gate drivers (or 2x P-channel high + 2x N-channel low) 55V, 47A, Rds(on)=28mΩ max @ 5V Logic-level, handles high current, low losses; N-channel high-side requires bootstrap driver L298N module (integrated, no external gate drivers needed)
5V→3.3V level shifter BSS138 (N-channel SOT-23) 50V, 200mA, Rds(on)=3.5Ω Standard for bidirectional I2C/SPI shifting 2N7000 (through-hole version)
Signal amplifier (audio) 2N3904 (NPN) + 2N3906 (PNP) Complementary pair for push-pull Low noise, good for small-signal amplification BC547/BC557 pair

SMD vs Through-Hole Trade-Offs:

  • Through-hole (TO-92, TO-220): Easier for beginners, hand-solderable, good heat dissipation (TO-220 with heatsink)
  • SMD (SOT-23, SOT-223, DPAK): Compact for production, cheaper in volume, harder to solder by hand

12.2.4 Detailed Selection Criteria

When the simple recommendation table doesn’t fit your needs, use these detailed criteria:

Voltage Rating (V_CE, V_DS)

What to check: Maximum voltage between collector-emitter (BJT) or drain-source (MOSFET)

Selection rule: Choose transistor with voltage rating ≥ 2× your supply voltage for safety margin

Examples:

  • 5V circuit → ≥10V transistor (2N2222: 40V ✓)
  • 12V motor → ≥24V transistor (IRF540N: 100V ✓)
  • 24V industrial → ≥50V transistor (TIP120: 60V ✓)

Common mistake: Using 2N7000 (60V) for 48V system → fails (need 100V+ transistor)

Current Rating (I_C, I_D)

What to check: Maximum continuous collector (BJT) or drain current (MOSFET)

Selection rule: Choose transistor with current rating ≥ 2-3× your load current for thermal safety

Examples:

  • 100mA LED → ≥200mA transistor (2N3904: 200mA ✓)
  • 1A motor → ≥2A transistor (IRF540N: 33A ✓, huge safety margin)
  • 10A heater → ≥20A transistor (IRFB3207: 180A ✓)

Thermal derating: At 25°C use full rating, at 85°C derate to 50-70% of rating

Common mistake: “2A motor needs 2A transistor” → overheats (motor stall current may be 5A!)

Power Dissipation (P_D)

What to check: Maximum power transistor can dissipate as heat

Calculation:

  • BJT: P = V_CE(sat) × I_C (saturation) or P = V_CE × I_C (active mode)
  • MOSFET: P = I_D² × Rds(on) (when ON) or P = V_DS × I_D (switching losses)

Selection rule: Ensure P_dissipation < P_D rating (with heatsink if needed)

Examples:

Switching 2A at 12V with MOSFET:
- Rds(on) = 100mΩ
- P = (2A)² × 0.1Ω = 0.4W
- TO-220 package: 1W without heatsink, 25W with heatsink
- Conclusion: No heatsink needed (0.4W < 1W)

Switching 2A at 12V with BJT:
- V_CE(sat) = 0.5V (typical for saturated BJT)
- P = 0.5V × 2A = 1W
- TO-92 package: 0.5W max
- Conclusion: NEED heatsink or bigger package

Why MOSFETs win: Lower on-resistance → less heat → longer life, smaller package

12.2.5 Interactive Calculator: MOSFET vs BJT Power Dissipation

Adjust the sliders to compare power losses for your specific load current and transistor parameters.

Switching Speed (f_T, t_on, t_off)

What to check: How fast can the transistor switch on/off?

Selection rule: For PWM/switching applications, choose transistor with f_T ≥ 10× your PWM frequency

Examples:

  • 1 kHz PWM (motor speed control) → f_T ≥ 10 kHz (most transistors OK)
  • 20 kHz PWM (LED dimming, avoid audible whine) → f_T ≥ 200 kHz (2N2222: 300 MHz ✓)
  • 100 kHz switching (buck converter) → f_T ≥ 1 MHz (specialized switching FETs)

Switching losses: At high frequencies, switching losses dominate. Use MOSFETs with low gate charge (Q_g) for efficiency.

Common mistake: Using slow Darlington (TIP120) for 20 kHz PWM → overheating, poor efficiency

Logic-Level vs Standard Gate Drive (MOSFETs only)

Critical MOSFET selection criterion often overlooked by beginners!

Standard MOSFETs:

  • Need V_GS = 10-12V to fully turn ON (achieve specified Rds(on))
  • IRF540N datasheet: Rds(on) = 44mΩ @ V_GS = 10V
  • With 5V gate drive: Rds(on) = ~200mΩ (4.5× higher → 4.5× more heat!)

Logic-Level MOSFETs:

  • Fully turn ON with V_GS = 4.5-5V (works with 3.3V/5V microcontrollers)
  • IRLZ44N datasheet: Rds(on) = 28mΩ max @ V_GS = 5V
  • Note the “L” in IRLZ44N → Logic-level

Selection rule:

  • 3.3V/5V microcontroller: MUST use logic-level MOSFET (look for “logic-level” or V_GS(th) < 2.5V in datasheet)
  • 12V+ gate driver: Can use standard MOSFET (often cheaper, lower Rds(on))

Common beginner mistake: “My IRF540N gets really hot even though it’s rated for 33A and I’m only switching 2A” → Using standard MOSFET with 5V gate drive! Solution: Replace with IRLZ44N (logic-level version)

12.2.6 Real-World Example: Choosing Transistor for Smart Garden Irrigation

Requirements:

  • Control 12V solenoid valve (opening/closing water flow)
  • Solenoid coil: 12V, 50mA nominal, 200mA inrush current
  • Controlled by ESP32 GPIO (3.3V, 12mA max)
  • Battery powered (need low quiescent current)
  • Outdoor deployment (temperature: -10°C to +60°C)

Decision Process:

Step 1: BJT or MOSFET? - Battery powered → prefer MOSFET (zero gate current) - Load: 200mA → either works, but MOSFET more efficient - Choice: MOSFET

Step 2: Voltage rating? - Solenoid: 12V → need ≥24V rating for safety (2x rule) - With flyback diode, inductive spikes are clamped to ~12.7V - Requirement: V_DS ≥ 24V (flyback diode limits spike voltage)

Step 3: Current rating? - Load: 200mA inrush → need ≥400mA continuous rating - Requirement: I_D ≥ 400mA (most MOSFETs exceed this)

Step 4: Logic-level or standard? - ESP32 GPIO: 3.3V → MUST be logic-level - Need V_GS(th) < 2V, fully on at V_GS = 3.3V - Requirement: Logic-level MOSFET

Step 5: Package and thermal? - P_dissipation = I² × Rds(on) = (0.2)² × 0.03Ω = 1.2mW - Negligible heat → no heatsink needed - Requirement: Any package (TO-92, SOT-23)

Final Selection: 2N7002 (N-channel MOSFET, SOT-23) or IRLML2502 for more margin - V_DS: 60V ✓ (safe for 12V + inductive spikes) - I_D: 115mA continuous (2N7002, SOT-23 package limited) ✓ (sufficient for 50mA nominal; 200mA inrush is brief) - V_GS(th): 1.0-2.5V typical ✓ (reliably on at 3.3V) - Package: SOT-23 ✓ (compact, easy to solder) - Cost: $0.05 ✓ (very cheap) - Rds(on): 2.0Ω @ V_GS=2.5V → P = (0.05A)^2 x 2.0 = 5mW nominal ✓ (negligible losses)

Note: The popular 2N7000 (TO-92, 200mA) is also viable here since nominal current is only 50mA, but the 2N7002 offers better margin and a smaller footprint.

Additional Protection: Add 1N4007 flyback diode across solenoid coil (cathode to +12V, anode to drain) to protect MOSFET from inductive kickback when solenoid turns OFF.

Circuit:

ESP32 GPIO ---[1kΩ]--- Gate (2N7002)
                        Drain --- Solenoid --- +12V
                        Source --- GND

Flyback diode: Cathode to +12V, Anode to Drain

Why NOT alternatives:

  • BJT (2N3904): Needs base current (~2mA), wastes battery power during sleep cycles
  • IRF540N: Standard gate (not logic-level), won’t fully turn on with 3.3V
  • Relay: 50mA coil current wasteful for battery, mechanical wear, slower

Scenario: You’re designing a remote irrigation valve controller powered by LoRaWAN. The 12V solenoid valve coil draws 300mA nominal, with 800mA inrush current when first energized. The system runs on 4× AA batteries (6V total) with a boost converter to 12V. The LoRa module (RFM95) GPIO output is 3.3V at 12mA max. Battery life target is 2 years with 10 valve actuations per day, each lasting 30 seconds.

Step-by-Step Selection Process:

1. BJT vs MOSFET Decision:

  • Battery powered → prefer MOSFET (zero gate current)
  • Switching load (not amplification) → MOSFET
  • Choice: N-channel MOSFET

2. Voltage Rating Calculation:

  • Supply voltage: 12V
  • With flyback diode, voltage spikes are clamped to ~V_supply + V_diode_forward (~12.7V)
  • Safety margin: 2× minimum for transient protection
  • Requirement: V_DS ≥ 12V × 2 = 24V (with flyback diode protection)
  • Selected rating: 55V (IRLZ44N, provides ample margin with flyback diode)

3. Current Rating Calculation:

  • Peak inrush: 800mA
  • Safety factor: 3× for inrush currents
  • Requirement: I_D ≥ 800mA × 3 = 2.4A
  • Selected rating: 3A continuous (standard rating above 2.4A)

4. Logic-Level Requirement:

  • GPIO voltage: 3.3V
  • Must be logic-level MOSFET with V_GS(th) < 2V
  • Fully enhanced at V_GS = 3.3V
  • Requirement: MUST specify logic-level in datasheet

5. Power Dissipation Check:

  • Steady-state current: 300mA
  • Worst-case Rds(on) at V_GS=3.3V: Need from datasheet
  • Example candidate: IRLZ44N has Rds(on) = 28mΩ @ V_GS=4.5V, approximately 35mΩ @ 3.3V
  • Power dissipation: P = I² × R = (0.3A)² × 0.035Ω = 3.15mW
  • TO-220 package without heatsink: 1W max
  • Verdict: No heatsink needed (3.15mW << 1W)

6. Battery Life Impact:

  • Active time per day: 10 actuations x 30 sec = 300 seconds = 0.0833 hours
  • MOSFET power loss per day: 3.15mW x 0.0833h = 0.263 mWh/day
  • Over 2 years (730 days): 0.263 x 730 = 192 mWh = 0.192 Wh
  • At 6V: 0.192 Wh / 6V = 32 mAh consumed by MOSFET losses over 2 years
  • AA batteries in series: 2,500 mAh capacity (series does not multiply mAh)
  • MOSFET represents: 32 / 2,500 = 1.28% of total battery capacity
  • Verdict: Negligible impact on battery life

Final Component Selection:

  • Transistor: IRLZ44N (N-channel logic-level MOSFET)
  • Specs: 55V V_DS (ample margin with flyback diode clamping spikes to ~12.7V), 47A I_D, 28mΩ Rds(on) max @ 5V, TO-220 package
  • Cost: ~$0.80 in single quantities, $0.35 in 100+ quantities
  • Flyback diode: 1N4007 (1000V, 1A) across valve coil – essential for clamping inductive voltage spikes
  • Gate resistor: 10kΩ pull-down from gate to ground (keeps MOSFET OFF when RFM95 is sleeping)
  • Gate series resistor: 100Ω between GPIO and gate (limits current spikes)

Circuit Implementation:

RFM95 GPIO (3.3V) ──[100Ω]── Gate (IRLZ44N)
                              |
                             [10kΩ] to GND
                              |
                            Source ── GND

12V ── Solenoid Valve ── Drain
       |
      [1N4007 flyback diode, cathode to 12V]

Key Lessons:

  1. Inductive loads always need flyback diodes - without it, inductive kickback can generate 300V+ spikes destroying the MOSFET
  2. Logic-level is non-negotiable for 3.3V systems - standard MOSFETs won’t fully turn on, causing excessive heat
  3. Check Rds(on) at YOUR gate voltage - datasheets often spec at 10V, but you’re using 3.3V
  4. Pull-down resistors prevent float-induced turn-on - critical for systems with sleep modes
  5. Power dissipation is usually negligible - the 3.15mW loss is only 0.088% of the 3.6W valve power (12V x 300mA)

Real-World Validation: After deployment, measure the MOSFET temperature rise. With 3mW dissipation, temperature rise will be approximately: - Thermal resistance junction-to-ambient (TO-220, no heatsink): ~62°C/W - Temperature rise: 3mW × 62°C/W = 0.19°C - Essentially unmeasurable - confirms calculations were correct

12.3 Chapter Summary

Transistor selection for IoT follows a systematic process: start with the BJT vs MOSFET decision (MOSFETs win for most battery-powered applications due to zero gate current and lower conduction losses), then verify four critical specifications against your requirements.

The four key selection criteria are: (1) voltage rating at least 2x your supply voltage to handle transients, (2) current rating at least 2-3x your load current for thermal margin, (3) power dissipation within the package limits (P = I^2 x Rds(on) for MOSFETs, P = Vce(sat) x Ic for BJTs), and (4) logic-level gate compatibility if driven directly from a 3.3V or 5V microcontroller GPIO.

Logic-level MOSFETs are essential for microcontroller-driven circuits. Standard MOSFETs require Vgs = 10V to achieve their rated Rds(on), leading to excessive heating when driven from 3.3V/5V GPIOs. Always check Rds(on) at your actual gate voltage in the datasheet, not the headline specification.

Protection circuits are non-negotiable for inductive loads: flyback diodes across relay coils, solenoids, and motors prevent destructive voltage spikes when the transistor switches off. Gate pull-down resistors keep MOSFETs off during microcontroller reset or sleep states.

The Sensor Squad goes shopping for the perfect transistor!

Max the Microcontroller had a mission: he needed to control a small water valve for a smart garden. “But I can only push with 3.3 volts and 12 milliamps,” Max said. “The valve needs 12 volts and 100 milliamps! I need a transistor helper.”

The Sensor Squad went to the Electronics Store, where they found LOTS of transistors. “There are two main types,” explained Sammy the Sensor. “BJTs and MOSFETs.”

“A BJT is like a faucet,” said Lila the LED. “You have to keep pushing the handle (sending current to the base) to keep it open. If you let go, it closes.” “A MOSFET is like a light switch,” added Bella the Battery. “You just flip it (send voltage to the gate) and it stays on without you pushing. Much better for saving my energy!”

Max picked up a MOSFET called the 2N7000. “Let’s check if this one works for us. Voltage rating: 60V – our valve is 12V, so we have plenty of safety margin. Current rating: 200mA – that’s double what our valve needs, giving us a safety margin. And it’s logic-level, which means my 3.3 volt signal can turn it on. Perfect!”

“Don’t forget the flyback diode!” warned Sammy. “The valve has a coil inside that stores energy in a magnetic field. When Max turns it off, that energy has to go somewhere, and it creates a huge voltage spike that could destroy the transistor!” They added a 1N4007 diode across the valve to protect everything.

“So choosing a transistor is like choosing the right tool for the job,” concluded Max. “Check the voltage, check the current, make sure it works with your signal level, and always add protection for valves and motors!”

12.3.1 Key Words for Kids

Word What It Means
MOSFET A type of transistor that works like a light switch (voltage controlled)
BJT A type of transistor that works like a faucet (current controlled)
Logic-Level A MOSFET that can be turned on by a microcontroller’s small voltage
Flyback Diode A protector that absorbs voltage spikes from motors and pumps
Voltage Rating The maximum voltage a transistor can handle safely
Current Rating The maximum current a transistor can carry safely

12.4 How It Works: MOSFET Gate Drive and Channel Formation

N-Channel MOSFET Operation Step by Step

The big picture: A MOSFET acts as a voltage-controlled switch where applying voltage to the gate terminal creates a conductive channel between drain and source, allowing current to flow with very low resistance (typically 0.01-0.1Ω for power MOSFETs).

Step-by-step breakdown:

  1. OFF State (Vgs = 0V): No gate voltage applied, P-type body region blocks current flow between N-type drain and source with >1MΩ resistance, leakage current <1µA - Real example: IRLZ44N with 12V across drain-source passes only 0.25µA when gate is grounded

  2. Threshold (Vgs = 2V): Gate voltage reaches threshold, creating thin conductive channel of electrons at oxide interface, resistance drops to ~10Ω, enabling milliamp-level currents - Real example: At Vgs = 2V, IRLZ44N conducts 100mA with 1V drop across channel

  3. Fully Enhanced (Vgs = 5V): Strong gate electric field inverts surface from P-type to N-type, forming wide low-resistance channel (~50nm deep), Rds(on) = 0.028 ohm max enabling 47A rating - Real example: At Vgs = 5V, IRLZ44N passes 10A with only 0.28V drop, dissipating 2.8W heat

Why this matters: Gate threshold voltage (Vgs(th)) determines microcontroller compatibility. Standard MOSFETs need 10V, logic-level MOSFETs work with 3.3-5V GPIO. Using wrong type causes partial turn-on, high resistance, and excessive heating.

12.5 Concept Check: MOSFET Selection

Test your transistor selection skills:

## Concept Relationships

Transistor selection connects throughout IoT hardware design:

Related Concept Chapter Link Relationship
Component Basics Conductors and Insulators Transistors are active components controlling current
Semiconductor Physics Doping and Diodes MOSFETs built from PN junction layers
Motor Control DC Motor Drivers H-bridge uses 4 MOSFETs for bidirectional control
Power Efficiency Energy Optimization Low Rds(on) MOSFETs reduce switching losses

12.6 Try It Yourself

Challenge: Design a Load Switching Circuit

Objective: Select proper transistor, calculate component values, and draw complete circuit for microcontroller-controlled relay.

Specification:

  • Relay coil: 5V, 70mA, 100Ω coil resistance
  • Microcontroller: Arduino Uno (5V GPIO, 40mA max)
  • Requirement: Simple, low-cost circuit

Steps:

  1. Choose transistor type: BJT vs MOSFET? (70mA suggests BJT acceptable)
  2. Calculate current: 70mA coil needs what transistor rating? (2× safety = 140mA minimum)
  3. Calculate base resistor for BJT OR gate resistor for MOSFET
  4. Add flyback diode protection (inductive load!)
  5. Draw complete circuit with all component values

Solution: Transistor: 2N2222 NPN BJT (40V, 600mA, β=100-300) Base resistor: R = (Vcc - Vbe) / Ib = (5V - 0.7V) / (70mA/100) = 4.3V / 0.7mA = 6.1k-ohm. Use 4.7k-ohm standard value (gives Ib = 0.91mA, providing ~1.3x overdrive for reliable saturation) Flyback diode: 1N4007 (1000V, 1A) - cathode to +5V, anode to collector Circuit:

Arduino Pin 9 ──[4.7kΩ]── Base (2N2222)
                          Collector ── Relay Coil ── +5V
                          Emitter ── GND
[1N4007 diode across coil, stripe to +5V]

Expected Observation: Relay clicks ON when GPIO HIGH, OFF when LOW. MOSFET alternative (2N7000) would use 10k-ohm pull-down + 100-ohm gate resistor instead, drawing <1uA vs BJT’s 0.9mA base current.

12.6.1 Interactive Calculator: BJT Base Resistor

Use this calculator to find the base resistor value for any BJT switching circuit.

12.7 See Also

Transistor Applications:

Advanced Topics:

Match each transistor term or component to its correct role or definition.

Arrange the following steps in the correct order to select and design a transistor switch for an IoT actuator.

12.8 What’s Next?

Next Chapter Description
Electronics Summary and Resources Consolidates key concepts, common pitfalls checklist, and visual reference galleries for the entire Electronics module

Recommended reading sequence:

Topic Chapter
Component fundamentals Conductors and Insulators
Semiconductor physics Doping and Diodes
Transistor selection (this chapter) Transistor Selection Guide
Module wrap-up Electronics Summary and Resources