What considerations should be made when selecting a MOSFET for a switching application? I have a project that I have been working on and I'm trying to wrap my head around FETs.

Essentially what I am trying to do is create a barrier using an N-Channel MOSFET between the 5V from a USB connector, and the necessary 3.3V input for one of the digital pins on an MCU.

I'm doing this because I would like to be notified via an interrupt whenever the USB is connected or disconnected. The Gate of the MOSFET is pulled to ground, so when the USB is unplugged my input isn't floating. This is basically what my MOSFET circuit looks like:

ATXmega32E5 Mosfet Circuit

I know that \$V_{gs}\$ and \$V_{ds}\$ are the two main voltages when it comes to MOSFETs, but I have no idea how to calculate them. I think that \$V_{gs}\$ must be 5V (the USB to MCU) and my \$V_{ds}\$ must be 3.3V (drain to MCU). Is that right? If these numbers are correct, how can I determine whether this MOSFET can handle these voltages?

Also, should I be including any current limiting resistors for this MOSFET, the IRLM2402? I chose this MOSFET because we have them in stock.

I know I could achieve the same result by using a voltage divider or a level translator, but I would really like to use a MOSFET.


3 Answers 3


Since no one has answered your title question, I will tell you that the maximum Vgs that this transistor can tolerate is specified on the first page of the data sheet. It is in the table of "Absolute Maximum Ratings", listed as "Gate-to-Source Voltage".

  • \$\begingroup\$ The one that is listed as +/- 12V? Thanks for clarifying. It's a bit daunting sometimes to have pages full of numbers and charts thrown in your face. Finding the right number can seem impossible sometimes. \$\endgroup\$ Jul 10, 2013 at 18:40
  • \$\begingroup\$ Indeed, we did not answer the question - LOL. As Joe Hass helped you with V_GS, the only thing left is that V_DS_max is written as V_DSS. It is 20V for your MOSFET. \$\endgroup\$
    – Vasiliy
    Jul 10, 2013 at 18:45
  • \$\begingroup\$ Yeah i was able to figure out the Breakdown Voltage across Drain to Source, but i knew i wasn't going to exceed that voltage just using 3.3V and 0V. \$\endgroup\$ Jul 10, 2013 at 18:47

Firstly you are using the source as an output and this is normally going to be about 1 to 1.5V below the gate (in order to turn the device on). That's OK because your gate will switch to 5V but some FETs may have a Vgs(threshold) that is more than 2 or 3 volts which means you might only see a logic level of about 2V on the PC0 input when USB power is on.

Secondly you need a resistor to pull the pin down to 0V when the USB supply disappears, otherwise the MCU pin will be floating around. I'd suggest a 10k resistor from source to 0V and try and find a FET with a Vgs(threshold) about 1V or less.

A better circuit is to have source connected to 0V with a 10k on drain to 3V3. This ensures that the fet (most of them) will more relaibly switch. The downside of this is that your interrupt input needs to be inverted - maybe this is done in code quite easily?

enter image description here

  • 1
    \$\begingroup\$ The datasheet for the IRLM2402 says that the Vgs threshold is 700mV. I'm not sure why, but i thought pulling the gate pin down would cause the source pin to be pulled to ground when the 5V from the gate pin was lost. Could you clarify your last paragraph? Perhaps add a schematic, i'm not sure that you mean. \$\endgroup\$ Jul 10, 2013 at 18:19
  • \$\begingroup\$ @DavidFreitag circuit diagram added. Pulling the gate down will not pull the source down - it's an insulated gate on mosfets and can usually be taken +/-10V minimum either side of source without any current draw. \$\endgroup\$
    – Andy aka
    Jul 10, 2013 at 18:34
  • \$\begingroup\$ I see what you mean now, in your example, when the gate goes above the Vgs threshold, PC0 would be pulled to 0V. Makes perfect sense now. Although mainly my question wasn't about making my circuit work, it was more or less how to determine if the selected Mosfet would handle the voltages in question. \$\endgroup\$ Jul 10, 2013 at 18:38

It is not hard to calculate \$V_{GS}\$ and \$V_{DS}\$ in your example. NMOS pins:


In your case :

  • \$V_D=3.3V\$
  • \$V_G\$ is going to be either \$0V\$ or \$5V\$

\$V_S\$ is the only voltage which is not straightforward. Let's see what happens when \$V_G=5V\$:

  • Take a look into the datasheet - \$V_{GS_{(on)}}\$=0.7V is the minimum voltage for the transistor to conduct
  • Well, in your case, even if \$V_S\$ will rise to a maximum of \$3.3V\$, \$V_{GS}\$ won't be less than \$1.7V\$
  • Look into datasheet again - there is a curve of \$I_D\$ as a function of \$V_{GS}\$. For \$V_{GS}>1.7V\$ the currents are tremendous when \$V_{DS}>0V\$
  • I believe that the input impedance of \$PC0\$ pin is very high - there will be no high currents.

Conclusion: given that \$V_{GS}\$ is high, the only condition for Drain-to-Source voltage which makes sense is \$V_{DS}\cong0\$. This implies \$V_S\cong3.3V\$.

When \$V_G=0V\$, and assuming that you added a pull-down resistor to \$PC0\$ (see the answer by Andy Aka), the transistor is closed and \$V_S=0\$.

In summary: I believe that your set up will work.

One more small note: in order to pull \$V_G\$ to 5V, VBUS pin of USB must supply 0.5mA - make sure that this is the case.

  • \$\begingroup\$ In this case, the MCU will be connected directly to a computer's USB port, 0.5mA will be cake to supply. \$\endgroup\$ Jul 10, 2013 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.