user17255: 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   --> port to ESP32
2    Drain  --> (-) pump
3    Source --> 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 --> (-) 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 "clucking" 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?

user4143: 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.

17255: <p>I have a 12 VDC pump, 8.5A, connected to a MOSFET transistor PSMN5R6-100PS,127.</p>
<p>The connection from the transistor to transformer, pump and a ESP32:</p>
<p>1    Gate   --&gt; port to ESP32</p>
<p>2    Drain  --&gt; (-) pump</p>
<p>3    Source --&gt; Gnd ESP32, (-) transformer</p>
<p>(+) transformer to (+) pump</p>
<p>This is, as I understand it, how it ought to work. But with this configuration it doesn't...
But changing <strong>3    Source --&gt; (-) transformer</strong>, 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?</p>
 4143: <p>As can be seen from <a href="https://assets.nexperia.com/documents/data-sheet/PSMN5R6-100PS.pdf" rel="nofollow noreferrer">the datasheet for the PSNB5R6</a> (Fig 7) at 3.3V the MOSFET is barely even beginning to switch on.</p>
<p>You need to select a more suitable MOSFET that switches on fully at a voltage well below 3.3V, such as the <a href="https://uk.farnell.com/stmicroelectronics/stp40nf03l/mosfet-n-to-220/dp/9803149" rel="nofollow noreferrer">STP40NF04L</a>.</p>
