Pages: [1]   Go Down
Author Topic: Completely confused about MOSFETs  (Read 561 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First off, let me start by saying I'm pretty new to electronics, and I could really use some help.

Here's what I'm trying to do. I want to control a 12V RGB LED strip with an arduino. Right now I'm focusing on just getting one of the color channels to work, expanding to all 3 colors should be trivial.
The LED strip has a common positive connection. I'm using a IRF510 mosfet.

Now I'm completely confused as to how I should wire the thing up. I connected a PWM pin of the arduino to the gate of the MOSFET and a pull-down resistor to ground. The positive lead of the LED strip is connected to the +V connection of the power supply. One of the color channels of the LED strip is connected to the source of the mosfet. The drain of the mosfet is connected to ground.
I also connected the ground of the arduino to the -V of the 12V power supply. (picture included as attachment, just imagine the single LED in the image is a LED strip)

When I do this, the LED strip lights up no matter what. Even if I disconnect the gate pin, the LED strip will still light up ... which confuses me to no end. How can current flow through the mosfet if there is no charge on the gate? No matter what I do I can't seem to get the thing to work like I want it to.


* wiredup.PNG (57.78 KB, 710x389 - viewed 50 times.)
Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1481
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The drain has to be more positive than the source. You are conducting current through the Drain-Body diode.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using a IRF510 mosfet.

That is your first mistake. IRF510 is not a logic level mosfet. it is specified for 10V gate drive, and you are only giving it 5V. If you are lucky, it will work with 5V gate drive provided that the LED strip doesn't draw a lot of current.

Now I'm completely confused as to how I should wire the thing up. I connected a PWM pin of the arduino to the gate of the MOSFET and a pull-down resistor to ground. The positive lead of the LED strip is connected to the +V connection of the power supply. One of the color channels of the LED strip is connected to the source of the mosfet. The drain of the mosfet is connected to ground.
I also connected the ground of the arduino to the -V of the 12V power supply. (picture included as attachment, just imagine the single LED in the image is a LED strip)

You need to swap the source and drain connections.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the replies. I switched the drain and source connections, but it's still not working as I would expect.

The LED strip is now glowing very faintly and stays that way, it does not seem to matter if I put 0V or 5V on the gate of the mosfet. Even if I disconnect the PWM pin from the gate the LED strip glows faintly. Does the MOSFET allow a small amount of current to flow no matter what the charge on the gate pin is?

Sooo, I'm guessing that the MOSFET indeed doesn't turn fully ON with 5V. Which again has me confused a little. The LED strip should draw somewhere around 200mA-250mA per color channel, and if I look at the graphs in the IRF510 datasheet, 5V should be enough to allow that much current to flow. I agree that the IRF510 might be overkill for this application, but it should work, no?
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not driving the gate to saturation means your FET will act something like a voltage-controlled resistor.  The more voltage, the less resistance.  Don't do that unless you've calculated it to provide a certain resistance, and know it's doing what you think it's doing.

When you want to switch current, use a FET that has a low Rds(on) (the resistance between drain and source) specified at 5v on the gate.  Vgs is NOT the spec you want.  Look for something like:  Rds(on):  20mOhm @ 5V.  <---- you want that number (mOhm) to be close to insignificant.  Resistance here means heat.

+5v to your LED's common anode, each cathode to its own current-limiting resistor (sized appropriately for the LED's forward voltage and current rating, but 470R is a reasonable starting point), the other end of that resistor to the drain pin of its own N-channel Logic-Level MOSFET, the source pin to ground.  10K resistor from ground to gate, 220R from gate to Arduino's PWM pin.  You'll be solid then.   smiley-cool
« Last Edit: September 17, 2013, 03:18:27 pm by SirNickity » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The LED strip is now glowing very faintly and stays that way, it does not seem to matter if I put 0V or 5V on the gate of the mosfet.

If the LED strip is glowing faintly when you have 0V on the mosfet gate (i.e. mosfet gate is connected to mosfet source), then there is something wrong with the mosfet or with your wiring.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

0
Offline Offline
Tesla Member
***
Karma: 148
Posts: 9754
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The LED strip is now glowing very faintly and stays that way, it does not seem to matter if I put 0V or 5V on the gate of the mosfet.

If the LED strip is glowing faintly when you have 0V on the mosfet gate (i.e. mosfet gate is connected to mosfet source), then there is something wrong with the mosfet or with your wiring.

MOSFET gates may tend to float if they don't have a pull down resistor.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Pages: [1]   Go Up
Jump to: