Learning how to use Mosfets with an arduino and seeing something odd.

Hi

I have a project I'm going to work on that will need to drive more LED's than I want to hang off a sing port and also driving some 12 volt LED strips. I am experimenting with both transistors and Mosfets.

I am seeing something odd when I use the mosfet. It's an N channel mosfet.
https://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10001&langId=-1&productId=119423&storeId=10001&krypto=vFgRhKXJZKuM8sLfuPRmxv3tw%2BNp1UpM3AZ3S0xdP24dbmMv9hdLGQ%3D%3D&ddkey=https:StoreCatalogDrillDownView

I am using an Uno. As soon as I power the board the mosfet is switched on, but functions correctly once the program starts running. Is the initial power-up position for a pin High? I am using a very simple circuit, I have the arduino pin connected directly to gate, on the drain pin I have power to resistor to led connected to drain, I have source connected to ground.

I have a similar circuit set up with an npn transistor, with a resistor on the base and it works perfect.

I would prefer to use the mosfet since it's basically a simple switch based on voltage instead of needing to calculate the resistor for the transistor.

I hope this makes sense.

Thanks in advance for the assistance.

On power up, pins are floating. Depending on your gate trigger voltage, the result of this floating voltage may look the same as if the pin were HIGH.

Anytime you are using a mosfet that is switching a voltage source independent from the arduino voltage source you can experience problems when powering on and off and during reset/restart. It's recommended to wire a 10K ohm resistor from the gate to source terminals on the mosfet to prevent that problem.

Lefty

retrolefty:
Anytime you are using a mosfet that is switching a voltage source independent from the arduino voltage source you can experience problems when powering on and off and during reset/restart. It's recommended to wire a 10K ohm resistor from the gate to source terminals on the mosfet to prevent that problem.

You've stated the what, "problems at power up" - which OP has already said he is experiencing.

Can you clarify the why?

aarondc:

retrolefty:
Anytime you are using a mosfet that is switching a voltage source independent from the arduino voltage source you can experience problems when powering on and off and during reset/restart. It's recommended to wire a 10K ohm resistor from the gate to source terminals on the mosfet to prevent that problem.

You've stated the what, "problems at power up" - which OP has already said he is experiencing.

Can you clarify the why?

If the arduino is powered off while the mosfet still has an independent voltage source powered up then the 'floating gate' does not ensure the mosfet will be off. A pull-down resistor will prevent this situation.

Lefty

Floating gate MOSFETs obey the standard physics, so the gate voltage can be estimated. There is a capacitance from drain to gate Cgd which might be a quarter of the gate capacitance. When the drain voltage increases from 0 volts to 12 volts, it can capacitively couple 1/4 of that voltage onto the gate : 3 volts on the gate. The MOSFET spec sheet spells out the magnitude of those twp capacitances.

The 2n7000 has 50pf gate Ciss, 25 pf drain to gate Coss in the spec

So a 12v drain change puts 6 on the gate using max cap values
Ciss
Coss

The gate has such a small resistance that it will charge itself off static and random rfi floating around (like mains). I just did a thermostat for my camping fridge and used an IRL540N as the power switch, pulling the gte off the arduino bard resulted in full power to the load

retrolefty:
Anytime you are using a mosfet that is switching a voltage source independent from the arduino voltage source you can experience problems when powering on and off and during reset/restart. It's recommended to wire a 10K ohm resistor from the gate to source terminals on the mosfet to prevent that problem.

Lefty

That fixed it. In effect it became a pull down resistor. I do remember reading about pins floating last year when I got into arduinos, but I just did not realize thats what was going on. Thanks for the answer.

The MOSFET you are using is not logic-level, it also is not a power MOSFET (despite what the datasheet
says) as it has an on resistance of 5 ohms and a max current of 0.3A. It is really a small signal MOSFET.

Look for a device with on-resistance more in the range 0.003 to 0.1 ohms, and max current at least
3 to 5 times the maximum current you want to switch. It also must be logic-level (the on-resistance
will be quoted at "Vgs = 4.5V").

The maximum current rating of a power MOSFET assume you have the device on an infinite heatsink
running at its absolute maximum power level. You never do this!

Even power MOSFET could have Ron as 15 Ohms.

sonnyyu:
The both circuits OP post does not work.

FYI

Here is the one might beat a lot of Audio Amps which is sold at Bestbuy since they are Class-AB.

Pure Class-A 2SK1058 MOSFET Audio Amplifier

2SK1058 is one type power MOSFET suitable for audio power amplifier, and it has very high Ron (~15 Ohms).

Substitute power MOSFET with power JFET will push this to beat a lot of semiconductor Class-A amplifier, very close or match with tube Class-A amplifier.

Don't use this with Arduino, Arduino sounds terrible.

May get few of these, now when I need mosfet, I could use it as me half wake and half sleep.

sonnyyu:
I will use low Ron power mosfet from Philip/NXP Semiconductors.

PSMN0R9-25YLC

  • Current - Continuous: 100A
  • Vdss: 25V
  • Ron: 0.99 mOhm @ 25A, 10V

digikey, $1.49/1pc, $103.95/100pcs

http://www.nxp.com/documents/data_sheet/PSMN0R9-25YLC.pdf

It has very small foot print.

regarding about mosfet gate driver IC, MarkT has good thread

http://forum.arduino.cc/index.php/topic,171389.0.html

The small footprint can be a problem - though this sort of surface mount package can be soldered
onto stripboard quite nicely (remember to cut the tracks as necessary under the device first!). The DPAK
and D2PAK and this LFPAK packages are common for MOSFETs and carry a better variety of logic-level devices than
the TO220 package (although many devices are available in several package formats).

In general lower voltage MOSFETs are available in lower on-resistances. If you are switching 12V don't
go for a 100V device, a 20, 25, 30V device will typically be better.

An other easy working package;-

TO-220F, which has an insulated tab and body. screw on anywhere or drop into (ice) water for cooling.

PSMN027-100XS

  • Current: 23.4 A
  • Vdss: 100 V
  • Ron: 21 m?

http://www.nxp.com/documents/data_sheet/PSMN027-100XS.pdf

PSMN027-100XS, Digikey, $1.20