How To Wire Mosfet And Control Accessories With An Arduino Microcontroller

How to wire a mosfet when using it with an Arduino microcontroller to control a light or motor.

The load can use 5 volt or greater.  If it is greater, the wiring diagram in this page can be used as is. If it is 5 volt, the wiring is simply changed by making one connection.

The information here relates to an N-channel Mosfet suitable for use with an Arduino Microcontroller.


Mosfet   Wiring Explanatory Notes

mosfet wiring diagram

Because the pins on a Mosfet float between on, off and in-between, it is necessary to force the Mosfet to off until the gate voltage is high enough to turn the Mosfet on. This is done by adding a 10k Ohm resistor, known as a dropdown resistor, connected between the Arduino and the gate resistor and ground.

If you are going to control a motor, you must add a diode around the motor in order to block reverse current that is generated when the motor slows.

If you are controlling LEDs only, the diode is not necessary,


This image shows 3 Mosfet used to control 12v LED strips for a thunder and lightning animation. The Mosfet used is are IRL520 . The gate resistor is 270 ohm and the drop down resistor 10k ohm. The wire is from telephone cable. You can get a kit to make this board as well as the code and files needed to make this lightning animation here.


mosfet circuit board wiringThis is more detail on how the board is wired.


We hope that you found the information in this page useful. The internet is all about getting and giving. And giving back is the best. Please donate $1 or more to aid us in our continuing quest to add to and polish the information in our site.

Scroll to top