Unreliable function of transistor, pump and ESP32 I have a 12 VDC pump, 8.5A, connected to a MOSFET transistor PSMN5R6-100PS,127.
The connection from the transistor to transformer, pump and a ESP32:
1    Gate   --&gt; port to ESP32
2    Drain  --&gt; (-) pump
3    Source --&gt; Gnd ESP32, (-) transformer
(+) transformer to (+) pump
This is, as I understand it, how it ought to work. But with this configuration it doesn't...
But changing 3    Source --&gt; (-) transformer, removing the Gnd connection to the ESP32, then it works. It, however, seems to be some kind of leakage in terms of current because the pump has a &quot;clucking&quot; sound, not fully activating, just making a sound. Sometimes it doesn't work at all, where a reset makes it work again. Any ideas how I can fix it reliably?
As can be seen from the datasheet for the PSNB5R6 (Fig 7) at 3.3V the MOSFET is barely even beginning to switch on.
You need to select a more suitable MOSFET that switches on fully at a voltage well below 3.3V, such as the STP40NF04L.