MOSFET & PWM

Hi all,

So I'm using an arduino to controll power to a string of LEDs. I have an IRF510 MOSFET transistor, but I need some help hooking it up...

So I have confirmed that I have the Digital Pin outputting PWM using just a plain LED, but when I add the MOSFET to control an LED powered by an external source, I run into problems. It doesn't change brightness right; when the arduino is outputting PWM with a value of 255, its at its brightest, but when it outputs a PWM of 0, the LED is still lit! It's almost like it reached a minimum brightness, which isn't that different from the brightness at 255. Also, when I touch the metal part of the MOSFET or the metal part of the arduino's female usb piece, the LED brightens up a lot.

Anyways, I have the source pin connected to the negative end of my power source (a 3v wall wort), the drain pin connected to the negative end of the LED (the positive side of the LED is connected to the positive end of the power supply), and the gate pin is connected to pin 11 on the arduino with the PWM. Am I doing anything blatantly wrong? Am I using the wrong transistor for what I'm trying to make it do?

ps. Sorry if what I said sounds really stupid, since I'm relatively new to making circuitry. I was always a software person ;)

Sounds like you might need to connect the negative end of your wall-wart to the ground pin of the Arduino.

But first....you do have the wrong MOSFET. It should be a "logic-level" MOSFET like the NDP6060L or countless others that say "logic level". Then....you should also have a resistor from pin 11 to the MOSFET gate (like 1k or so).

And finally....I'd suggest a resistor in series with your LED (either before or after it). You could really be stressing it out by putting a full 3V across it should this experiment actually work.

And if you can take the time to sketch a schematic of what you're doing, it'll be worth 1000 words ;)

-- The Aussie Shield: breakout all 28 pins to quick-connect terminals

Here’s a quick schematic I drew up in gimp of what I have so far

EDIT: Just thought I should add, the wall wart is rated 3.0 VDC and 350 mA

crappy-schematic.jpg

Right back at ya…


The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

crappy-schematic.jpg

http://www.vishay.com/docs/91015/sihf510.pdf

So here's the datasheet. You can see this part is really made for driving high voltage & currents.

That said, you could still try it with string of LEDs from +12 or to a current limit resistor to the Drain. Source to ground. Arduino output pin thru 470-1K resistor to gate, and 10K from gate to ground (keeps it turned off when arduino starts up and outputs are configured as inputs before the sketch kicks in).

Where is the "string of LEDs"? 3V will only drive a bunch of LEDs in parallel, with current limit resistor for each LED.

In my final design, I plan on using several LEDs in parallel (my string of LEDs). For now, I'm just using a single LED to simplify things while I get the design ironed out. So my basic design is correct, right? I just need to add the resistors you mentioned and then replace my MOSFET with a logic level one?

I think you're on the right path. A 10k resistor from gate to ground is indeed a good idea as suggested above, and the logic-level MOSFET.

You could also use an NPN transistor instead of a MOSFET if you have one lying around (2N3904, 2N2222, that type of thing) until you get a MOSFET (which is more efficient). You might have to lower the gate resistor to get more brightness, but don't go below 220 ohms or so.

-- The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons

All right sounds good. Thanks a lot for all your help RuggedCiruits and CrossRoads!

S'alright.