A transistor acts as either an electrically controlled switch or a signal amplifier. In switching mode, a small base or gate current controls a much larger collector or drain current to turn loads on or off. In amplification mode, it linearly scales a small input voltage into a larger output voltage or current. Whether you are building an Arduino motor controller or an analog audio preamp, the transistor is the fundamental bridge between low-power logic and high-power physical work.
The Core Job: Switching vs. Amplifying
To understand what a transistor does on your workbench, you have to look at how it is biased. The two primary jobs are switching and amplifying, and they require entirely different circuit configurations.
Switching (Digital Mode): Here, the transistor operates like a solid-state relay. It is either fully OFF (blocking current) or fully ON (passing maximum current with minimal voltage drop). You use this mode when interfacing a 3.3V or 5V microcontroller GPIO pin with a 12V LED strip, a DC motor, or a relay coil. The goal is to minimize power dissipation inside the transistor itself.
Amplifying (Linear/Analog Mode): In this mode, the transistor operates in its middle ground. A tiny fluctuation in the input signal causes a proportional, but much larger, fluctuation in the output current. This is the backbone of analog audio amplifiers, RF transmitters, and sensor signal conditioning. The trade-off is that the transistor absorbs the difference in power as heat, requiring careful thermal management.
Pinouts, Symbols, and Safe Default Part Numbers
When you are staring at a component, knowing the pinout is critical. The two most common transistor families are Bipolar Junction Transistors (BJTs) and Metal-Oxide-Semiconductor Field-Effect Transistors (MOSFETs).
BJT Pinout and Symbol
A BJT has three pins: Emitter (E), Base (B), and Collector (C). The schematic symbol features an arrow on the emitter leg. For an NPN transistor, the arrow points outward (emitting electrons); for a PNP, it points inward. For the standard TO-92 package (like a 2N2222), hold the flat side facing you with the pins pointing down: the left pin is the Emitter, the middle is the Base, and the right is the Collector.
MOSFET Pinout and Symbol
A MOSFET also has three pins: Source (S), Gate (G), and Drain (D). The schematic symbol shows the Gate isolated from the channel by a line, representing the oxide layer. For the standard TO-220 package (like an IRF520), hold the metal tab facing away from you with the pins pointing down: left is Gate, middle is Drain (also connected to the tab), and right is Source.
| Part Number | Type | Max Voltage (Vce/Vds) | Max Current (Ic/Id) | Best Use Case |
|---|---|---|---|---|
| 2N3904 | NPN BJT | 40V | 200mA | Low-power logic switching, small signal amplification |
| 2N2222 | NPN BJT | 40V | 800mA | Medium loads like relays, small motors, high-current logic |
| TIP120 | NPN Darlington | 60V | 5A | High-current loads driven directly from 5V logic (high Vce drop) |
| IRLZ44N | N-Ch MOSFET | 55V | 47A | High-power switching, PWM motor control from 5V/3.3V logic |
| 2N7000 | N-Ch MOSFET | 60V | 200mA | Logic-level shifting, low-power signal switching |
Operation Regions and Biasing
Knowing how to bias a transistor determines which region it operates in. For BJTs, we look at Base-Emitter voltage (Vbe) and Collector-Emitter voltage (Vce). For MOSFETs, we look at Gate-Source voltage (Vgs) and Drain-Source voltage (Vds).
| Region | BJT Bias Condition | MOSFET Bias Condition | Circuit Behavior |
|---|---|---|---|
| Cutoff | Vbe < 0.7V | Vgs < Vgs(th) | Switch is OPEN. No current flows. Load is OFF. |
| Active / Linear | Vbe ≈ 0.7V, Vce > 0.2V | Vgs > Vgs(th), Vds > Vgs-Vth | Acts as a current source/amplifier. Ic = hFE * Ib. |
| Saturation | Vbe ≈ 0.7V, Vce ≈ 0.2V | Vgs >> Vgs(th), Vds is minimal | Switch is CLOSED. Max current flows. Load is ON. |
When selecting a transistor for a switching job, you must drive it deep into saturation. For a BJT, this means providing enough base current (Ib) so that the collector current (Ic) is limited only by the load, not the transistor's gain (hFE). A common rule of thumb is to design for an hFE of 10 when calculating the base resistor for hard saturation, regardless of what the datasheet claims for linear operation.
Application Circuit: Driving a 12V Relay with a 5V Microcontroller
Let's build a complete, real-world circuit. We want to use a 5V Arduino GPIO pin to switch a 12V automotive relay that draws 70mA. We will use the 2N2222 NPN BJT.
Component List
- Q1: 2N2222 NPN Transistor (TO-92)
- R1: 1kΩ Base Resistor (1/4W)
- K1: 12V SPDT Relay (Coil resistance ~170Ω, Ic = 70mA)
- D1: 1N4148 or 1N4007 Flyback Diode
The Biasing Math
We need 70mA of collector current (Ic). Assuming a conservative forced Beta (hFE) of 10 for hard saturation, we need a base current (Ib) of at least 7mA.
The Arduino outputs 5V. The BJT Base-Emitter junction drops about 0.7V.
Voltage across R1 = 5V - 0.7V = 4.3V.
Using Ohm's Law: R = V / I = 4.3V / 0.007A = 614Ω.
We select the next standard value down, 470Ω (or 1kΩ if we want to be gentler on the GPIO pin, as an hFE of 20 will still saturate most 2N2222s at 70mA). Let's use 1kΩ for a safe 4.3mA base drive, which yields an effective hFE of ~16, perfectly adequate for this specific part.
Wiring Steps
- Connect the Arduino 5V GPIO pin to one leg of the 1kΩ resistor.
- Connect the other leg of the 1kΩ resistor to the Base (middle pin) of the 2N2222.
- Connect the Emitter (left pin, flat side facing you) directly to the system Ground.
- Connect one side of the 12V relay coil to the 12V power supply.
- Connect the other side of the relay coil to the Collector (right pin) of the 2N2222.
- Place the flyback diode across the relay coil. The cathode (striped end) must point toward the 12V supply, and the anode toward the Collector. This protects the transistor from inductive voltage spikes when the relay turns off.
- Connect the 12V power supply ground to the Arduino/system ground to establish a common reference.
How Transistors Fail and How to Test Them
Transistors don't usually die of old age; they die from abuse. The most common failure modes are thermal runaway (insufficient heat sinking causing the junction to melt), overvoltage punch-through (exceeding Vceo or Vds breaks the internal dielectric), and inductive kickback (forgetting the flyback diode on a relay coil instantly vaporizes the silicon junction).
You can test a BJT or MOSFET right on the bench using a standard digital multimeter (DMM) set to Diode Test mode.
Testing an NPN BJT (e.g., 2N2222)
- Base to Collector: Place the red probe on the Base and the black probe on the Collector. You should read a forward voltage drop between 0.5V and 0.8V. Reverse the probes; it should read 'OL' (Open Loop).
- Base to Emitter: Red on Base, black on Emitter. Again, expect 0.5V to 0.8V. Reverse probes; expect 'OL'.
- Collector to Emitter: Probe between Collector and Emitter in both directions. Both should read 'OL'. If you read a short (near 0.00V), the transistor is blown.
Testing an N-Channel MOSFET (e.g., IRLZ44N)
MOSFETs are voltage-controlled and have high gate impedance, making them slightly trickier to test with a DMM.
- Discharge the Gate: Touch the black probe to the Source and the red probe to the Gate. This bleeds off any stored gate charge.
- Check Drain-Source (Off): Keep black on Source, move red to Drain. It should read 'OL'.
- Charge the Gate: Move the red probe back to the Gate (black still on Source). The DMM's internal battery will apply ~3V to the gate, partially turning the MOSFET on.
- Check Drain-Source (On): Move the red probe back to the Drain. You should now read a low voltage drop or a beep (continuity), indicating the channel is conducting.
For deeper MOSFET switching theory and advanced gate-drive topologies, always consult the specific manufacturer datasheet for gate charge (Qg) and threshold voltage (Vgs(th)) parameters.
Frequently Asked Questions
What does the transistor do when it gets too hot?
As a silicon transistor heats up, its internal resistance drops and its current gain (hFE) increases. In a BJT, this causes it to draw even more current, which generates more heat, creating a destructive feedback loop known as thermal runaway. Eventually, the silicon junction melts, resulting in a permanent short circuit between the Collector and Emitter. Always use a heatsink for power transistors dissipating more than 0.5W.
What does the transistor do differently than a mechanical relay?
A mechanical relay uses an electromagnet to physically move metal contacts, providing total galvanic isolation and extremely low 'ON' resistance. A transistor is a solid-state device with no moving parts. While a transistor can switch millions of times per second (PWM) without wearing out, it always has a small voltage drop when ON (Vce(sat) or Rds(on)), meaning it generates heat proportional to the load current. Use relays for high-voltage AC isolation; use transistors for high-speed DC switching.
What does the base resistor do in a transistor switching circuit?
The base resistor limits the current flowing from your control source (like a microcontroller pin) into the transistor's base. Without it, the Base-Emitter junction acts like a forward-biased diode and will draw massive current, instantly destroying both the transistor and your microcontroller's GPIO pin. The resistor ensures the base current is exactly high enough to saturate the transistor, but low enough to stay within the safe limits of the driving IC.
What does the transistor do if I wire the collector and emitter backwards?
If you swap the Collector and Emitter on a BJT, the transistor will technically still function, but in 'reverse-active' mode. In this state, the current gain (hFE) drops drastically (often to less than 10), and the maximum voltage it can block (Vebo) is usually only around 5V to 7V before it breaks down. In a switching circuit, a backwards-wired BJT will fail to saturate properly, overheat, and likely suffer junction breakdown if the load voltage exceeds that low reverse threshold.






