Why am I destroying my MOSFETs?

I’ve been trying to figure this problem out for ages now and can’t see where I’m going wrong.

I’ve been trying to control the speed of a water pump that runs 12v 3amps at full power. I want to control it by PWM from a NODEMCU and a MOSFET. The MOSFET I’m using is a STP36NF06L N-channel MOSFET.

When I ground or charge the gate without the NODEMCU connected the motor turns off and on fine, but as soon I connect the gate to pin D5 on the NODEMCU the MOSFET overheats and does not work again.

I’ve destroyed 5 MOSFETs trying to figure this out so now I’m in a blind rage >:( lol.

Change 150 ohm to 2k, 10k to 20K(or remove it), add protecting diode parallel to pomp terminals

Shouldn’t that back EMF diode be fully hooked up? Also, it should be as close to the motor as possible.

https://www.google.ca/search?rlz=1C1AFAB_enCA475&tbm=isch&q=motor+protection+diode&spell=1&sa=X&ved=0ahUKEwiLob_1le_aAhXj54MKHePYAtkQBQg8KAA&biw=1440&bih=744&dpr=1

why you are using PWM do you need control pump speed ?

ted:
Change 150 ohm to 2k, 10k to 20K(or remove it), add protecting diode parallel to pomp terminals

Thank you for your help. That's all I needed to do? I was so close yet so far.

I had a diode connected to the pump terminals originally but when I couldn't get the thing working I took all the wiring apart to start from scratch. The MOSFET and the resistors aren't correct in the picture I just threw what I had on the breadboard for demo purposes.

Thank you again for your help. I'll be ordering more MOSFETs to do it correctly this time.

UPDATE: As Wawa pointed out, I was off kilter, here. I had forgotten that we're talking about a NODEMCU, here, NOT an Arduino. Thus, the supply voltage [and thus the gate drive voltage] is 3.3V and not 5V. And, the available drive current is 12mA, not 40mA -- huge difference! So, the prevailing indication is that the STP36NF06L MOSFET is just not able to PWM drive that pump, and that a MOSFET more like the one suggested by larsgregersen, the IRL540, which I agree is a better choice, but still might not be enough. This one, maybe: IPP052N06L3GXKSA1, or this one: STP200N3LL These two have rather high input capacitance, but it should still only take 12mA a few hundreds of nS to turn them on, and by the time a couple of volts exist at the Gate, they are already able to handle tens of Amps at their Drain. And, they aren't all that expensive. The edits, below, indicate my errors, and offer insights from my new POV :wink:

It sounds like the MOSFET isn't turning ON/OFF fast enough. To test for this, try using the Blink Sketch, but use Pin 5, instead of the usual LED_BUILTIN constant:

void setup() {
  pinMode(5, OUTPUT);
}
void loop() {
  digitalWrite(5, HIGH);   
  delay(1000);          
  digitalWrite(5, LOW);   
  delay(1000);                   
}

If that works, then try adding a 47 to 100pF capacitor across the 150Ω resistor. That will "punch" the Gate with a burst of current, to turn the MOSFET ON/OFF faster [i.e. it will overcome the Gate capacitance].

If that doesn't do it, then try increasing the 150Ω resistor to 220Ω 275Ω [but leave the capacitor there].

If that doesn't do it, then you may need to drive the MOSFET with a transistor or MOSFET driver -- or find a MOSFET with a lower Gate Capacitance, that can still drive your pump or find a MOSFET that functions better at a 3.3V Gate voltage. OR, use a lower PWM frequency [though, that may make the pump hum like a SOB!].

If the Blink Sketch doesn't turn the pump on and off, then, first, try a different Digital Pin, and if that doesn't do it, then try all the other Digital pins. If none of them properly drive the MOSFET, then perhaps the MCU board is bad. If that isn't it, then I don't know what the heck is going on, other than the MOSFET is in some kind of failure mode where it is leaking so much current at the Gate, that your MCU can't drive it. To test for that, put an Ammeter (or Multimeter set to read current -- start with the highest current range) between the MCU pin and the MOSFET Gate. If it's more than a microamp, then something is wrong (though, the current might jump and settle back to zero -- that's normal)! If it's on the order of milliamps, then something is VERY wrong -- and VERY weird! Try a different MOSFET!

If the current reading is at zero, even on the lowest current setting [it might jump and then settle back to 0, which is normal -- as long as it comes back to zero, then it's good], then, perhaps more than one of the MCU pins is bad [or all of them are bad] -- try others until you run out, or you find one that will drive the MOSFET properly. Then, try your PWM sketch, but with the capacitor in parallel with the 150/220Ω resistor. Also, you could set your Multimeter to DC Volts [20V], and monitor the MCU pin. The voltage should go to ~5V ~3.3V, then to ~0V, and back, once a second. If the voltage drops more than a few tenths of a volt, when it should be 5V 3.3V or doesn't even come close to 0, when it should be 0, then the MCU pin is not driving the MOSFET properly -- Try watching the +5V +3V pin -- it should stay at +5V +3.3V. If it drops below 4.5V 3.0V, then check the Vin pin (assuming you are powering your MCU board that way). In other words, make sure the Power Supply is supplying adequate voltage for the whole 2 second period of the Blink test.

Due_unto:
Shouldn't that back EMF diode be fully hooked up? Also, it should be as close to the motor as possible.

The diode was connected originally when I was testing it I just added it to the picture for demo purposes.

But on your advice I will be putting it nearer the motor next time.

Thank you.

ted:
why you are using PWM do you need control pump speed ?

Yes, I'm trying to control the pump speed. It's for an aeroponics system I'm trying to automate via WiFi. I have everything else working I just can't figure out the MOSFET side of things. The reason I want a PMW is to control the water pressure via my phone.

Thank you ReverseEMF.

I'll put your advice into practice once I get the parts.

I'll be ordering extra this time as I feel like I'll need them :slight_smile:

That diode looks backward, connect with stripe end to + (blue wire). Switching the motor without the diode (connected correctly) and no heatsink is probably what killed your MOSFETs.
MosMot(1).png

outsider:
That diode looks backward, connect with stripe end to + (blue wire).

I don't think the picture has come out too well. The disconnected side of the diode in the picture was the striped side.

Thank you though for confirming that what I thought was correct was correct. At least I got something right lol

outsider:
That diode looks backward, connect with stripe end to + (blue wire). Switching the motor without the diode (connected correctly) and no heatsink is probably what killed your MOSFETs.

...and, actually, after a second look at the photo, it looks like the Cathode side of the Diode is disconnected. But, the diode looks like it's oriented properly.

MosMot(1).png

It’s no biggie, but it would be more “correct” to put that 10k resistor on the other side of the 150Ω resistor (i.e. from the Gate to Gnd. The point of the 10k resistor is to insure the Gate returns to ground, should the input to the Gate wind up in a float condition. AND, that resistor can be much higher in value – more like 100k or even as high as 1MΩ.

ReverseEMF:
...and, actually, after a second look at the photo, it looks like the Cathode side of the Diode is disconnected. But, the diode looks like it's oriented properly.

I had just rested the diode on the wires for the picture, neither side were connected. It wasn't like that when I was testing... Honest lol. I should have pointed that out in the original post, sorry.

Lesson learnt for next time. Don't be lazy and connect everything as it was when taking a picture :slight_smile:

ReverseEMF:
It's no biggie, but it would be more "correct" to put that 10k resistor on the other side of the 150Ω resistor (i.e. from the Gate to Gnd. The point of the 10k resistor is to insure the Gate returns to ground, should the input to the Gate wind up in a float condition. AND, that resistor can be much higher in value -- more like 100k or even as high as 1MΩ.

Thank you. I'm started to feel more confident it will work now with all the advice. I just have to wait until next week for my parts.

ted:
Change 150 ohm to 2k...

No, dont do that.
150ohm is low enough to ensure fast switching, and high enough to not overload the Arduino pin.

https://www.gammon.com.au/motors

ReverseEMF:
It's no biggie, but it would be more "correct" to put that 10k resistor on the other side of the 150Ω resistor (i.e. from the Gate to Gnd.

No, that would create a voltage divider that lowers gate drive.
For the gate, it's the same if the bleed resistor is 10000 or 10150 ohm.
10k could be higher, but why. It only draws 333 or 500uA from the pin.

A diode across the pump is needed.
It's drawn correctly, as it shouldn't conduct during normal operation.
Leo..

It's no biggie, but it would be more "correct" to put that 10k resistor on the other side of the 150Ω resistor (i.e. from the Gate to Gnd.

Is this going to be an on going argument like the 1023 vs 1024 debacle? :slight_smile:

outsider:
Is this going to be an on going argument like the 1023 vs 1024 debacle? :slight_smile:

hahaha. Probably not. The 1023 vs 1024 becomes clear when people divide 1023 into 5V, and 1024 into 5V. The 5/1024 gives a nice clean result. The 5/1023 doesn't give a nice round result --- in the calculator. That's aside from the details about half-level 'bin 1000000000' (level 512, with level 1 being lowest level and level 1024 being highest level) being used to represent exactly half of 5V (ie. 2.5V).

Wawa:
No, dont do that.
150ohm is low enough to ensure fast switching, and high enough to not overload the Arduino pin.

https://www.gammon.com.au/motors
No, that would create a voltage divider that lowers gate drive.
For the gate, it's the same if the bleed resistor is 10000 or 10150 ohm.
10k could be higher, but why. It only draws 333 or 500uA from the pin.

Actually, the "10k" resistor is usually more like 470k. And with it that high, the voltage divider issue is pretty much moot.