# Do I need a MOSFET Driver to make this work?

I need to control a resistive load from a PWM output from an Arduino Nano.

With my very limited knowledge of MOSFETs, I thought about using the following circuit:

Will this work as-is, or do I need some kind of MOSFET driver?

Thank you.

This should work for a purely resistive load.

An IRL3705N would be a better choice as its Rds(on) value is 18mΩ at Vgs = 4v.

I like to use 10k instead of 100k.

larryd:
This should work for a purely resistive load.

An IRL3705N would be a better choice as its Rds(on) value is 18mΩ at Vgs = 4v.

I like to use 10k instead of 100k.

Thank you - and at 18mΩ I probably need much less of a heat sink.

Yes, 12V resistance heater element.

Question: With the 1K/10K resistance split, will the Nano provide enough voltage to fully turn on the MOSFET?

Also, I'm going to be ordering a half dozen of these. Can you suggest a complementary P-Channel MOSFET like this one? May as well stock both. Thanks

Question: With the 1K/10K resistance split, will the Nano provide enough voltage to fully turn on the MOSFET?

There is no split. Look closely at where the output of the Nano connects to the resistors.

PerryBebbington:
There is no split. Look closely at where the output of the Nano connects to the resistors.

OK, I'm confused (....nothing new) Doesn't the 1K/10K form a voltage divider so that the Gate is only seeing 10/11ths of the Nano's output voltage? Or does the fact that the Gate is such high impedance mean that it's seeing the full voltage when it's above zero? Maybe I'm overthinking this.

No, the two resistors in your diagram ‘do not’ form a voltage divider.

If the Arduino output pin was connected to the 1k (suggest you change this to 220) and the other end of the 1k was then connected to the top of the 100k (10k) the two resistors would then from a voltage divider.

BTW you can consider the input resistance of a MOSFET as infinitely large.

Your diagram is the proper way to connect a circuit like this.

There are a list of suggested MOSFETs just to the left of the title block in the image below.

A good logic P channel MOSFET is NDP6020P.
VGSS Gate-Source Voltage - Continuous ±8V <———<<<< This must be adhered too.

Thank you. Makes complete sense now that I look at it again. And thanks for the MOSFET suggestion.

larryd:
This should work for a purely resistive load.

An IRL3705N would be a better choice as its Rds(on) value is 18mΩ at Vgs = 4v.

I like to use 10k instead of 100k.

Agreed on the better spec mosfet and the use of 10k vs 100k. I would suggest, however, removing the 1k gate resistor as it's not needed and it slows down the mosfet switching time, causing it to remain in it's linear region longer which will cause to dissipate more power (i.e.) get hotter than it would if it was directly driven.

Most definitely keep the 220 ohm resistor, it protects the Arduino should the MOSFET fail shorted amongst other things.

MarkT:
Most definitely keep the 220 ohm resistor, it protects the Arduino should the MOSFET fail shorted amongst other things.

A mosfet almost always fails shorted... but shorted drain to source. Nothing happens on the gate (which is what's connected to an Arduino pin.)

Why do mosfet circuits have "high power" gate drivers while in Arduino land everyone needlessly slows down the switching time by adding a gate resistor?

Does this mean all the engineers are wrong and a handful of hobbiests are right? I don't think so.

IraSch:
I need to control a resistive load from a PWM output from an Arduino Nano.

With my very limited knowledge of MOSFETs, I thought about using the following circuit:

Will this work as-is, or do I need some kind of MOSFET driver?

Thank you.

No idea, because it totally depends on the MOSFET, the load and the frequency of PWM. For heavier loads at higher voltages and powers, and for higher frequencies of PWM the need for properly strong gate drive increases.

krupski:
A mosfet almost always fails shorted... but shorted drain to source. Nothing happens on the gate (which is what's connected to an Arduino pin.)

If a MOSFET fails shorted, the gate is also usually shorted - the thing melted or partially vaporized after all!

Why do mosfet circuits have "high power" gate drivers while in Arduino land everyone needlessly slows down the switching time by adding a gate resistor?

Does this mean all the engineers are wrong and a handful of hobbiests are right? I don't think so.

Arduino pin specifications absolute max 40mA. MOSFET gates can handle amps, resistor keeps things in spec, good engineering.

MarkT:
Arduino pin specifications absolute max 40mA. MOSFET gates can handle amps, resistor keeps things in spec, good engineering.

The specifications are absolute maximum 40mA DC. Good engineering requires good reading. MOSFET Gate is not very different from other capacitive loads (piezo speakers, CMOS inputs, long wires) that are used without protection resistor without fear and without any observed damage as far as I know.

Absolute maximum 40mA is absolute maximum never exceed (ie your warantee is invalid!), nothing to do with DC v. AC.

The problem is the manufacturer has not characterized the capacitive driving ability of the pins at all, so its not known unless you go and do that yourself (which is non-trivial and very time-consuming). They know that if you stick below 40mA it will last. Current spikes exceeding that might or might not be a reliability issue for certain sizes and duration of spike.

One thing that's definite is toggling a pin at 1MHz into a large MOSFET's gate will draw > 40mA pretty much continuously and cook it. But where to you draw the line? What capacitance? What frequency? Its pure guesswork, not solid engineering until you go and do the reliability tests, develop a model for the damage mechanism and make it fit the data. And you have to redo that for each change to the manufacturing process
potentially too...

MarkT:
Absolute maximum 40mA is absolute maximum never exceed (ie your warantee is invalid!), nothing to do with DC v. AC.

In all AVR datasheets I have checked there is something like:

There is ALWAYS the "DC". Why do YOU think they used it? Do you really think they mean instantaneous current but they have added the "DC" because it looks more professional?

I think they are not idiots and when they write DC current they mean DC current. The pins MUST be designed to survive "reasonable" capacitive load. You are right, "reasonable" is not defined.

MarkT:
One thing that's definite is toggling a pin at 1MHz into a large MOSFET's gate will draw > 40mA pretty much continuously and cook it.

It is NOT definite until you take a MOSFET and actually damage a pin by something like that. But I believe it is possible. You probably need VERY large expensive MOSFET for this. You need it because you are probably driving a very heavy load. But since Arduino is not able to charge and discharge the Gate fast enough you have the MOSFET in its linear region - it will die very quickly, maybe faster than the pin driving it. A Gate resistor would protect the Arduino but make it even worse for the MOSFET. The whole setup was bad from the very beginning - the resistor only reduces losses.

MarkT:
But where to you draw the line? What capacitance? What frequency? Its pure guesswork, not solid engineering ...

But you need ALWAYS to draw the line! To repeat myself - a CMOS input is a MOSFET gate (in fact many MOSFETs). Is it safe to drive it without a current limiting resistor? I think so. And what about 2 inputs from one pin? It is also OK. And 1000000 inputs? NO! Where is the line???
And what about wires. Is 10mm of board trace OK? What about 10 cm connecting cable? And what about 1km?
You draw the line in a very simple way: any capacitive load and frequency is OK unless it is a MOSFET Gate (and probably a capacitor). It is so simple it misses reality I am afraid. Example:

OP's MOSFET has total Gate charge about 5nC. To charge and discharge it completely you need 10nC per PWM cycle. Maximum PWM speed of Arduino Uno with 8-bit resolution is about 60kHz. That means about 600uA average current. As a worst case estimate we can say it is drawn as a dead short. With 5V supply voltage it is 3mW dissipation (divided between N and P MOSFET but not necessarily evenly). Now compare it with 100% safe load - continuous 20mA. Voltage drop @20mA is 0.5V, meaning power dissipation is 10mW. It is considerably more than the worst worst case estimate.
AVR pin driver has resistance about 25 Ohm (at reasonable currents). Adding 220 Ohm resistor increases this resistance about 10 times. It means 10 times slower turn on/off of the transistor, 10 times longer in linear region, 10 times higher power dissipation. Instead of a cold transistor you get a hot one. Instead of a hot transistor you get a bit of the magic smoke.

My conclusion: if the project is bad from the beginning and Arduino is unable drive the MOSFET, the Gate resistor may reduce some damage. When driving a tiny MOSFET it does not matter if you use the resistor or not - adding the resistor will increase losses but they are small anyway. But there are MOSFET/load/frequency combinations where Arduino alone is able to drive the MOSFET. If you slow it down by adding the Gate resistor MOSFET will die.

I appreciate all of the information everyone is sending.

If I read the specs correctly, the Nano PWM output will be driving the MOSFET at 490Hz. Same for an Uno, according to analogWrite() - Arduino Reference

Smajdalf:
OP's MOSFET has total Gate charge about 5nC. To charge and discharge it completely you need 10nC per PWM cycle. Maximum PWM speed of Arduino Uno with 8-bit resolution is about 60kHz.

Am I reading something wrong, based on the above comment?

62.5 kHz is maximum 8-bit PWM frequency for Arduino Uno or Nano running at 16 MHz. (16000/256=62.5) Default frequency is lower.