Maker Pro
Maker Pro

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

Smooth

Jan 2, 2017
5
Joined
Jan 2, 2017
Messages
5
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
 

Attachments

  • IRFZ24 MOSFET datasheet.pdf
    351 KB · Views: 3

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,745
Joined
Nov 17, 2011
Messages
13,745
The input capacitance of the MOSFET is 640 pF. While the gate drive current will not destroy the arduino unless operated repeatedly at a high rate or frequency, the usual method is a series resistor to limit the current:
upload_2019-5-4_10-6-34.png
 

Bluejets

Oct 5, 2014
6,942
Joined
Oct 5, 2014
Messages
6,942
Arduino can only handle 40mA through I/O pins.

That would be an absolute maximum and even at that is also governed by other design features.

It is possible to simply drive the gate of the mosfet via an everyday transistor which in turn is driven by the uC thus avoiding any problems you imagine.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
In reality, the I/O pin is self limited by something like 100 Ohms output resistance, so the gate will never get anything like the 200mA you calculate. And it will survive that unless you are switching at at high frequency.

Add another 220 Ohms and it will absolutely limit the current below the max, but I do not see the need for that. I have directly connected PIC pins to MOSFET gates all the time and have never experienced any problems.

Bob
 

Smooth

Jan 2, 2017
5
Joined
Jan 2, 2017
Messages
5
@BobK @Bluejets and @Harald Kapp thank you very much for the inputs! I will put a series resistor for the sake of it, as a precaution. Indeed, I realized that I've been driving MOSFETs with an Arduino and never burnt anything; and then that thought popped up. Cheers!!
 

Mark2019

Jul 7, 2019
14
Joined
Jul 7, 2019
Messages
14
This is one method you could use to overcome the problems that you are experiencing Notice I use a transistor drive to shut the fet off during transitions from hi to low This ensure the fet switching is stable Also note the use of the inline diode on the gate feed This ensures that we dont have reverse voltage flying back down the gate side onto the cpu port should an FET fault occur and secondly to bias the PNP transistor to shut the FET fully off when no pulse out


Its more likely that your fet you are using is not being shut off correctly than port overloading


See Image below (The most common method for driving FET's on switch mode power supplies in DC to DC convertors operating at frequencies of 500khz )

Hope that helps you You may have to alter the value of the gate feed resistor dependant on switching frequency for XR equally the type of load you are switching but you can also use a push pull transistor configuration to drive your fet for low gate drive

Your alternative is to use pulse transformers for coupling fet gates to cpu drive or use additional logic integrated driver circuitry
 

Attachments

  • FET Drive via micro.png
    FET Drive via micro.png
    8 KB · Views: 5
Last edited:
Top