Aziz Bench

BS170 as a switch with Arduino and ESP32

Like the 2N7000 but rated for 500 mA. Its datasheet guarantees RDS(on) only with 10 V on the gate, so from 3.3 V or 5 V nothing is promised.

Transistor
BS170
N-channel MOSFET · TO-92 · onsemi
Max voltage
60 V
Max current
500 mA
RDS(on)
5 Ω at 10 V
TO-92 pinout
1D2G3S

From a 3.3 V or 5 V pin

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

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

Specifications

TypeN-channel MOSFET
PackageTO-92
Maximum voltage60 V
Maximum current500 mA
Threshold VGS(th)0.8 … 3 V
RDS(on), maximum5 Ω at 10 V (200 mA)
Gate voltage limit±20 V
Thermal resistanceθJA 357 °C/W
Maximum junction temperature150 °C
Datasheet usedonsemi

Pinout

PinFunction
1Drain
2Gate
3Source

Flat face toward you, leads down: pin 1 is on the left.

Similar parts

PartPackageRDS(on) at 3.3 VRDS(on) at 5 VMax voltageMax current
BS170TO-92nono60 V500 mA
2N7000TO-92no5.3 Ω60 V200 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 BS170 with your own load, supply, PWM frequency and temperature.

Other transistors

Frequently asked questions

Does the BS170 work with a 3.3 V ESP32?

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

What is the BS170 pinout?

TO-92: 1 drain, 2 gate, 3 source. Flat face toward you, leads down: pin 1 is on the left.

Source of the figures: onsemi datasheet (PDF)