Aziz Bench

2N7000 as a switch with Arduino and ESP32

A small N-channel MOSFET for signals and loads up to 200 mA: level shifting, LEDs, relay coils. Its RDS(on) is guaranteed from 4.5 V (5.3 Ω), not at 3.3 V.

Transistor
2N7000
N-channel MOSFET · TO-92 · onsemi
Max voltage
60 V
Max current
200 mA
RDS(on)
5.3 Ω at 4.5 V
TO-92 pinout
1S2G3D

From a 3.3 V or 5 V pin

PinVerdictWhyIn free air
ESP32 · 3.3 VNot guaranteednothing guaranteed below 4.5 V—
Arduino Uno · 5 VWorksRDS(on) at most 5.3 Ω guaranteed from 4.5 V183 mA (heat)

In free air at 25 °C, with the junction 25 °C below its 150 °C maximum and θJA 313 °C/W, at the guaranteed RDS(on) raised with temperature.

Specifications

TypeN-channel MOSFET
PackageTO-92
Maximum voltage60 V
Maximum current200 mA
Threshold VGS(th)0.8 … 3 V
RDS(on), maximum5.3 Ω at 4.5 V (75 mA) · 5 Ω at 10 V (500 mA)
Gate voltage limit±20 V
Thermal resistanceθJA 313 °C/W
Maximum junction temperature150 °C
Datasheet usedonsemi

Pinout

PinFunction
1Source
2Gate
3Drain

Flat face toward you, leads down: pin 1 is on the left. This is the straight-lead version; onsemi’s lead-formed version (case 135AR) is gate, source, drain.

Similar parts

PartPackageRDS(on) at 3.3 VRDS(on) at 5 VMax voltageMax current
2N7000TO-92no5.3 Ω60 V200 mA
BS170TO-92nono60 V500 mA
AO3400ASOT-2348 mΩ32 mΩ30 V5.7 A
Si2302SOT-2375 mΩ57 mΩ20 V2.6 A
IRLML6344SOT-2337 mΩ29 mΩ30 V5 A
IRLZ44NTO-220no25 mΩ55 V47 A
IRLB8721TO-220no16 mΩ30 V62 A
IRF520TO-220nono100 V9.2 A
IRF540NTO-220nono100 V33 A

Tips

Keep the 10 kΩ from gate to ground: while the microcontroller boots its pins float and the MOSFET could turn on by itself.

Every coil needs a flyback diode across it, cathode to the positive supply. Without it the voltage spike at turn-off can destroy the transistor at the first switching.

Open the calculator →Check the 2N7000 with your own load, supply, PWM frequency and temperature.

Other transistors

Frequently asked questions

Does the 2N7000 work with a 3.3 V ESP32?

Not reliably: the threshold is at most 3 V, but RDS(on) is guaranteed only from 4.5 V. It may switch small currents, nothing more is promised. Use a MOSFET guaranteed at 2.5 V such as the AO3400A.

How much current can the 2N7000 switch without a heatsink?

About 183 mA from a 5 V Arduino pin, in free air at 25 °C, keeping the junction 25 °C below its 150 °C maximum (limit: heat).

What is the 2N7000 pinout?

TO-92: 1 source, 2 gate, 3 drain. Flat face toward you, leads down: pin 1 is on the left. This is the straight-lead version; onsemi’s lead-formed version (case 135AR) is gate, source, drain.

Source of the figures: onsemi datasheet (PDF)