Drive a 200 mA load from a 3.3-volt microcontroller pin through a 2N2222 transistor and a 4.7 kΩ base resistor, a combination that turns up all over the internet, and the load gets 92 mA. The transistor sits halfway on, dropping 6.5 volts and burning 0.6 watts, close to the 625 milliwatt limit its datasheet gives for the common TO-92 package. The circuit “works,” in that something lights up, while running the transistor near its limit. Every figure below comes from ngspice simulations of a 2N2222 driving a 12 V, 60 Ω load, using a widely distributed SPICE model for the part, checked against the ON Semiconductor datasheet.
A switch has two states
On and off, nothing in between
SparkFun’s transistor tutorial lists a bipolar transistor’s modes. In saturation, the transistor acts like a short circuit and current flows freely from collector to emitter. In cutoff, it acts like an open circuit and no current flows. In the active mode between them, collector current is proportional to base current, which is what amplifiers use.
A switch should live only in saturation or cutoff. In both, the transistor wastes almost no power: in cutoff there is no current, and in saturation there is almost no voltage across it. The active region is where it gets hot, because it carries current and drops voltage at the same time.
Gain: the number that misleads
SparkFun describes the gain, written β or hFE, as relating collector current to base current, usually around 100 but varying widely between parts and with current. The obvious calculation, base current equals collector current divided by gain, aims at exactly the edge of the active region. That is the mistake behind most underdriven transistor switches.

The test circuit
The setup
- Supply: 12 V
- Load: 60 Ω, so 200 mA when fully on (a small motor, a relay coil, a short LED strip)
- Transistor: 2N2222, NPN
- Base driven from a 3.3 V or 5 V logic pin through a resistor
- Emitter to ground
What “on” should look like
The P2N2222A datasheet from ON Semiconductor gives the target: a collector-emitter saturation voltage of at most 0.3 V at 150 mA collector current with 15 mA of base current, and at most 1.0 V at 500 mA with 50 mA of base. Both test conditions use a base current one-tenth of the collector current. A properly switched 2N2222 at 200 mA should show a few tenths of a volt across it.
The results
3.3 V logic
| Base resistor | Collector current | Voltage across transistor | Power in transistor |
|---|---|---|---|
| 470 Ω | 196 mA | 0.27 V | 53 mW |
| 1 kΩ | 195 mA | 0.30 V | 59 mW |
| 2.2 kΩ | 160 mA | 2.43 V | 387 mW |
| 4.7 kΩ | 92 mA | 6.49 V | 596 mW |
| 10 kΩ | 49 mA | 9.07 V | 443 mW |
| 47 kΩ | 11 mA | 11.34 V | 124 mW |
5 V logic
| Base resistor | Collector current | Voltage across transistor | Power in transistor |
|---|---|---|---|
| 470 Ω | 196 mA | 0.25 V | 50 mW |
| 1 kΩ | 195 mA | 0.28 V | 54 mW |
| 2.2 kΩ | 195 mA | 0.33 V | 63 mW |
| 4.7 kΩ | 135 mA | 3.89 V | 526 mW |
| 10 kΩ | 76 mA | 7.46 V | 564 mW |
| 47 kΩ | 18 mA | 10.90 V | 199 mW |
Reading the tables
The power column tells the story. Fully on or fully off, the transistor dissipates almost nothing. The resistor values in the middle leave it partly on, where it runs warm or hot. With 3.3 V logic, a 4.7 kΩ resistor put the part at about 0.6 W, close to the datasheet’s 625 mW rating for the TO-92 package at 25°C, before accounting for a warm enclosure. The load, meanwhile, got less than half its intended current.

Choosing the base resistor
Design for forced gain, not typical gain
The practical method is to pick a base current around one-tenth of the collector current, the same ratio the datasheet uses for its saturation figures. Engineers call this a forced gain of 10. It ignores the typical gain on purpose, because the datasheet’s minimum gain for this part at 150 mA is 100 and at 500 mA only 40, and real gain also falls with temperature and varies between units.
The calculation
For 200 mA of load current, aim for about 20 mA of base current, or at least 10 mA where the logic pin can’t supply more:
Rb = (V_logic − V_BE) / I_B
With a 5 V pin, V_BE around 0.8 V and 10 mA, that gives about 420 Ω. With 3.3 V, it gives about 250 Ω. The simulations agreed: 470 Ω and 1 kΩ both saturated the transistor cleanly from either logic level, while 2.2 kΩ worked at 5 V but not at 3.3 V.
Check the pin’s limits
That base current comes out of the microcontroller pin. Many pins are rated for around 20 mA, and some 3.3 V parts much less, so pushing 20 mA from a pin for a 200 mA load may exceed what the pin allows. When the pin can’t supply a tenth of the load current, the better answer is a different switch: a logic-level MOSFET, which needs almost no steady gate current, or a Darlington pair, which multiplies the gain.
More base current means slower turn-off
Overdriving the base has a cost at high switching speeds. A saturated transistor stores extra charge in its base, and that charge has to drain away before the transistor can turn off. A transient simulation switched the same 200 mA load with a 5 V pulse and measured the time from the logic signal falling to the load voltage rising halfway:
| Base resistor | Turn-on delay | Turn-off delay |
|---|---|---|
| 470 Ω | 10 ns | 369 ns |
| 1 kΩ | 21 ns | 269 ns |
| 2.2 kΩ | 50 ns | 125 ns |
The harder the transistor was driven, the faster it turned on and the slower it turned off. For a relay or a light switched a few times a second, a few hundred nanoseconds don’t matter. For pulse-width modulation at tens of kilohertz, they start to eat into each cycle, which is one more reason fast PWM circuits usually move to MOSFETs.
Why 3.3 V makes it harder
Less voltage left for the resistor
The base-emitter junction takes roughly 0.7 to 0.85 V when conducting, as the simulation’s base voltages of 0.71 to 0.89 V showed. On a 5 V pin, about 4.2 V is left across the resistor. On a 3.3 V pin, only about 2.5 V. The same resistor delivers roughly 40 percent less base current, which is why every resistor from 2.2 kΩ up behaved worse at 3.3 V in the tables.
Copying 5 V circuits
A large share of hobby circuits were designed around 5 V Arduino boards. Moving one unchanged to a 3.3 V board such as an ESP32 or Raspberry Pi Pico shrinks the base current without any visible change to the schematic. The load may still switch, just partly, and the first sign of trouble is a transistor too hot to touch.

Details that complete the switch
A pull-down on the base
A microcontroller pin floats during reset and boot, before code configures it. A resistor of around 10 kΩ to 100 kΩ from base to ground holds the transistor off during that time, so the motor or heater doesn’t twitch at power-up.
A diode across inductive loads
Relay coils, solenoids and motors store energy in their magnetic field. When the transistor turns off, that energy produces a voltage spike that can exceed the transistor’s ratings. A diode across the load, pointed to carry the current back around the coil, gives the energy a safe path. Without it, a transistor that switches a relay correctly can fail after a few hundred cycles.
Know the current limit
The datasheet gives the 2N2222’s continuous collector current limit as 600 mA. Loads near that, or with large startup surges such as motors and incandescent bulbs, call for a larger transistor or a MOSFET.
The two-line rule
Size the base resistor for a base current of about one-tenth the load current, then confirm the pin can supply it. If it can’t, change the switch, not the resistor. A transistor switch that runs warm is quietly telling the same story as the tables above: it is not a switch at that moment, it is a resistor that happens to have three legs.
Sources
- P2N2222A Amplifier Transistors NPN Silicon, datasheet, ON Semiconductor: https://www.onsemi.com/pdf/datasheet/p2n2222a-d.pdf
- Transistors, SparkFun Learn: https://learn.sparkfun.com/tutorials/transistors/all
