Pages: [1]   Go Down
Author Topic: IRF520 MOSFET and LED  (Read 4056 times)
0 Members and 1 Guest are viewing this topic.
St. Augustine, FL
Offline Offline
Newbie
*
Karma: 1
Posts: 15
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.)
Logged

0
Online Online
Shannon Member
****
Karma: 162
Posts: 10472
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The IRF520 is not a logic level MOSFET, it requires 10V of gate drive to switch on properly.
Logged

[ I won't respond to messages, use the forum please ]

St. Augustine, FL
Offline Offline
Newbie
*
Karma: 1
Posts: 15
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Montreal
Offline Offline
Edison Member
*
Karma: 23
Posts: 2487
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Online Online
Shannon Member
****
Karma: 162
Posts: 10472
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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... 
Logged

[ I won't respond to messages, use the forum please ]

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16540
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Offline Offline
God Member
*****
Karma: 3
Posts: 813
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

St. Augustine, FL
Offline Offline
Newbie
*
Karma: 1
Posts: 15
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Montreal
Offline Offline
Edison Member
*
Karma: 23
Posts: 2487
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Reply #3 - 1.
Logged

St. Augustine, FL
Offline Offline
Newbie
*
Karma: 1
Posts: 15
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Reply #3 - 1.
I apologize, I missed reply #3. Thanks!
Logged

Pages: [1]   Go Up
Jump to: