protect digital OUTPUT pin

Hi all,

I have connected the following diagram, using Pin 8 from Arduino to "turn on" the Mosfet.

What is the best way to protect the OUTPUT pin from Arduino?

Thank you in advance.

Pin 8 is defined as below:

int ledPin = 8;                 // LED connected to digital pin 13

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(1000);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(1000);                  // waits for a second
}

[code]

Hi,

The arduino is charging and discharging the gate capacitance of the FET. All you need is a series resistor; 150 to 220 ohms would be good.

That diagram shows an IRF1405 MOSFET which won't work from logic levels. You require a logic level
FET if driving at 5V.

If by "protect" you mean in case the MOSFET fails, then use a MOSFET driver chip, add 4k7 between
arduino pin and input of the MOSFET driver, which will usually be enough to prevent cascade failure
of MOSFET and driver from taking out the microcontroller too. An opto isolator is another option for
this, but most opto isolators are way too slow for PWM if you want that.

But you really have to do terrible stuff to break a mosfet in a way the gate becomes high.

Also, what are you driving? It's indeed not a logic level mosfet so the max current is (very) limited (and Ron higher).