29

I have used commonly-available BJTs such as the 2N2222 and 2N3904 as switches by operating them in "saturation mode" from my MCU. I believe, however, that for these sorts of applications, a MOSFET is a more appropriate device. I have a few questions, however.

1) Does a MOSFET have a "saturation mode" like the BJT does? Is this "saturation" achieved by simply providing a high enough voltage on the base that the MOSFET is completely "on"?

2) Is it safe to drive the MOSFET directly from the MCU? I understand that the gate of the MOSFET behaves like a capacitor, and therefore draws some current while "charging", and then none thereafter. Is this charging current high enough to damage the MCU pin? By placing a resistor in series with the gate, I can protect the pin, but this will slow down the switch, possibly resulting in high heat dissipation by the MOSFET?

3) What is a common "hobbyist" MOSFET suitable for various low-power situation? I.E., what's the MOSFET equivalent to a 2N2222 or 2N3904?

Mark
  • 4,650
  • 10
  • 48
  • 53
  • 1
    "more appropriate" sounds silly to me. Usually BJTs are cheaper, so I'd use a FET only if a BJT won't do. – starblue Apr 15 '11 at 06:07
  • 11
    I've generally done the opposite: use a MOSFET unless I need a BJT. They're both cheap. The power wasted by a MOSFET's R_DSON is usually less than from a BJT's V_CESAT. You only pay power to switch a MOSFET, not to keep it on, which reduces power dissipation in both the transistor and the part that drives it, especially if switching is infrequent. MOSFETs usually go all the way to the rail because there's no V_CESAT. The downside is that a MOSFET doesn't pull a constant amount of current across the entire edge, since it looks like a resistor; this slows down switching a capacitive load. – Mike DeSimone Dec 04 '11 at 15:50

5 Answers5

16

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.

Leon Heller
  • 38,774
  • 2
  • 60
  • 96
  • the 2N7000 has a maximum current of 200mA, where the 2N2222 has a maximum current of ~600mA. is there something in that neighborhood that is easy to drive with a 3.3v MCU? – Mark Apr 14 '11 at 20:53
  • What number am I looking for to determine whether 3.3V is enough to turn the MOSFET on? Phillips' 2N7000 has a VGS(th) (gate-source threshold voltage) of 2V typ, does that mean that 2V would turn the MOSFET completely "on", or just barely "on"? – Mark Apr 14 '11 at 21:19
  • You will probably only get 1 mA through it with 2V on the gate, according to the data sheet. – Leon Heller Apr 14 '11 at 22:32
  • 1
    @Mark Barely. It's like just passing above the threshold voltage on a BJT. Unfortunately with the MOSFET you do not have the exponential characteristic. – jpc Apr 15 '11 at 02:33
  • @Leon Heller I found the BS108, but it tops out at significantly less current than the 2N2222. It's more like a 2N3904 in current characteristics. It's more expensive than the equivalent BJT, and it's not in-stock at either Mouser or Digi-key. – Mark Apr 15 '11 at 14:41
  • @Leon Heller It seems to me that when they say "Logic Level MOSFET", what they really mean is, "5V Logic Level MOSFET". MOSFETS that can pass reasonable current at 3.3V seem to be few and far-between. I guess I'll stick with my trusty BJTs. – Mark Apr 15 '11 at 14:52
  • 1
    I've been driving SC-70 package MOSFETs with 1.8 V at work for years. The first parameter to check is V_GS(th), like Mark noted. It's roughly equivalent to V_IH for a CMOS input if n-channel, or V_IL for a p-channel. In other words, drive *past* that value. Looking for a 2222 equivalent, found the AO3422 (Digi-Key 785-1015-1-ND). 55V, 2.1A, SOT-23, V_GS(th) of 2.0 V max, 1.3 V typ, r_DSON of 130 mOhms at 3.3 V. Costs the same as the P2N2222AG. For a 500 mA load, the 2222 has V_CESAT=1.0 V (500 mW dissipated), and the AO3422 has a V_DS=0.065 V (32.5 mW dissipated). FETs run *cold.* – Mike DeSimone Dec 04 '11 at 16:13
  • 3
    The thing to remember when shopping for MOSFETs is not not prematurely limit the V_DS or I_D when searching! These numbers are much higher for FETs than you're used to seeing for BJTs given a certain driven load. Note how the AO3422 (V_DS=55 V, I_D=2.1 A) is much higher than the specs for the similar 2N2222 (V_CE=50 V, I_C=0.8 A); this is due to efficiency! The reason you don't see "typical MOSFETs" like you do for BJTs or diodes (1N4148 etc.) is that MOSFETs came along later, when there were more companies making them, and there was much less motive to copy competitors' standard parts. – Mike DeSimone Dec 04 '11 at 16:18
  • 3
    @MikeDeSimone: "The first parameter to check is V_GS(th), like Mark noted. It's roughly equivalent to V_IH for a CMOS input if n-channel, or V_IL for a p-channel. In other words, drive past that value." No, no, no. All V_GS(th) means is that you get past a specified current. The MOSFET isn't considered "on" until the device has completely resistive behavior over a specified range of currents. This requires higher voltage than V_GS(th), and is not usually specified until the guaranteed Rdson specs, somewhere in the 4.5V-10V range (sometimes at lower voltages). – Jason S Aug 17 '15 at 22:19
  • @JasonS: Good points! Consider the [Toshiba SSM3K329R](http://www.semicon.toshiba.co.jp/info/docget.jsp?type=datasheet&lang=en&pid=SSM3K329R), advertised as "1.8 V drive," but as you note, R_DSON = 289 mΩ at V_GS = 1.8 V while it is much lower at higher voltage, 126 mΩ at V_GS = 4.0 V! Further, as seen on the R_DSON-to-I_D graph on page 4, the resistance is far less dependent on I_D at that higher V_GS. But all is not lost! If the application has I_D < 1 A, then V_GS = 1.8 V gives close to flat R_DSON. Also of note is the Miller curve (page 5 bottom) where the V_GS threshold is near 1.5 V. – Mike DeSimone Aug 18 '15 at 02:55
  • I'm not sure what you mean by "I don't think that you will find a small MOSFET that can be driven from 3.3V, though". Plenty of 2.5V drive MOSFETs out there, e.g. http://www.diodes.com/_files/datasheets/ZXMN2F34FH.pdf The main issue for hobbyists is that these are too small, rather than too large in terms of packages; typically SOT-23 and get fancier (power pads etc.) if you want high current as well, e.g. https://www.fairchildsemi.com/datasheets/FD/FDMA430NZ.pdf – Fizz Oct 25 '15 at 17:06
13

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.

mindcrime
  • 1,108
  • 8
  • 11
7

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.

Jason S
  • 13,950
  • 3
  • 41
  • 68
  • 7
    The resistor from MCU pin to gate is also used to slow down the switching edge, to reduce ringing, overshoot, and EMI. 10 ohms is a typical value. – Mike DeSimone Dec 04 '11 at 15:55
0

In answer to question 3, I found the Fairchild FQP30N06L is ideal for driving a high power device from a MCU at logic levels. It's not cheap (0.84 GPB) but great for lazy n00bs like me. I'm using them for supplying 12V RGB LED light strips.

Some stats:

Vdss Drain-Source Voltage: 60 V
Id Drain Current: Continuous (TC = 25°C) 32 A
                  Continuous (TC = 100°C) 22.6 A
Vgss Gate-Source Voltage: ± 20 V
Vgs(th) Gate Threshold Voltage: 1.0--2.5 V

Therefore, Raspberry Pi's 3.3v is above the 2.5V upper Gate Threshold, which will ensure that the drain is fully open.

  • Don't drive this directly from an MCU. The turnon/turnoff time will be very long due to the gate capacitances, and you're not protecting the MCU from any faults. – Jason S Aug 17 '15 at 22:12
  • 1
    More seriously, just because 3.3V is above the gate threshold, that does **not** means the switch is fully on. All it means is that the current is guaranteed to be above a given threshold (250uA for the FQP30N06L). The FQP30N06L is designed to be driven from voltages of at least 5V, which is the minimum voltage that they specify on-resistance. Any lower than that, and you have no guarantees whatsoever of device behavior beyond the 250uA current of the Vgs threshold. – Jason S Aug 17 '15 at 22:14
  • Hi JasonS, forgive my ignorance. I don't see in the specifications where 5V is given as a minimum. The graph data shows that ~3.3V on the gate allows for >10A on the drain @25V, which is ideal for my purposes (5A @ 12V). For protection, I've put a 10KΩ resister between Gate and Ground and intend to put a similar sized resister between the MCU pin and Gate. Will this be sufficient? – Alastair McCormack Aug 18 '15 at 09:16
  • "The graph data shows..." Characterization graph data in a datasheet is almost always a representation of *typical* performance, not worst-case. In other words, it's the mean behavior, not the extreme, and you can't rely on it being valid for all devices. The reason they include it at all is that the relative behavior (current goes up with increasing gate voltage and increasing drain voltage) is universal... you just can't rely on the numbers. – Jason S Aug 18 '15 at 13:32
  • 1
    Look at page 2 ("On Characteristics") -- it gives you two specs for Rdson with Vgs = 10V (35mohm max) and Vgs = 5V (45 mohm max). As far as protection... well, see my article http://www.embeddedrelated.com/showarticle/77.php -- pulldown resistor can be fairly high, usually 100K - 1M is fine. But you really need a gate driving circuit from 3.3V logic. It doesn't have the voltage necessary to guarantee that the FQP30N06L will be turned on. Some devices may have quite a bit higher Rdson at 3.3V (or may still be in the constant-current range) and overheat as a result. – Jason S Aug 18 '15 at 13:39
  • There are very few TO220 devices with guaranteed Rdson specs below 4.5V, I found one http://web2.cetsemi.com/PDF/TO-220-263-N/P21A2.PDF but never heard of this manufacturer before + am kind of suspicious. – Jason S Aug 18 '15 at 13:50
  • If I understand these comments correctly you can't rely on this reaching a low-enough drain-source resistance when the gate is at ~3v due to differences between individual transistors. Could you, perhaps, purchase a batch and test individually to verify ones which switch on enough at 3/3.3v? – tom r. Dec 04 '20 at 05:36
0

driving power mosfet is driving capacitor 1-8nf. it is slow with resistor and not possible without. mosfet require fast, powerful switch in front of it: bjt

vlad
  • 1
  • 1
  • 3
    That really depends on the application. Small MOSFETs with slow switching requirements are no problem for a GPIO of a typical µC. – jusaca Mar 18 '20 at 07:35