2N2222 NPN Transistor
A widely used general-purpose NPN switching transistor, common in beginner motor-driver and relay-driver circuits.
How this component works
An NPN bipolar junction transistor has three terminals: base, collector, and emitter. A small current flowing into the base allows a much larger current to flow from collector to emitter — the ratio between them is the transistor's current gain (hFE or β), typically 50-300 for small-signal parts.
This makes an NPN transistor useful as a current amplifier (driving a relay or motor from a microcontroller pin) or as a switch (fully on or fully off, controlled by the base).
CircuitForge models the base-emitter junction with the diode equation and applies the gain parameter to derive collector current — the same core approach as a real small-signal transistor datasheet's DC characteristics.
Common Use Cases
- Low-side switch driving a small DC motor or relay coil from a logic pin
- Simple single-transistor amplifier stage
- Building block for an astable multivibrator (two-transistor LED flasher)
Frequently Asked Questions
Can a 2N2222 directly drive a motor from a microcontroller pin?
The microcontroller pin drives the base through a resistor, and the transistor's collector-emitter path switches the motor's higher current — the pin never carries the motor current directly. Add a flyback diode across the motor to protect the transistor.
What does the gain (hFE) parameter control in the simulation?
It sets the ratio between base current and collector current — a higher gain means a smaller base current is needed to fully turn on the same collector current, which is exactly how it behaves on a real datasheet.