2N3904 Transistor
General-purpose NPN bipolar junction transistor for small-signal amplification and low-power switching, rated to 40 V and 200 mA in a TO-92 package.
- Maximum supply voltage40 V
- Dimensions4.5 × 3.5 × 4.5 mm

The 2N3904 is a general-purpose NPN transistor in TO-92, rated 40 V collector-emitter, 200 mA continuous collector current and 625 mW dissipation (onsemi 2N3903/2N3904 datasheet, p.1). Holding the flat face toward you with the leads down, the pins are Emitter, Base, Collector. To switch a load, connect it between the supply and the collector, tie the emitter to ground, and drive the base from a microcontroller pin through a 1 kΩ to 10 kΩ resistor.
The 2N3904 is one of the most widely used general-purpose NPN bipolar junction transistors (BJTs). It is a silicon device built for small-signal amplification and low-power switching, and its direct PNP complement is the 2N3906. It ships in the through-hole TO-92 case, which makes it a staple of breadboards and hobby circuits.
As an NPN BJT, a small current flowing into the base controls a much larger current from collector to emitter. The part offers a DC current gain (hFE) of 100 to 300 at a collector current of 10 mA, with a current-gain bandwidth product of at least 300 MHz. It handles up to 200 mA of continuous collector current and a collector-emitter voltage (VCEO) of 40 V, with total device dissipation of 625 mW at 25 C.
In the TO-92 package, holding the part with the flat face toward you and the leads pointing down, the pins read Emitter, Base, Collector from left to right. A low saturation voltage (0.2 V maximum at 10 mA with 1 mA of base current) and high gain make it a common choice for driving LEDs, small relays, and other logic-level loads from a microcontroller pin.
2N3904 Transistor pinout
| Pin | Function | Type |
|---|---|---|
| E | Emitter | passive |
| B | ADC | input |
| C | Collector | passive |
How to wire the 2N3904 Transistor
Pin by pin, for the board you have.
| 2N3904 Transistor | Arduino Uno | Note |
|---|---|---|
| B | D2 | through a 1 kΩ resistor |
| 2N3904 Transistor | ESP32 DevKit V1 | Note |
|---|---|---|
| B | GPIO13 (D13) | through a 1 kΩ resistor |
| 2N3904 Transistor | Raspberry Pi Pico | Note |
|---|---|---|
| B | GP0 | through a 1 kΩ resistor |
Before you wire it
- Must have a base resistor between the driving pin and B.
- Low-side switching topology: load between VCC and Collector, Emitter to GND.
- Verify Ic does not exceed variant max rating.
- For saturation, ensure Ib >= Ic / hfe (use x10 overdrive for reliable saturation).
- Add flyback diode across inductive loads (motors, relays).
- No direct connection from Arduino pin to Base without a resistor.
- No load between Emitter and GND (that is high-side: use PNP instead).
- No exceeding Ic max for the chosen variant.
- No floating Base pin: always drive through a resistor or pull down.
- Always place a base resistor in series with the base when switching. The base-emitter junction behaves like a forward-biased diode, so driving it directly from a 5 V pin lets the current run away. A 1k-10k resistor is typical for a logic-level drive.
- Wire it as a low-side switch: emitter to ground, the load between the positive supply and the collector, and the base driven through its resistor. The load conducts only when the base is pulled high.
- Respect the 200 mA continuous collector current limit and the 625 mW dissipation limit. The 2N3904 cannot drive most DC motors or high-current loads directly; use a MOSFET or a dedicated driver for those, or keep the 2N3904 as the small-signal stage that switches a larger device.
- Add a flyback (freewheeling) diode across any inductive load, such as a relay coil or small motor, to clamp the voltage spike produced when the transistor turns off.
- Stay within the absolute maximum ratings: keep collector-emitter voltage under the 40 V VCEO limit and never reverse-bias the base-emitter junction beyond its 6 V VEBO rating.
Specifications
- Maximum supply voltage
- 40 V
- Dimensions
- 4.5 × 3.5 × 4.5 mm
Common mistakes
Driving the base without a resistor
Because the base-emitter junction acts like a forward-biased diode, connecting the base straight to a 5 V pin lets base current climb uncontrolled and can damage the transistor or the driving pin. Always add a series base resistor (commonly 1k-10k for logic-level control) to set the base current.
Assuming the pinout matches other TO-92 parts
With the flat face toward you and leads down, the 2N3904 reads Emitter, Base, Collector from left to right. Popular European parts such as the BC547 use the reverse order (Collector, Base, Emitter), so swapping one for the other without re-checking the pins connects the device backward.
Expecting it to drive a motor or heavy load
Collector current is capped at 200 mA and dissipation at 625 mW, and the datasheet only guarantees a gain of 30 at 100 mA. Motors, high-power LED strips, and large relays exceed those limits. Use a MOSFET or a purpose-built driver, and let the 2N3904 handle only the small-signal switching.
Omitting a flyback diode on a coil
When the transistor switches off an inductive load, the collapsing magnetic field produces a large voltage spike that can exceed the 40 V VCEO rating and destroy the part. Place a reverse-biased diode (such as a 1N4148 or 1N4007) across the coil.
Wiring it like a PNP
The 2N3904 is NPN, so the emitter goes to ground and it turns on when the base is pulled high. Its complement, the 2N3906, is PNP and switches the opposite way; mixing them up leaves the load stuck permanently on or off.
2N3904 Transistor questions
What is the 2N3904 pinout?
In onsemi's TO-92 (Case 29, Style 1) pin 1 is Emitter, pin 2 Base, pin 3 Collector (2N3903/2N3904 datasheet, p.1). Held with the flat face toward you and leads down, that reads E, B, C from left to right.
What resistor do I put on the base of a 2N3904?
Aim for base current of about one tenth of the load current, the ratio onsemi uses to specify saturation (VCE(sat) 0.2 V max at IC = 10 mA, IB = 1 mA; datasheet p.2). From a 5 V pin, 1 kΩ gives about 4.3 mA, enough for a 40 mA load; 4.7 kΩ suits a 10 mA LED. Larger values like 10 kΩ only saturate it for a few milliamps.
Does a 2N3904 work with 3.3 V microcontrollers?
Yes. A BJT needs base current, and a 3.3 V pin through 1 kΩ supplies about 2.6 mA ((3.3 V - 0.7 V) / 1 kΩ), enough to saturate it for loads up to about 26 mA. The load itself can run from 5 V or 12 V, as long as it stays under 40 V and 200 mA (datasheet, p.1).
How much current can a 2N3904 handle?
200 mA continuous collector current and 625 mW total dissipation at 25 °C ambient (datasheet, p.1). Its guaranteed gain drops to 30 at 100 mA (p.2), so above roughly 100 mA it needs heavy base drive; for more current use a 2N2222 or a MOSFET.
2N3904 vs 2N2222: which should I use?
Both are 40 V NPN parts with the same E-B-C order in the Tinkered studio. The 2N3904 is rated 200 mA (2N3904 datasheet, p.1) and suits signal switching and amplifiers; the P2N2222A is rated 600 mA (onsemi P2N2222A datasheet, p.1) and suits relays and heavier loads.
My 2N3904 circuit does nothing. What should I check?
Check the pin order first: with the flat face toward you it is E, B, C, and a BC547-style C-B-E layout puts it in backward. Then confirm the emitter goes to ground, the base resistor is connected to the driving pin, and the microcontroller ground is shared with the load supply ground.
This page as plain Markdown, for ChatGPT, Claude or your own agent. /components/transistor-2n3904.md