# MOSFET’s dynamic state current and Arduino I/O pins

#### Smoooth

Joined Jan 2, 2017
34
Oi!

I am using an N-channel MOSFET (IRFZ24) to turn on a set of LEDs+other stuff (powered from 12V). Drain of the MOSFET is connected to the LEDs, source is grounded, and I use an Arduino’s digital pin to give either 5V or 0V to the Gate.

My question is about amps and burning. From their data sheets, Arduino can only handle 40mA through I/O pins. Now, while the MOSFET would draw practically nothing while in a static state, the dynamic state bothers me. Looking at page 2 of the MOSFET’s data sheet, the rise time is 58ns, and since I need to charge the gate by ~10-20nC, the current = dC/dt ~ 10/58 ~ 0.2A, higher than 40mA, hence I am killing the I/O pin.

Is my logic above correct? Am I gonna draw that much current? Would that fry my I/O pins? If no, why? If yes, what can I do to prevent that? Would throwing in a resistor to the Gate help (kinda like an RC circuit logic)? Am I being overly paranoid?

I’d really appreciate any advice and enlightenment I am just a student seeking understanding; and I don’t want to burn **another** Arduino.

Cheers,
Savva

//while looking for possible answers, I found this stack exchange, which makes me want to think that I am right: https://electronics.stackexchange.c...-can-we-not-assume-that-the-gate-current-is-0

#### Attachments

• 351 KB Views: 2

#### Sensacell

Joined Jun 19, 2012
2,931
The rise time in the datasheet assumes something other than an IO pin is driving the gate- and driving it HARD.

You probably want to use a series gate resistor to limit the peak current to within the maximum specified for the IO pin.
The rise time you will see in your application is dependent on the current you drive the gate with.
If it's too slow for your application, you will need to add more circuitry to drive the gate harder.

Assuming you are doing PWM on the LEDs, a rise/fall time of 250 nS probably won't hurt.

#### Smoooth

Joined Jan 2, 2017
34
@Sensacell thank you for the input! Indeed, I don't care about the speed; I will put a series resistor as a precaution.

#### Sensacell

Joined Jun 19, 2012
2,931
Use a current limiting resistor in series with the gate, and a high value (10k) "pull down" on the IO pin itself.

The purpose of the "pull down" is to keep the gate from floating around when the MCU is in reset and the IO pins are not yet set to output mode. Put the resistor on the IO pin, not the FET gate, so it does not form a voltage divider that reduces the gate voltage, you want as high as possible.

#### daba1955

Joined Apr 27, 2019
130
I use a 1K series resistor to my MOSFETs, IRFZ44, and a 10K to ground on the MOSFET gate. I have suffered no problems with the MOSFET triggering at mcu start-up, nor the gate not being driven hard enough. I am PWMing a 12V motor.

I totally understand what you are saying though, so will implement this change for the next batch of PCBs It certainly won't hurt to drive the gate as hard as possible.