Objective: demonstrate use of MOSFET

You will need: ESP8266 on breakout board (or similar), IRLZ44N MOSFET, LED, 10kΩ and 330Ω resistors, patch leads and small breadboard.



This project demonstrates a simple use of a MOSFET to drive an LED. The ESP8266 can drive LEDs without needing to use a MOSFET but where the load on a single pin is more than 20mA or the combined load on all pins is more than 100mA a MOSFET or transistor is needed. You'll also need a MOSFET if you wish to drive a 5V mechanical relay as the current required is about 100mA and more than a single pin can provide.

To use a MOSFET successfully with microcontroller output voltages, you need a logic level MOSFET; these are usually identifiable by an L in the part number, e.g. IRLZ44N or IRL540.

Logic level MOSFETs, such as the IRLZ44N, can be used with ESP8266 projects to switch high currents at voltages higher than 5V. The International Rectifier device will switch 47A at up to 55V, subject to being fitted to a suitable heat-sink and de-rated for its expected operational temperature. Not all IRLZ44Ns have the same specification with regards to current limits so check the corresponding datasheet for details of your device. For the TO-220 package the pins are, from left to right in the diagram above, Gate, Drain, Source.

Link to sketch source code.

MOSFET and LED wiring diagram

Do this with an Arduino or a Raspberry Pi.