Project tutorial
Connecting an N-Channel MOSFET

Connecting an N-Channel MOSFET © GPL3+

Control a brushless DC fan with an N-Channel MOSFET.

  • 4 respects

Components and supplies

Necessary tools and machines

About this project


If you haven’t read our Getting Started Guide for the Arduino Uno Rev3, please read that first. Otherwise, continue reading. In this tutorial, we’ll be connecting an N-channel MOSFET to source current to a brushless DC fan. The fan requires 200mA at +5V which is over the max current that an Arduino Uno Rev3 (Uno) pin can source. If you consult the datasheet for the ATmega328, the max current per pin is 40mA. Going over the maximum current limit can damage the microcontroller so make sure you determine the load current before connecting any device to an Uno pin.

N-Channel MOSFET

A MOSFET can be used for amplifying or switching signals – in this example, we’ll be using it as a switch. It consists of 3 terminals: gate, source, and drain (pinout is below). The N-channel MOSFET is a voltage-controlled device. There are two types of N-channel MOSFETs: enhancement- and depletion-type. An enhancement type MOSFET is normally off when the gate-source voltage is 0V, so a voltage must be applied to the gate for current to flow through the drain-source channel. A depletion-type MOSFET is normally on when the gate-source voltage is 0V, and thus current flows through the drain-source channel until a positive voltage is applied at the gate.

The 2N7000 N-channel MOSFET is enhancement-type so we must set the Arduino output pin high to provide power to the DC fan. The maximum current that a MOSFET can source varies, but the one I am using can source 200mA. Some MOSFETs can source up to 30-50A, and as a result, the size increases to be able to handle that amount of current.

NOTE: You’ll want to add a series resistor between the Uno output pin and the Gate of the MOSFET. This will limit the current to the gate since the Uno can only source a max of 40mA and the Gate may try to pull more than that. We recommend using a 220Ω resistor to limit the current to ~23mA.


I’m using a breadboard instead of Modulus since almost everybody has a breadboard. First, let’s place the N-channel MOSFET onto the breadboard – make sure that each lead has its own node. Tie the source pin to GND, the gate to Uno pin 2, and the drain to the black wire on the fan. The red wire of the fan gets connected to the positive rail on the breadboard.

If you haven’t mounted the Uno onto the prototyping area of the FuelCan, go ahead and do that. I placed the breadboard in the bottom storage compartment to limit the length of the jumper wires. We need to supply +5V and GND to the power and ground rails on the breadboard. Use the provided banana jack to test-lead clip cables to do so. You will need two male header pins to mount the test-lead clips to the breadboard side. Plug the Type A side of the USB cable into the USB1 receptacle and the Type B side into the Uno’s receptacle. Power up the FuelCan with the AC-DC power adapter.


Once the wiring is complete and the FuelCan is powered up, we can now load the sketch onto the Uno. It is quite simple compared to the previous projects. All the code does is toggle Uno pin 2 from low to high with a 5 second delay in between. When the pin is high, the fan turns on, and when the pin is low, the fan turns off.

**Disclosure: Please note that this content uses affiliate links in which ProteShea may receive a commission. Please do not purchase these products unless they will help you with your own projects.


//Controlling a DC fan with an N-channel MOSFET

void setup() {
  // put your setup code here, to run once:
  pinMode(2, OUTPUT);


void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(2, HIGH);
  digitalWrite(2, LOW);


Circuit schematic lipulqmnzs


Similar projects you might like

Connecting Anduino to IFTTT

Project tutorial by Brian Carbonette

  • 14 respects

Connecting "stuff" via Bluetooth / Android / Arduino

Project tutorial by MJRoBot

  • 41 respects

Create Mobile Apps for Android and iOS Connecting to the MKR

Project tutorial by Chandana Pathirage

  • 17 respects

MKR1000 Connecting to the WiFi (3 steps)

by Anton Nazarenko

  • 19 respects

IoT: Connecting The RPi, Arduino And The World!

Project tutorial by MJRoBot

  • 1 comment
  • 26 respects

Connecting VK16E GPS with Arduino UNO

Project tutorial by alaspuresujay

  • 1 respect
Add projectSign up / Login