I need to short-circuit a power source using a microcontroller to measure the short-circuit current capacity (less than 10A). So the impedance of the short circuit should be as low as possible.
I was using a 5V relay commanded by a BJT transistor and it works very well. But for space reasons I would like to test other options, like using a MOSFET transistor working as a switch. I tested with the logic level NMOS IRL540N as shown in diagram and it worked fine. Putting 5V at the gate closes the short circuit with about 36mΩ resistance.
But the problem is when the power supply is connected wrongly with reverse polarity the NMOS always conducts, even with a low microcontroller output. I don't understand why it conducts as VGS remains null even with reverse polarity connected.
How can I protect the MOSFET to be always off when reverse polarity is connected to drain-source?
The power supply could reach up to 25V. Is the MOSFET always secure? The absolute maximum rating for Gate-to-Source Voltage is 20V, but in this application VGS is always lower than 5V.