Arduino with IRL540N not working

I'm trying to control a 3V-6V, 1.3A(stall current) motor with that MOSFET but it's not spinning. I'm using 4xAA(6.25V) batteries. The datasheet I'm referring to is http://www.vishay.com/docs/91300/91300.pdf

I have everything hooked up as below:

  • MOSFET gate to 150ohm resistor to digital pin 3
  • MOSFET drain to motor
  • MOSFET source to battery ground and arduino ground
  • Other end of the motor to batteries

I output a PWM value of 142(multimeter says 2.83V) to the MOSFET gate. Based on the datasheet it should provide the motor with enough voltage and current but the motor is not getting any voltage, sometimes it goes to 0.03V but I think that's from the arduino pin.

I have also tried to:

  • supply the gate with 5V
  • swap the drain and source connections
  • used the MOSFET at the high side
    but it still doesn't work

Also, the motor works when it's connected directly to the batteries.

Its n-channel, should be low-side with source grounded.

Assuming you've got the pin-out right, it sounds like a dead MOSFET. Remember power MOSFETs are
static sensitive, this one in particular has a +/-10V absolute maximum gate/source voltage rating - exceeed
that and the gate oxide will blow and ruin the device.

Take proper anti-static precautions with MOSFETs, most have no protection zeners.

MarkT:
Its n-channel, should be low-side with source grounded.

Assuming you've got the pin-out right, it sounds like a dead MOSFET. Remember power MOSFETs are
static sensitive, this one in particular has a +/-10V absolute maximum gate/source voltage rating - exceeed
that and the gate oxide will blow and ruin the device.

Take proper anti-static precautions with MOSFETs, most have no protection zeners.

According to the datasheet it's gate-drain-source from "left" to "right", I even tried with 3 other IRL540 from the pack I bought. Btw I sure I didn't exceed 10V at the gate since none of my power supply are that high voltage

Maybe it's really a pack of dead MOSFET

The danger to the gate oxide is from static, not the supply. Handling precautions are needed. Never
do electronics in a room with a nylon carpet! Did your devices come in anti-static packaging? If not
that's why they don't work.

MarkT:
The danger to the gate oxide is from static, not the supply. Handling precautions are needed. Never
do electronics in a room with a nylon carpet! Did your devices come in anti-static packaging? If not
that's why they don't work.

I don't think it came in any anti static packing but it did came wrapped in bubble wraps. Tbh I haven't come across any post about dead MOSFET due to static, is there really a high chance my MOSFET is dead because of it?

Yes it is very easy, just touch them without having touched ground on a dry day with different fabrics on you and pouf :wink:
You can test them easily though: 5v to gate, source to ground 5v to led and 500 resistor to drain should light on the led then ground the gate, should switch it off.
Bye
Manu

Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Also a picture of your project so we can see your component layout.

Have you checked the value of your 150R resisitor?

Can you post your code?

Thanks.. Tom... :slight_smile:

manufwi:
Yes it is very easy, just touch them without having touched ground on a dry day with different fabrics on you and pouf :wink:
You can test them easily though: 5v to gate, source to ground 5v to led and 500 resistor to drain should light on the led then ground the gate, should switch it off.
Bye
Manu

I would try that but I think there's something else going on with my mosfet(more info below)

TomGeorge:
Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Also a picture of your project so we can see your component layout.

Have you checked the value of your 150R resisitor?

Can you post your code?

Thanks.. Tom... :slight_smile:

Circuit design:

Project:

Code:

void setup()
{
  pinMode(5, OUTPUT);

}

void loop()
{
  analogWrite(5, 153);
}

And I have confirm that with PWM value of 153, the D5 pin is giving about 3.04V. Also yes, my resistor value is around 148.8 ohms

New weird behaviour of the mosfet:
With the circuit configuration above but without plugging in the arduino ground and a little initial push at the motor shaft, my motor spins. The voltage across the motor is about 1.7V-1.8V(which I think explains why it needs a little initial push to start spinning).
With that ground left unplugged, I unplug the wire from D5 and my motor spins slightly faster(voltage across motor is about 2V). If I connect that unplugged D5 wire to ground, my motor decreases speed very very slowly(more than 30 seconds) until the motor voltage reaches 0

Other than that, I realise that, with or without the arduino ground connected, when I put an ammeter between the resistor and the gate like this:

It reads 0 amps
But when I connect the resistor to ground and put the ammeter between it like this:

It reads 15.3mA

That means the the gate isn't drawing any current at any time right? How's that possible if I can manipulate the motor voltage with the wire to D5?

Hi,
Your circuit diagram should be like this, you have gate drain and source correct on your protoboard.

The 10k makes sure that if the gate is not connected it will be kept at source potential.
google MOSFET tutorial

You will find that the MOSFET has high impedance gate.
If you analogWrite 255 what happens?
Where did you get the IRL540 MOSFETs.

Tom.... :slight_smile:

I would say MOSFETs have a very low impedance gate - but high DC resistance - ie they are large
capacitive loads that need a fair bit of current to switch rapidly - typically 500pF to 20nF for big discrete
power MOSFETs.

Hi,

MarkT:
I would say MOSFETs have a very low impedance gate - but high DC resistance - ie they are large
capacitive loads that need a fair bit of current to switch rapidly - typically 500pF to 20nF for big discrete
power MOSFETs.

I stand corrected.
Tom.... :slight_smile:
Its been most of the day since my last coffee.

TomGeorge:
Hi,
Your circuit diagram should be like this, you have gate drain and source correct on your protoboard.

The 10k makes sure that if the gate is not connected it will be kept at source potential.
google MOSFET tutorial

You will find that the MOSFET has high impedance gate.
If you analogWrite 255 what happens?
Where did you get the IRL540 MOSFETs.

Tom.... :slight_smile:

I read that the 10k resistor is only for when the gate isn't wired or when the arduino pinmode isn't set but for my case it seems that the mosfet is roughly working only when the arduino ground isn't connected. Anyway I will try that later and get back to you

I did try to wire the mosfet gate with arduino 5V pin but it's still behaving the same only that more voltage is going to the motor. I got that IC online from Aliexpress.com

MarkT:
I would say MOSFETs have a very low impedance gate - but high DC resistance - ie they are large
capacitive loads that need a fair bit of current to switch rapidly - typically 500pF to 20nF for big discrete
power MOSFETs.

Hmm which capacitance is that number referring to? According to the datasheet, IRL540N input capacitance is 2200pF, output is 560pF and reverse transfer is 140pF

Total gate charge divided by Vgs is the useful "capacitance" really...

Also the diagrams above show a signal MOSFET with a substrate connection - VMOS power
devices do not have a separate substrate as its integral with the drain connection. Power MOSFETs
do have an integral body diode which should be shown on the symbol, strictly speaking.

The circuit looks OK. maybe try with a led and a resistor instead of your motor. Normally you could dim it with PWM...
Hmm and are 4x AA enough, that is less than 5v, does the mosfet conducts if Vd is more than Vg?

So I tried placing a resistor(62k ohm because I don't have 10k) as Tom suggested and still nothing works as long as the arduino GND is connected to the source

Also, I tried entirely removing the arduino GND from the source and set the PWM to 255 and now sometimes it turns the motor on and off(by code) by itself very quickly sometimes it does it slowly like before. But then even when there's no gate voltage the motor is still getting 0.2V and the MOSFET gradually gets hotter until it's too hot to touch

MarkT:
Also the diagrams above show a signal MOSFET with a substrate connection - VMOS power
devices do not have a separate substrate as its integral with the drain connection. Power MOSFETs
do have an integral body diode which should be shown on the symbol, strictly speaking.

That symbol may be incorrect, the diagram is only meant to show the wiring nothing more. The actual MOSFET I'm using is IRL540N

manufwi:
And the batteries are weirdly connected on this diagram?? Or I am missing something

How's it weirdly connected? +side to motor, -side to source and arduino GND

Sorry for the "weirdly connected batteries", I edited afterwards as I mixed things up.
If you can try the circuit with a led and resistor (around 500 Ohms I'd say) instead of the motor. analogWriting 255 should switch the led full on and any lower value would dim it more and more.

Hi,
Can you connect your circuit up as in this diagram, take the UNO out of circuit.
And measure the voltages at A, B and C with respect to GND.

Thanks.. Tom... :slight_smile:

manufwi:
Sorry for the "weirdly connected batteries", I edited afterwards as I mixed things up.
If you can try the circuit with a led and resistor (around 500 Ohms I'd say) instead of the motor. analogWriting 255 should switch the led full on and any lower value would dim it more and more.

manufwi:
The circuit looks OK. maybe try with a led and a resistor instead of your motor. Normally you could dim it with PWM...
Hmm and are 4x AA enough, that is less than 5v, does the mosfet conducts if Vd is more than Vg?

I setup as you said and yeah the LED lights up and I can dim it

TomGeorge:
Hi,
Can you connect your circuit up as in this diagram, take the UNO out of circuit.
And measure the voltages at A, B and C with respect to GND.

Thanks.. Tom... :slight_smile:

A-GND: 5.06V
B-GND: 5.86V (Batt became weak after so many tests)
C-GND: 5.86V


What I have tried:

  • Remove the batteries and use the Arduino to supply the main circuit then connect my multimeter to where the motor would be. Result: voltage shown is around 5V as it should.

  • Remove the arduino and use the battery to power the main circuit and the gate then also connect the multimeter to where the motor should be. Result: voltage shown is 5.86V

  • Wire everything as it should be but replacing the motor with the multimeter. Result: voltage shown is 5.86V. However, when I connect the motor to where it should be, voltage across it drops from 5.86V to 0.8V

So conclusion, the MOSFET works and I don't understand the voltage drop when I plug in my motor. Is it a problem with my batteries or my motor?

Note: when connected directly to the batteries the motor spins and it can run from voltages as low as 2-3V

Hi,
Check the voltages at the S G and D pins of the MOSFET, it looks like the MOSFET not working.

Try rebuilding your circuit on another part of the protoboard, an case you have some connections that malfunctioning.

Tom... :slight_smile: