Marciokoko:
I'm testing a mosfet and I want to see what values I get when I open the gate. So I'm using a Nano to set pin D5 high to open the gate.
So when 5v is applied to the gate, I should get a voltage reading across D and Source, right?
-
But I need to put a voltage on the drain pin as well, right?
-
And I also need to ground my source, correct?
A MOSFET is more than a "Voltage controlled switch". It's actually, a voltage controlled Resistor. And, because the OP referred to "5v", let's start with an N-Channel [Enhancement] MOSFET. Usually when "MOSFET" is the only term used, it is assumed we are talking about an Enhancement MOSFET [as opposed to a Depletion MOSFET, which is a rarely used, but still useful, type of MOSFET].
When a voltage, of sufficient magnitude, is applied across the Gate and Source [lets call it the "Gate Voltage", or "voltage on the Gate"], with the positive side applied to the Gate, this has an influence on the resistance in the channel that exists between the Drain and the Source. Essentially, what that means is, a MOSFET is a crude voltage controlled variable resistor.
There are three basic "modes" of operation:
- "Off" -- which essentially is a very high resistance in the channel [from Drain to Source] -- in other words, The variable resistor is at its highest resistance at this point -- and that's a VERY high resistance -- essentially, the MOSFET is "off". The MOSFET is in this mode when the Gate Voltage is below what is called the "Gate Threshold" [VGS(th)]. This is a voltage where the MOSFET is right at the "Off" point. Any voltages above this voltage, will start to turn the MOSFET on (push it into the Active Region, or even into "Saturation"). Any voltage below this point, will still result in the MOSFET being "off".
- "Active Region" -- This is the mode where the channel resistor is most variable. As the voltage on the Gate varies, so does the resistance in the channel. The higher the voltage on the Gate, the lower the resistance in the channel.
- "Saturation" -- This is when the channel resistance has gone just about as low as it can go. It's like turning a Potentiometer to its minimum rotation. There are various conditions that put the MOSFET into this mode. But, mostly, it's the amount of current going through the channel [i.e. the "Drain current"]. Different MOSFETs have different minimum On Resistance [RDS(on)]. This can go from around 10Ω all the way down to a few mΩ [that's thousandths of an ohm!]
For instance: On an IRLZ44S, at 5V on the Gate, the drain current can be as high as 60A and the MOSFET will still be in saturation [with an "on" resistance, or RDS(on), of around 0.03Ω]. Any higher than 60A, and the MOSFET channel will be in the Active region. At 3V on the Gate, the Drain current can only go as high as 20A before the MOSFET begins to slip into the Active mode. The Gate Threshold voltage on this transistor is anywhere from 1V to 2V.
The IRF510 is a different beast. This transistor has a Gate to Source Threshold voltage of 2V to 4V, so a voltage of 3V on the Gate may not even take this MOSFET out of it's "Off" state. In other words, this MOSFET is not meant to be used at such a low Gate voltage. At 5V, this transistor will be in saturation upto 900mA [with an RDS(on) of around 0.5Ω -- notice how different that is from the IRLZ44S -- and, remember, this is the smallest resistance this MOSFET can achieve]. But, because this transistor is designed to function at Drain currents of up to 4 - 5.6A, it would be kind of silly to only use it at 1A [unless you're a hobbyist, and you have some in your parts drawer, and you don't want to buy some other transistor -- see, that's why it helps to really know how these thing work
].
A Gate voltage of 10V on the Gate of an IRF510, will allow it to stay in saturation [or "On"] for Drain currents upto 9A -- which on this transistor you would want to maintain for long, but, this transistor can be "pulsed" at up to 20A!
Then there is the whole issue "Logic Level" MOSFETS. If the Datasheet says it's a "Logic-Level Gate Drive" or something to that effect, then it's a logic level MOSFET. Which means, you can use logic level outputs, like from an 5V Arduino, to control a device with that transistor. A non-Logic Level MOSFET will, typically, require voltages as high as 8 to 12V to properly control things. The IRLZ44S is a Logic Level MOSFET. The IRF510 is not [though, if you know a thing or two about MOSFETs, and how to read the datasheet, you can fake it in certain situations
] Also, what if you wanted to use that IRLZ44S with 3V logic? Remember how I said that 3V on the Gate of the IRLZ44S would effectively switch only currents as high as 20A [any higher than 20A, and the transistor goes into the Active Mode]? That means an IRLZ44S is only effectively a Logic Level device, at 3V logic, if you use it for currents at, or below, 20A!
So, what is this concept of a "switch". An ideal switch either allows current to flow, or it doesn't. Mechanical switches do a pretty good job of this -- it's still not perfect, there is some contact resistance when the switch is in the"on" position, and when it's open, there is still some resistance in the air between the contacts. But, it's pretty darn close to ideal in most situations [high voltages, for instance, can render a switch useless, if it isn't designed for those voltages -- and a high enough current, can make that "low" contact resistance, seem not so low.]
The same is true with a MOSFET, when it's used as a switch. When it's "on", it's resistance isn't perfectly zero. And when it's off, there are minute leakage currents and a limit on how much voltage it can block.
When using a MOSFET as a switch, the Active mode is avoided altogether. When we "turn the MOSFET off", we want it to go from saturated [low resistance], all the way to its highest channel resistance, and we want it to be in the Active Region for as short a time as possible. The same with turning it off. It needs to go from high channel resistance, to that saturated Low Resistance mode as quickly as possible.
This is done by toggling the Gate voltage between two extremes. At logic level, those extremes are 5V to 0V or 0V to 5V [and in reality, the low voltage might be more like 0.4V or 0.6V or some such thing -- and the high voltage could be something more like 4.5V or even 5.5V, or something in between -- reality tends to be a bit "messy"
].
How can you know, for sure, if when you apply 5V to the Gate of your transistor, it will go to into saturation? Well for that, you need to learn how to read a datasheet! And that, my friend, is too big of a topic for me to cover here!