IRL540N is not completely switching of and turns off if I disconnect the gate

Hi,

I've never used mosfets and I'm trying to use a IRL540N to PWM control a 2 wire PC fan (12V/0.43A/5.2W). In this stage I haven't implemented the PWM part because I want to test / understand the function of the Mosfet. Here are my questions:

  • If I connect the gate (left cable) to 5VCC the fan starts after a short delay. If I disconnect the gate, the fan stops. Shouldn't it keep running?
  • If I connect the gate to 5V GND (common ground) the fan doesn't stop completely. It still clicks a bit and tries to spin (what ends up in a forward/backward loop because the voltage isn't high enough)

Am I doing anything wrong? Am I understanding anything wrong?

Kind regards

Wilko

The linked image isn't working. Here is what I've done as an attachment.

You need a flyback diode for this. You can fry a mosfet without one on a fan. Google flyback diode.

The gate voltage once removed will go to ground through the 10K resistor you have tied to ground.

lza:
The linked image isn't working. Here is what I've done as an attachment.

Here's that image attachment:


And, here's how I did that:
https://forum.arduino.cc/index.php?topic=364156.msg3749026#msg3749026

Tanks for your answer. I'll do my research on the flyback diode. If I remove the pull down resistor the fan still stops if I disconnect the gate from VCC.

wolframore:
You need a flyback diode for this. You can fry a mosfet without one on a fan. Google flyback diode.

The gate voltage once removed will go to ground through the 10K resistor you have tied to ground.

A mosfet is not a relay. There is some leakage through the gate

A MOSFET isn't a magical device. If the gate is not connected to anything you can't really expect it to be switched on.

Steve

lza:
Hi,

I've never used mosfets and I'm trying to use a IRL540N to PWM control a 2 wire PC fan (12V/0.43A/5.2W). In this stage I haven't implemented the PWM part because I want to test / understand the function of the Mosfet. Here are my questions:

  • If I connect the gate (left cable) to 5VCC the fan starts after a short delay. If I disconnect the gate, the fan stops. Shouldn't it keep running?
  • If I connect the gate to 5V GND (common ground) the fan doesn't stop completely. It still clicks a bit and tries to spin (what ends up in a forward/backward loop because the voltage isn't high enough)

Am I doing anything wrong? Am I understanding anything wrong?

Kind regards

Wilko

If the gate is shorted to the source, it should be fully off - if not the device is toast, its likely been
damaged by static electricity or overvoltage. But first double check your wiring is correct.

MOSFETs are highly static sensitive, and most will not tolerate more than 20 or 30V between gate
and source, which means if you don't wear static armband and touch the gate pin you can destroy
the device without even realizing.
If you leave the gate floating, the device may stay on for a while, but is likely to slowly
turn off due to leakage currents, but the behaviour isn't well defined, and if the drain is more than
30V above the source you should never let the gate float, again the device may be killed.

lza:
If I connect the gate (left cable) to 5VCC the fan starts after a short delay. If I disconnect the gate, the fan stops. Shouldn't it keep running?

No, because the 10k Pull-Down resistor quickly pulls the gate down to Gnd level [zero, or near zero, volts]. With the gate at a voltage below the threshold voltage, the MOSFET will be OFF [i.e. the channel will conduct *nearly* no current].

lza:
[If I connect the gate to 5V GND (common ground) the fan doesn't stop completely. It still clicks a bit and tries to spin (what ends up in a forward/backward loop because the voltage isn't high enough)

The statement "5V GND (common ground)" pretty much makes no sense, so not sure what you're asking. if the voltage between the Source and the Gate is zero, or something below the Gate Threshold voltage, the FAN should not receive any appreciable power, thus it should stop turning [after friction overcomes inertion, of course :wink: ].

Also, the IRF540 is a poor choice for PWM at such low Gate drive voltage, because the Gate Threshold is, potentially, rather high [4V max], and because the Arduino probably won't be able to supply enough current to charge/discharge the Gate capacitance rapidly enough [though, at the low frequency involved, this might not be an issue] A MOSFET gate driver [run at 12V] is a good idea. In fact, it's wise to just always use a gate driver for PWM.

And, as wolframore pointed out, you should include a flyback diode across the fan. A 1N4004, with the Cathode connected to the the 12V supply side of the fan, should suffice.

Have a look at my Blog at:
https://www.sinistercircuits.com//Blog/IsItLogicLevelOrWhat/index.php

wolframore:
You need a flyback diode for this. You can fry a mosfet without one on a fan. Google flyback diode.

Actually, this is most likely a brushless (motor) fan - that would not apply.

ReverseEMF:
Also, the IRF540 is a poor choice for PWM at such low Gate drive voltage, because the Gate Threshold is, potentially, rather high [4V max],

Actually, for a 150 mA computer fan - or anything less than 1 Amp, the IRF540 is quite OK. Look at the datasheet, figure 2 - worst case transfer characteristics. For less than 1 A at 4.5 V, VDS is less than 200 mV, thus less than 200 mW dissipation - OK without a heatsink.

ReverseEMF:
Also, the IRF540 is a poor choice for PWM at such low Gate drive voltage,

So it's good that we're talking about an IRL540 which the OP is using and which doesn't have the same problems.

Steve

Hi,
Can you post some pictures of your project so we can see your component layout?
Have you checked that the gnd connections are complete from the micro to the mosfet and 12V supply?

Thanks.. Tom.. :slight_smile:

Thanks for all the help. it looks like the Mosfet was not working properly. I changed it and everything works fine. Next step: Changing the sketch to add PWM functionality.

@Paul__B: Yes, it is a brushless fan (Sunon PMD1206PMB3A). The design will be based on parts I do have and that's why the IRL540N comes into play. Originally I had the hope, that the fan has a PWM wire, unless it has 4 wires.

So - a flyback diode is not need?

Side question: Can I use this mosfets for a 2A to 2.5A load, too? This time just for switching 12V. No PWM.

TomGeorge:
Have you checked that the gnd connections are complete from the micro to the mosfet and 12V supply?

Do you mean if all grounds are connected? Yes, they are connected.

lza:
So - a flyback diode is not need?

Anytime large inductance, like in a fan motor, you need a flyback diode.

Paul__B:
Actually, for a 150 mA computer fan - or anything less than 1 Amp, the IRF540 is quite OK. Look at the datasheet, figure 2 - worst case transfer characteristics. For less than 1 A at 4.5 V, VDS is less than 200 mV, thus less than 200 mW dissipation - OK without a heatsink.

Yeah, I see that now :stuck_out_tongue:

ReverseEMF:
Anytime large inductance, like in a fan motor, you need a flyback diode.

Do you know how a brushless computer fan works?

Everything works right now. Just another question:

I'm using a IRL540N and lot of post are talking about a IRF540N. What's the difference?

I'm using a IRL540N and lot of post are talking about a IRF540N. What's the difference?

A IRL540N will fully turn on with a 5V signal you get from an Arduino.

A IRF540N needs a 10V signal to fully turn it on and so it will not work properly with an Arduino.

Thanks. So I keep using the IRL540N.

Grumpy_Mike:
A IRL540N will fully turn on with a 5V signal you get from an Arduino.

A IRF540N needs a 10V signal to fully turn it on and so it will not work properly with an Arduino.