# Do i need a resistor between my mcu and a mosfet?

This post here: 2N7000 connection diagram

the gate is (very) high impedance, so no resistor is required to limit the current, as a resistor would be needed in series with the base of a BJT

But i also heard on many other place that we should put a resistor between mcu and gate, to limit the current. What is the recommended thing to do, does mcu can directly drive mosfet?

If i need a resistor to limit the current, from which capacitance shall i calculate it?

For example, if i look at a 2n7000 datasheet: http://www.fairchildsemi.com/ds/2N/2N7000.pdf There is 3 different capacitance, input, output and reverse capacitance, no gate capacitance.

Also, when i look on digikey, i can either sort result by gate charge or by input capacitance, both given in coulomb for a given Vgs, what is the difference between input capacitance and gate charge? Which one shall i use to calculate the resistor? If like the 2n7000, there is no gate capacitance...

• how often do you need to switch the mosfet on and off. Oct 15, 2013 at 10:52

Your quoted paragraph is correct: the gate is high impedance and a resistor is not required for small MOSFETs.

If it is switching frequently, then a small resistor (tens to hundreds of ohms) is suggested to suppress ringing and reduce emitted electromagnetic interference, especially if the MOSFET is on the end of a long wire or PCB track.

You may want to have a pullup or pulldown resistor to provide a default (or or off) when the MCU is not programmed, or held in reset.

(Large power MOSFETs are a little different, and may need a special gate driver to achieve good results).

• But during switching time, the mosfet act like a capacitor, and thus, i need to charge and discharge it... Meanwhile, the current between my mcu and the mosfet will be in the amp range. If i switch a mosfet at 30 mhz, with 3 amp spike during charge and discharge, it won't burn my mcu? Oct 15, 2013 at 10:04
• Where do you get that 3A figure from? In practice, that spike will be incredibly narrow as the input capacitance is only 20pF; the output transistor of the MCU may still be in its linear region by the time it's finished charging. However, at 30MHz, you'll have EMI problems if you don't have a resistor. Oct 15, 2013 at 12:02

If you want your design to be reliable you need to check the MCU datasheet. There you will find some indication of the maximum current you I/O pin can drive. Most MCU's has a very low limit.

As noted your MOSFET has capacitive behavior. Thus the steady state resistance is very high, but the high frequency impedance is very low. The 'step' output of the MCU has high frequency component. This will lead to a spike current that will over time damage your MCU.

Yes you need a resistor. How big should the resistor be? 1K - 10K usually work just fine, but you can calculate it easily.

• But like i asked, which capacitance to use to calculate the resistor? Oct 15, 2013 at 18:03