The primary function of a transistor in a DC circuit is to control a large current flow between two terminals using a much smaller current or voltage applied to a third terminal. In practical electronics, this allows the device to act as either a solid-state switch (turning loads on and off digitally) or a linear amplifier (scaling up small analog signals). For hobbyists and engineers working with microcontrollers like the Arduino or ESP32, the transistor is the essential bridge between low-power logic pins (which can only source 10-20mA) and higher-power loads like motors, relays, and high-brightness LEDs.
The Core Function: Switch vs. Amplifier
To understand the function of a transistor, you must separate its two primary operating modes. The most common use in DIY electronics and digital logic is switching. When used as a switch, the transistor operates in two extreme states: completely off (cutoff) or completely on (saturation). A small current injected into the Base terminal removes the internal barrier, allowing a large current to flow from the Collector to the Emitter. This is how a 5mA GPIO pin can turn on a 1-amp DC motor.
The second function is amplification. In audio circuits or RF transmitters, the transistor is biased into its active (linear) region. Here, tiny micro-volt fluctuations at the Base result in proportionally larger voltage swings at the Collector. While the physics relies on semiconductor doping and electron-hole recombination, at the bench level, you can treat the Bipolar Junction Transistor (BJT) as a current-controlled valve: the Base current dictates the Collector current, multiplied by the device's gain factor (hFE or Beta).
Pinout, Symbol, and Safe Default Part Numbers
The schematic symbol for an NPN BJT features a vertical line (the Base connection) with a diagonal arrow pointing outward on the Emitter leg. The Collector leg has no arrow. A helpful mnemonic for NPN is "Not Pointing iN." For a PNP transistor, the arrow points inward toward the Base ("Pointing iN Proudly").
Physical pinouts on the ubiquitous TO-92 plastic package are notoriously unstandardized. If you hold a 2N2222 with the flat side facing you and the legs pointing down, the pins from left to right are Emitter, Base, Collector (EBC). However, a BC547 in the exact same physical orientation reads Collector, Base, Emitter (CBE). Always verify the pinout against the manufacturer datasheet before soldering.
Here are the safe, widely available default part numbers you should keep in your bench stock, complete with their maximum ratings:
| Part Number | Type | Max Vce (V) | Max Ic (mA) | Typical hFE | Best Use Case |
|---|---|---|---|---|---|
| 2N3904 | NPN BJT | 40V | 200mA | 100 - 300 | General purpose switching, low-power logic level translation |
| 2N3906 | PNP BJT | -40V | -200mA | 100 - 300 | High-side switching, complementary pair to 2N3904 |
| BC547 | NPN BJT | 45V | 100mA | 110 - 800 | Audio pre-amplification, sensor signal conditioning |
| TIP120 | NPN Darlington | 60V | 5000mA | 1000+ | Switching motors, solenoids, and high-current LED strips directly from logic pins |
Operation Regions: Cutoff, Active, and Saturation
A BJT does not just turn on and off; it passes through distinct regions depending on the voltage applied to its junctions. Understanding these regions is critical for diagnosing why a circuit is overheating or failing to switch fully.
| Region | Base-Emitter Voltage (Vbe) | Collector-Emitter Voltage (Vce) | Collector Current (Ic) | Practical Application |
|---|---|---|---|---|
| Cutoff | < 0.6V | Equal to Supply Voltage (Vcc) | 0A (Leakage only) | Switch is OPEN. Load is off. |
| Active (Linear) | ~0.6V to 0.7V | > 0.3V (Typically 1V to Vcc-1) | Ic = hFE × Ib | Amplifiers, linear voltage regulators, analog signal processing. |
| Saturation | ~0.7V to 0.8V | < 0.3V (Typically 0.1V to 0.2V) | Ic < hFE × Ib (Limited by load) | Switch is CLOSED. Maximum current flows, minimum heat dissipated in transistor. |
How to Bias and Select a Transistor for Your Job
The most common mistake beginners make is relying on the datasheet's hFE (DC current gain) to calculate the base resistor for a switching circuit. The datasheet might list an hFE of 200 for a 2N3904, but that value drops significantly at higher currents and varies wildly with temperature.
Biasing Calculation Example:
You need to switch a 12V relay coil that draws 80mA using a 5V Arduino GPIO pin.
1. Target Collector Current (Ic): 80mA.
2. Required Base Current (Ib): Using forced beta of 10, Ib = 80mA / 10 = 8mA.
3. Base Resistor (Rb): The GPIO outputs 5V. The Base-Emitter junction drops ~0.7V. The voltage across the resistor is 5V - 0.7V = 4.3V.
4. Ohm's Law: R = V / I = 4.3V / 0.008A = 537Ω.
5. Select Standard Value: Choose the next lower standard E12 resistor value to ensure enough current flows. A 470Ω resistor is the correct choice here.
Practical Application: 9V LED Driver Circuit
Let's build a complete, functional circuit that demonstrates the switching function of a transistor. We will use a 5V microcontroller signal to control a high-intensity LED powered by a 9V battery.
Component List:
- Q1: 2N3904 NPN Transistor
- LED1: 5mm Red LED (Forward Voltage Vf = 2.0V, Target Current = 20mA)
- R_C (Collector Resistor): Limits LED current
- R_B (Base Resistor): Limits GPIO current and sets bias
- Power: 9V Battery for LED, 5V Logic for Base
Calculating Component Values:
First, size the collector resistor (R_C). The 9V supply must drop across the resistor, the LED, and the saturated transistor (Vce_sat ≈ 0.2V).
Voltage across R_C = 9V - 2.0V (LED) - 0.2V (Transistor) = 6.8V.
R_C = 6.8V / 0.020A = 340Ω. Use a standard 330Ω resistor.
Next, size the base resistor (R_B). With Ic = 20mA, a forced beta of 10 requires Ib = 2mA.
R_B = (5V - 0.7V) / 0.002A = 2150Ω. Use a standard 2.2kΩ resistor.
Wiring Steps:
- Connect the 2N3904 Emitter (left pin, flat side facing you) to the common ground shared by the 9V battery and 5V logic supply. Common ground is mandatory for the control signal to reference the Base properly.
- Connect the 2.2kΩ Base resistor between the 5V logic output and the Base (middle pin).
- Connect the 330Ω Collector resistor from the 9V battery positive terminal to the anode (long leg) of the LED.
- Connect the cathode (short leg) of the LED to the Collector (right pin) of the transistor.
- When the logic pin goes HIGH (5V), 2mA flows into the Base, allowing 20mA to flow through the LED. When LOW, the transistor cuts off instantly.
Failure Modes and Multimeter Testing
Transistors rarely fail without a reason. The most common failure modes are thermal runaway (operating in the active region without adequate heat sinking, causing the silicon to overheat and short internally) and exceeding Vceo (applying a voltage spike across the Collector-Emitter that breaks down the junction, often caused by switching inductive loads without a flyback diode).
You can test a BJT out-of-circuit using a standard digital multimeter (DMM) set to the Diode Test mode. According to Fluke's testing guidelines, a good NPN transistor behaves like two diodes sharing a common anode (the Base).
Step-by-Step DMM Test (NPN):
- Base to Emitter: Place the Red probe on the Base, Black on the Emitter. The meter should read a forward voltage drop between 0.600V and 0.800V.
- Base to Collector: Red on Base, Black on Collector. Expect the same 0.600V to 0.800V reading.
- Reverse Bias Check: Swap the probes (Black on Base, Red on Emitter/Collector). The meter should read OL (Over Limit), indicating the junctions are blocking reverse current.
- Collector to Emitter: Place probes across Collector and Emitter in both directions. Both must read OL. If you read a short (near 0.00V) or a low resistance in either direction, the transistor has suffered secondary breakdown and is destroyed.
Frequently Asked Questions
What is the function of a transistor in a power supply?
In linear power supplies, the transistor functions as a variable resistor (operating in the active region) to regulate output voltage. A pass transistor (often a power BJT like the 2N3055 or TIP31) is placed in series with the load. A feedback circuit monitors the output voltage and adjusts the Base current to the pass transistor, dropping excess voltage as heat to maintain a perfectly steady DC output regardless of input fluctuations or load changes.
What is the function of a transistor compared to a relay?
Both act as switches, but a transistor is a solid-state semiconductor with no moving parts, while a relay is an electromechanical device using a physical magnetic coil and metal contacts. The function of a transistor excels in high-speed switching (PWM motor control at 20kHz), silent operation, and infinite lifecycle. Relays, however, provide complete galvanic isolation and can switch high-voltage AC mains loads directly, which standard BJTs cannot do. For DC loads under 50V, a MOSFET or BJT is almost always preferred over a relay.
What is the function of a transistor base resistor?
The base resistor limits the current flowing from your control source (like an Arduino GPIO pin) into the Base-Emitter junction. Because the Base-Emitter junction acts like a standard silicon diode, it will attempt to draw infinite current once the voltage exceeds 0.7V, instantly destroying both the transistor and the microcontroller pin. The base resistor drops the excess voltage and sets the exact bias current required to push the transistor into saturation safely.
What is the function of a PNP transistor vs an NPN?
While an NPN transistor switches the ground path (low-side switching), a PNP transistor functions as a high-side switch. In a PNP device, current flows from Emitter to Collector when the Base is pulled lower than the Emitter voltage by at least 0.7V. PNP transistors are used when the load must remain permanently grounded for safety or noise reasons, and the positive supply voltage needs to be switched on and off. For deeper theory on junction behaviors, the Electronics Tutorials BJT guide provides excellent schematic breakdowns of both polarities.






