Model Scenery Tutorials

Comprenshive Tips. Hints And Techniques For Budget Minded Diorama Maker, Model Train Enthusiast And Wargammer

How To Wire Mosfet And Control Accessories With An Arduino Microcontroller

How to wire a mosfet when using it with an Arduino micro controller 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 Micro controller.

Wiring Explanation

I will go from the top down.

There is a terminal connector to which the load power supply attaches.  Typically between 3 and 12 volts.

The next terminal block is used to connect the load.  In this case it is an LED. Were it an inductive load, a diode would have to be added around the load.

There is a resistor shown.  Its value depends on the load power supply and the LED specifications.

The gate of the Mosfet attaches to the gate signal terminal through what is known as the gate resistor.  I use a 270 ohm resistor.

A 10k pulldown resistor is added to keep the gate from floating.

Mosfet   Wiring A Second Time

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,


Mosfet As An Arduino Controlled Switch

IMAGE  The arduino program applies gate voltage as dictated by the program.  This switch has wide application.

Multiple Mosfet Application

IMAGE  This image shows 3 Mosfet used to control 12v LED strips for a thunder and lightning animation.


Mosfet Operation

mosfet circuit board wiringOn the left the gate voltage is low.  The Mosfet does not complete the circuit from the power source to the drain pine and on to the ground.

On the right, when gate voltage is applied, the Mosfet passes current from the source pin to the drain.  The circuit is completed and the LED turns on.


Scroll to top