Aziz Bench

IRF520 as a switch with Arduino and ESP32

The MOSFET on the popular IRF520 module. It is a standard MOSFET: RDS(on) is guaranteed only at 10 V and the threshold goes up to 4 V, so from a 3.3 V pin it may not turn on at all.

Transistor
IRF520
N-channel MOSFET · TO-220 · Vishay
Max voltage
100 V
Max current
9.2 A
RDS(on)
270 mΩ at 10 V
TO-220 pinout
1G2D3S

From a 3.3 V or 5 V pin

PinVerdictWhyIn free air
ESP32 · 3.3 VNothreshold up to 4 V—
Arduino Uno · 5 VNot guaranteednothing guaranteed below 10 V—

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

Specifications

TypeN-channel MOSFET
PackageTO-220
Maximum voltage100 V
Maximum current9.2 A
Threshold VGS(th)2 … 4 V
RDS(on), maximum270 mΩ at 10 V (5.5 A)
Gate voltage limit±20 V
Gate charge16 nC at 10 V
Thermal resistanceθJA 62 °C/W · θJC 2.5 °C/W
Maximum junction temperature175 °C
Datasheet usedVishay

Pinout

PinFunction
1Gate
2Drain
3Source

Printed face toward you, leads down: pin 1 is on the left. The metal tab is connected to pin 2.

Similar parts

PartPackageRDS(on) at 3.3 VRDS(on) at 5 VMax voltageMax current
IRF520TO-220nono100 V9.2 A
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
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.

A TO-220 in free air sheds little heat: fit a heatsink, insulated if the tab must not touch it (the tab is the drain or collector).

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

Other transistors

Frequently asked questions

Does the IRF520 work with a 3.3 V ESP32?

No: its threshold can be as high as 4 V, so a 3.3 V pin may not turn the IRF520 on at all. Use a MOSFET guaranteed at 2.5 V such as the AO3400A, or a gate driver.

What is the IRF520 pinout?

TO-220: 1 gate, 2 drain, 3 source. Printed face toward you, leads down: pin 1 is on the left. The metal tab is connected to pin 2.

Source of the figures: Vishay datasheet (PDF)