# Is my mosfet IRF540N OK ? Help to understand MOSFET behaviour

I am new to using MOSFETs. To help check the MOSFETs, I made a small circuit as in the schematic below on a perforated board. My test MOSFET is IRF540N. Supply source is a Lead Acid battery of 12V.

I am keeping $V_{GS} = 0$V (switch open). I expect when I apply the source, the MOSFET will hold and hold forever, as the supply voltage is well below the Breakdown Voltage.

But, I see the voltage across DS slowly falling and voltage across $R_1$ slowly rising till the voltage is about equal across $R_1$ and the MOSFET. Then it rises too. This keeps repeating.

If I short $R_1$, the MOSFET will blow in 1-2 min.

If anybody can help me understand where I am going wrong, that will be greatly appreciated. simulate this circuit – Schematic created using CircuitLab

Hook it up like this. R2 can be much higher than 10K, very high values will cause it to switch off slower.

The MOSFET is switched on by having a positive voltage of a few volts on the gate relative to the source. It is switched off by having 0V. The gate behaves electrically like a capacitor of some nF, so you have to charge and discharge it just like a capacitor. If you leave the gate open (floating) it will tend to maintain the same state, sometimes for a surprisingly long period of time, before eventually leakage causes it to change.

If you're using a heavy load instead of R1, you want to make sure that the MOSFET is always cleanly on or off, not somewhere in-between where it will get hot. For example, if your 12V was a car battery and R1 was a heater, if you allowed the car battery to discharge to flat, there might be a point where the MOSFET was destroyed because it got too hot. Same thing could happen a lot faster (with a heavy load) if you allow the gate to float. simulate this circuit – Schematic created using CircuitLab

I am keeping VGS=0V (switch open)

No, you're not. When the switch is open $V_{GS}$ isn't 0V, it's undefined. The input is floating and has no set voltage.

1. It is configured as a high side switch. $V_{gs}$ can never be high enough to turn it on.
2. $V_{gs}$ is not zero when the switch is open, it is floating.
Put it on the low side, add a $100 \text k\Omega$ pull-down to ground, and try again.