Go Down

Topic: IRF520 MOSFET and LED (Read 6784 times) previous topic - next topic

Working through the "Getting Started With Arduino", there's a page on using a MOSFET to control high current loads, using external power. I successfully managed to build that project and it worked perfect. That page can be found here: right here

Since then I've fooled around with my IRF520 MOSFET and did some experiments. Now I actually want to implement it in a project that involves flashing an array of LEDs.

While prototyping the project, I removed the diode, replaced the motor with an LED, using 12v external power, and gave it a 10k pull-down resistor.

Somewhere between the motor project and now, I believe that i've shorted my MOSFET. I'm using a sketch that's supposed to flash the LED from HIGH to LOW, although the LED just dims slightly instead of switching off. Measuring the voltage, it fluctuates between 12v-10v.

Is my MOSFET bad?

Here's the sketch, and the schematic for what I have setup:

Code: [Select]

int LED = 9;

void setup() {
  pinMode(9, OUTPUT);
}

void loop() {
  digitalWrite(LED, HIGH);
  delay(1000);
  digitalWrite(LED, LOW);
  delay(1000);
}



(if anything looks obviously wrong, please point it out. I'm new at doing any of this, especially drawing schematics.)

MarkT

The IRF520 is not a logic level MOSFET, it requires 10V of gate drive to switch on properly.
[ I won't respond to messages, use the forum please ]

So does that mean that the gate needs 10v applied to it for it to switch correctly?

Magician

If MOSFET isn't logic level, it just couldn't be switch fully "on" with arduino +5V. But for LED, or low current application it's really doesn't matter.
There are two possibilities:
1. Transistor is damaged, and conduct when there is no voltage at the gate;
2. "0" current drain to source, according to data sheet:
Quote
Drain Current (V GS = 0) V DS = Max Rating x 0.8    =   1000 uA

is high , 1 mA for LED is too much. Solution: put a resistor across LED, about  3V / 1 mA = 3 k, or 2k for red led.
The same time decrease serial resistor from 10k to to 600 OHm , to increase contrast OFF / ON.

MarkT


If MOSFET isn't logic level, it just couldn't be switch fully "on" with arduino +5V. But for LED, or low current application it's really doesn't matter.


There's no point using a MOSFET if you're just switching 20mA!

And it can matter even with low current loads, as threshold voltage does vary from device to device, with temperature, with age... 
[ I won't respond to messages, use the forum please ]

retrolefty


So does that mean that the gate needs 10v applied to it for it to switch correctly?


What it means is that +10vdc gate to source voltage is required for the device to meet it's guaranteed maximum current and minimum Ron ratings. At less then +10vdc there will be a decrease in maximum current and minimum Ron values. There will be a graph published in the devices datasheet showing how much current the device will pass Vs a given gate voltage and that can be used to estimate if the device is suitable for use with an arduino output pin voltage of 4.5-5vdc.

Lefty


jwatte

If the LED is on even when you ground the gate, it's possible that you confused source and drain. MOSFETs will conduct (with a diode voltage drop) in the "other" direction, even with no gate control.
Also, 10k series is way too much resistance for a LED driven by 12 Volts. Try 5k, if your LED wants 2 mA, or 1k, if your LED wants 10-20 mA.

The real purpose of my topic was to find the difference between using the motor in the Arduino book, and an LED. That's all I was asking. I don't think anyone actually realized that.

I went ahead and rebuilt the circuit illustrated in the book (with the same IRF520) and it is NOT working correctly. The motor just stays on constantly.

So the MOSFET is bad.

Magician



Go Up