MOSFET – Switching 12V Pump with N-Channel MOSFET Burned Out ESP32

esp32mosfet

I made a simple circuit based on an ESP32 for my watering system.

I built this circuit to switch a 12 V pump on and off:

enter image description here

The circuit is powered by a USB power bank and a boost converter to convert 5 V to 12 V. The pump is switched using an NCE6050A N-channel MOSFET. I've added an XKC-Y23A liquid sensor to detect when the water is running low.

The circuit worked properly for several days but after that it stopped working.

I noticed that the AMS1117 LDO converter and the ESP32 chip on my DEV kit board became very hot.

I suppose that something burned it out, but I can't understand what is wrong with the circuit. Can anyone help me find the cause of the issue?

Best Answer

You should have a flyback diode across the load, otherwise the MOSFET will likely avalanche and die eventually due to pump motor and wiring inductance.

You should be using a logic level MOSFET with guaranteed Rds(on) at 3.3V or less, not 10V as the one you have. Unless you can convince your supplier to only sell you 'typical' units and not ones that merely conform to the datasheet limits. You may have trouble finding one in a TO-220 package, most are SMT. If you find such a MOSFET you can add a large-ish series gate resistor and protect the ESP32 via that, however it will slow the MOSFET switching and that's hard on the MOSFET. Also don't divide it down by having a G-S resistor that reduces the Vgs(on) if you do this.

If you want to use the particular MOSFET you have (with the flyback diode) you can make a simple gate driver with a couple transistors that will shift the 3.3V to 12V.

schematic

simulate this circuit – Schematic created using CircuitLab

Related Topic