Go Down

Topic: MOSFET problem (Read 994 times) previous topic - next topic

gpraceman

May 15, 2010, 08:40 pm Last Edit: May 15, 2010, 08:40 pm by gpraceman Reason: 1
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.

retrolefty

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

gpraceman

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?

retrolefty

#3
May 15, 2010, 10:29 pm Last Edit: May 15, 2010, 10:31 pm by retrolefty Reason: 1
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

Mike Forst

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.

zoomkat

#5
May 16, 2010, 02:39 am Last Edit: May 16, 2010, 02:39 am by zoomkat Reason: 1
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.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

Go Up