Is it safe to drive a MOSFET from an output pin of a microcontroller?

Many power MOSFETs require a high gate voltage for high-current loads, to ensure that they are fully turned on. There are some with logic-level inputs, though. The data sheets can be misleading, they often give the gate voltage for 250 mA current on the front page, and you find that they need 12V for 5A, say.

It's a good idea to put a resistor to ground on the gate if a MOSFET is driven by an MCU output. MCU pins are usually inputs on reset, and this could cause the gate to float momentarily, perhaps turning the device on, until the program starts running. You won't damage the MCU output by connecting it directly to a MOSFET gate.

The BS170 and 2N7000 are roughly equivalent to the BJTs you mentioned. The Zetex ZVN4206ASTZ has a maximum drain current of 600 mA. I don't think that you will find a small MOSFET that can be driven from 3.3V, though.


It is safe - in general - and it will work if you select a "logic level" MOSFET. Note that "logic level" does not seem to be an exactly standardized term, and it won't necessarily show up as a parameter in the parametric search at the vendor sites, nor will it necessarily show up in the data sheet. However, you will find that logic-level MOSFETs often have an "L" in the part number, ex: IR540 (non logic level) vs. IRL540 (logic level). The big thing is to look in the data sheet and check the VGS(threshold) value and look at the graph that shows current flow vs VGS. If the VGS(threshold) is like 1.8V or 2.1V or so, and the "knee of the curve" on the graph is at around 5 volts, you basically have a logic-level MOSFET.

For an example of what the specs on a logic-level MOSFET look like, check out this datasheet:

http://www.futurlec.com/Transistors/IRL540N.shtml

Figure 3 is the graph I was referring to.

All of that said, I see that a lot of people still recommend using an opto-isolator between the micro-controller and the MOSFET, just to be extra safe.


Re: saturation: yes, but it's confusingly not called saturation (which actually corresponds to the linear region in bipolar transistors). Instead, look at the datasheets and the rated on-resistance Rdson, which is specified at a certain gate-source voltage for each part. MOSFETs are usually specified at one or more of the following: 10V, 4.5V, 3.3V, 2.5V.

I'd put two resistors into the circuit: one from gate to ground, as Leon has mentioned (actually I'd put it from the MCU output to ground), and another between the MCU output and the gate, to protect the MCU in case the MOSFET has a fault.

More discussion on this blog entry.

As for what MOSFET to use, there really isn't a parallel to the 2N3904/2N2222.

2N7000 is probably the most common & cheapest FET out there. For other jellybean FETs, I'd look at Fairchild FDV301N,FDV302P,FDV303N,FDV304P.

For the next step up (higher power level), I'd look at IRF510 (100V), or IRFZ14 (60V), both in TO-220, though these are basic FETs spec'd at 10V gate-source. Logic-level FETs (IRL510, IRLZ14) have Rdson specified at 4.5V gate-source.