When over a year ago I published this post about using transistors as switches, I described only how to do it with bipolar transistors. And bipolar (NPN and PNP) transistors have a small problem: they are current driven, so they consume current when they are switched on. They consume much less than they drive, but still...

Field Effect Transistors (FET), and especially the ones from MOSFET family, work in a slightly different way. Instead being current driven, they are voltage driven. Than means, to conduct between Source and Drain terminals, specific voltage has to be applied to Gate terminal. More than that, FET transistor consumes current only during switching. It works kind of like a capacitor. When Gate is charged, it stops conducting electricity.

And that, in case of low voltages and low currents (3.3V - 5V logic level and few hundred miliamps), removes the requirement of Gate resistor. Small MOSFETs like 2N7000, BS250 and other, can be directly connected to microcontroller outputs. Cool!

Switch with N-channel MOSFET

N-channel MOSFET is ON when positive voltage (comparing to Source) is applied to Gate. So, Load will be powered when HIGH state is applied.

N-channel MOSFET as switch

Switch with P-channel MOSFET

P-channel MOSFET is ON when negative voltage (comparing to Source) is applied to Gate. So, Load will be powered when LOW state is applied. It acts like an inverter.

N-channel MOSFET as switch

Gate resistor

In case of bigger currents and voltages, gate resistor might be required since FET gate acts like a capacitor and passes electricity until charged. Consult transistor data sheet.