MOSFETs 101
Electronics Theory needed for this week:
Mosfet Types
Terminology
- An N Channel MOSFET activates when you apply a positive voltage to the
gate, compared to the source (the leg where its power comes out of the MOSFET).
- A P Channel MOSFET activates when you apply a negative voltage to the
gate, compared to the source (the leg where current into the MOSFET)
- If you are using an Arduino that has a barrel jack for 12V, and your motor also consumes 12V it might be tempting to share the power supply for both elements, but you should not do it. Using the same power supply via the barrel jack will fry your arduino board as it will connect both grounds together, while also applying 12V through the 5V output pin that you will use to control the servo. See the warning from the original video for a nice diagram explanation.
- Logic Level means that a 5V difference is enough to control it via the gate.
- Enhancement type
Enchantment Typemeans that it is “normally open/normally off” (when there is no Voltage difference between gate and source). If we want to turn it on, we need to provide a min. V to the gate with respect to the source voltage.- ⚠ Despite the high quality of the video that I linked, the author mispronounces enhancement as “enchantment”, which confused me for a long time while I was looking for other resources. After i figured the correct term, lots of new content showed up explaining MOSFETs and their workings.
- Depletion type means that it is “normally closed/normally on” (when there is no Voltage difference between gate and source). If we want to turn it off, we need to provide a negative voltage at the gate, with respoect to the .
- P vs N channel Mosfets
- “Enhancement N” channel Mosfets are more commonly used than others (Enhancement P or Depletion N)
- Comparison between BJTs and MOSFETs
- BJTs = Bipolar Junction Transistors
- MOSFETs = Metal-Oxide SemiConductor Field Effect Transistors
- BJTs use Current (Amps) to control their open/closed state
- MOSFETs use Voltage differentials (V) to control their open/closed state
- Generally, BJTs are used for low-amp uses while MOSFETs support lots of amps.
- A key difference between BJTS and MOSFETs is that in MOSFETs, the output current is NOT a multiplier of the input, because MOSFETs are all about voltage.
- MOSFETs can be thought of as a variable resistor, where the resistance is “infinite” but can be manipulated with
changes to the voltage applied on the gate. When reading datasheets, these are some important attribute to check
out:
- R_{DS}ON is the term on the datasheet that indicates the threshold voltages and the equivalent resistance
that the MOSFET will have with that voltage is applied to the gate.
- R = Resistance
- DS = between the Drain and the Source
- On = when it is activated
- V_{GS}ON is the voltage needed to activate the mosfet. If the value is 5V or lower, we call these MOSFETs ”
Logic Level Mosfets” and they can be controlled by any board/chip that can deliver the needed V (Arduino,
etc…). Not all MOSFETs are logic level mosfets! It is very important to check this value before using it!
- V = Voltage
- GS = between the gate and the Source
- ON = required to activate it
- R_{DS}ON is the term on the datasheet that indicates the threshold voltages and the equivalent resistance
that the MOSFET will have with that voltage is applied to the gate.
N Channel MOSFET
How to Wire N Type MOSFETS:
- We can use a pull down resistor between the gate and the source (⚠: in N Channel, Source is the current flows out of the Mosfet).
- The gate will be driven by our microcontroller and will allow current to pass when we send 5V (HIGH)
- The pull-down resistor is there to make sure the circuit stays open instead of in a half-state when there’s no current being actively applied
- We also need a flyback diode,
since the motor is an inductive load. When the motor is disconnected from power, the coils are still spinning and
generating an induced current that could damage our circuit. The diode allows current to be recirculated and consumed
by the motor instead of creating huge spikes in our mosfet and damaging it.
- This would be critical in case of heavy-powerful DC motors, but in our case (small servo with almost no inertia and very little weight) we might be able to get away with not needing it. However, I’m documenting this in case I need tips and advice in the future.
MOSFET Datasheet Cheatsheet
- Use the datasheet to determine
- Determine which leg is the Drain, the Source and the Gage
- Find out the Voltage Threshold V_{GS}ON
- Determine the R_{DS}ON Drain-to-source-resistance
- If you are going to use this to drive heavy loads, determine if you need a heat-sink
Sources
Some useful sources that I used to figure all of this out:
- A fantastic video that explains this in lots of detail how all of this works
- What is a mosfet and basic types
- N Channel Mosfets
- P Channel Mosfets