Pages: [1]   Go Down
Author Topic: MOSFET problem  (Read 669 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know just enough about electronics to be dangerous and am having problems trying to control a solenoid with an IRL540N MOSFET.  The solenoid operates off of 12V, but I can get no more than 3.7V output from source to ground.

Here's how I have things wired:
Gate - to digital pin and to 10K resistor connected to ground
Source - to solenoid
Drain - 12V

I have verified that I am getting 5V to the gate and have 12V on the drain.  I have taken the MOSFET out of the circuit and have breadboarded just that and get the exact same results.  From my understanding, I should be getting much closer to 12V out.
« Last Edit: May 15, 2010, 01:40:47 pm by gpraceman » Logged

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

Quote
Here's how I have things wired:
Gate - to digital pin and to 10K resistor connected to ground
Source - to solenoid
Drain - 12V

Should be wired:

Gate - to digital pin and to 10K resistor connected to ground
Source - to both external 12volt ground and Arduino ground
Drain - to one side of solenoid, other side of solenoid to external +12vdc.

Many recommend also wiring a reversed diode across the solenoid, however most N-channel power mosfets have a internal diode that will protect the device.

Lefty
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Awesome!  Rewiring it like you suggested worked.

One last question.  I assume that I can replace the 10K resistor with an LED and still keep the MOSFET from triggering when it shouldn't, correct?
Logged

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

Quote
One last question.  I assume that I can replace the 10K resistor with an LED and still keep the MOSFET from triggering when it shouldn't, correct?

Not sure. The 10k resistor to ground is technical not need just to turn on or off the mosfet via the Arduino output pin, rather it's to ensure that the mosfet is turned off in the event that the +12vdc is still on, but the Arduino is turned off, thus acting like a default pull-down to remove any previous gate charge voltage on the mosfet. This is a safety item to prevent the solenoid (or more likely a powerful motor) from not turning off if the Arduino was to lose power or have a reset condition, etc.

If the same power source is powering the solenoid and the Arduino (through it's external power connector) then the resistor is not really required. A LED does not conduct current unless it's forward voltage drop is exceeded, so I'm not sure it would act as a effective pull-down load or not. Worth trying as it won't damage anything if it works or not. A test would be to turn on the solenoid via the Arduino digital output pin and then remove the connection to the Arduino output pin and see if the solenoid turns off.

I guess you could have both the 10k resistor wired gate to ground and a led with it's own series current limiting resistor wired gate to ground if the first test (led only) does not work.

Lefty
« Last Edit: May 15, 2010, 03:31:23 pm by retrolefty » Logged

Taylors, SC
Offline Offline
Newbie
*
Karma: 1
Posts: 21
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you'll want to have the series resistor for the LED to keep the Gate voltage high enough for the IRFL540 to turn on fully.  Otherwise VGS will be limited to the forward drop of the LED and the MOSFET may behave resistively.
Logged

0
Offline Offline
Tesla Member
***
Karma: 118
Posts: 8962
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I assume that I can replace the 10K resistor with an LED and still keep the MOSFET from triggering when it shouldn't, correct?
Possibly not. If the pin sinks to ground when you turn it off, you may be safe. If it goes to a very high resistance state, then a voltage may remain on the gate equal to the voltage drop across the LED. This can allow the MOSFET continue to conduct in a possibly high resistance range, resulting in the smell of something getting very hot.
« Last Edit: May 15, 2010, 07:39:44 pm by zoomkat » 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: