NPN Transistor (2N2222)
A widely used NPN bipolar junction transistor used for amplifying or switching electronic signals and electrical power.
Component Preview
The 2N2222 is a common NPN bipolar junction transistor (BJT) used for general purpose low-power amplifying or switching applications. It acts as an electrically controlled switch: a small current at the Base controls a larger current flowing from Collector to Emitter.
Pin Reference
| Pin | Type | Description |
|---|---|---|
| E (Emitter) | passive | Current flows out of the Emitter to Ground. |
| B (Base) | input | Control pin. A small current here turns the transistor ON. |
| C (Collector) | passive | Current enters the Collector from the load/VCC. |
Configurable Attributes
This component has no configurable attributes.
Wiring Diagram
Example of connecting the NPN Transistor as a switch. A digital pin drives the Base (through a current-limiting resistor, not shown in basic diagram but required in practice) to switch a load on the Collector.

Example Arduino Code
The transistor acts as a switch. Driving the base pin HIGH allows current to flow through the Collector to Emitter.
const int basePin = 3; // Connect to the Base (B) of the NPN transistor
void setup() {
pinMode(basePin, OUTPUT);
}
void loop() {
// Turn the transistor ON (allowing current from C to E)
digitalWrite(basePin, HIGH);
delay(1000);
// Turn the transistor OFF (blocking current)
digitalWrite(basePin, LOW);
delay(1000);
}