How to Control DC Motor Speed with Arduino Using MOSFET

Introduction

Controlling DC motor speed with Arduino is a classic and useful project for students, hobbyists, and engineers alike. This guide explains how to interface a DC motor with Arduino using a powerful MOSFET (75NF75). Whether you are working on science projects, final year projects, or industrial automation, this method offers efficient control.

Components Required and Their Functions

Before diving into the wiring and code, here's a breakdown of all the components used in this project:

ComponentFunctionPrice / link
Arduino UNOThe brain of the project — it sends PWM signals to the MOSFET to control the motor's speedRs 1,200
75NF75 MOSFETA high-power N-channel MOSFET used to switch and control the current flowing to the motor efficientlyAvailable on order — message us on WhatsApp
DC Gear Motor 12VThe load we'll control — you can use any brushed DC motor depending on your applicationRs 165
Power Supply (12V DC Adapter or Battery)Powers the DC motor — make sure your supply can handle the motor's current requirementsRs 275
Flyback Diode 1N4007Protects the MOSFET and Arduino from voltage spikes caused by the inductive motor loadAvailable on order — message us on WhatsApp
1kΩ ResistorSeries gate resistor — limits the inrush current into the MOSFET gate and protects the Arduino pinAvailable on order — message us on WhatsApp
10kΩ ResistorGate-to-source pull-down resistor — keeps the MOSFET OFF when the Arduino pin is floating (for example, during reset or upload)Available on order — message us on WhatsApp
Jumper Wires & BreadboardFor prototyping and making reliable temporary connectionsWires Rs 180, MB102 Rs 250

75NF75 MOSFET pinout — Gate, Drain, Source

12V DC gear motor for Arduino robotics projects

Wiring Setup: How to Connect Everything

The wiring is simple and easy to understand:

ConnectionWhere it goes
Arduino PWM pin D91kΩ resistor → MOSFET Gate
MOSFET SourceGND (negative terminal of the power source)
MOSFET DrainOne terminal of the DC motor
DC motor other terminal+12V power supply
Flyback diodeIn parallel with the motor terminals — cathode to +12V, anode to the Drain side
10kΩ resistorBetween the MOSFET Gate and GND (pull-down)
Arduino GNDCommon GND with the 12V power supply

The motor supply and the Arduino must share a common GND — without it, the MOSFET gate has no reference voltage and the motor will not switch properly.

DC motor speed control wiring diagram — Arduino UNO, 75NF75 MOSFET, flyback diode and 12V DC gear motor

Arduino UNO R3 board with USB cable

4007 diode with symbol

1k ohm resistor

Small breadboard for Arduino circuit prototyping

Code for Arduino – Speed Control Using PWM

Here's a basic code to control the speed using the PWM signal:

int motorPin = 9; // PWM pin connected to MOSFET Gate

void setup() {
  pinMode(motorPin, OUTPUT);
}

void loop() {
  // Increase speed gradually
  for (int speed = 0; speed <= 255; speed++) {
    analogWrite(motorPin, speed);
    delay(20);
  }

  // Decrease speed gradually
  for (int speed = 255; speed >= 0; speed--) {
    analogWrite(motorPin, speed);
    delay(20);
  }
}

This code uses analogWrite() to generate PWM signals, effectively controlling the speed of the DC motor.

How It Works: Controlling Motor Speed with PWM & MOSFET

The Arduino doesn't directly drive the motor because it can't handle high current. Instead, it sends PWM signals to the MOSFET. The MOSFET works like a switch or valve — the wider the valve (duty cycle of PWM), the more current flows to the motor, thus controlling speed.

This method is highly efficient and keeps the Arduino safe from overload. The 75NF75 is perfect because of its high current and voltage capacity, making it ideal for final year projects, automation systems, and engineering projects.

Applications and Use Cases

  • Student projects and FYPs near Hall Road, Lahore
  • Automation systems for smart homes
  • Arduino-based robotics and DIY cars
  • Fan or pump speed control projects
  • Teaching aid for electronics and embedded systems

For a complete robot that uses this same motor control, see our obstacle-avoidance robot car guide — it drives four DC gear motors with an L298N, the same pattern as this MOSFET circuit.

Safety Tips and Pro-Level Tricks

Use Flyback Diodes

Never skip the diode. It absorbs harmful back EMF from the motor.

Proper Heat Dissipation

MOSFETs can get hot. If driving large motors, use a heat sink. The 75NF75 driven from the Arduino's 5V gate is only partly on, so it runs warmer than its datasheet rating suggests — for larger motors, use a heat sink or a logic-level MOSFET.

Use External Power for Motors

Avoid powering motors from the Arduino board; always use a separate power supply. And remember: the motor supply and the Arduino must share a common GND, or the MOSFET will not switch.

Why Choose This Project?

This project is perfect for:

  • Students
  • Final year engineering projects
  • Robotics and automation learners
  • Anyone looking for easy but powerful Arduino projects

If you're in Lahore and looking for engineering project help near Hall Road, visit QKZee Technologies for the best engineering service in Lahore.

Troubleshooting Common Issues

Motor not spinning?

  • Check power supply voltage
  • Ensure Gate voltage is high enough
  • Check that the Arduino GND and the 12V supply GND are connected together (common GND)
  • Check the 10kΩ pull-down resistor is between Gate and GND, not between Gate and 12V

MOSFET overheating?

  • Use heat sinks or choose a MOSFET with lower Rds(on)
  • Check the flyback diode is fitted (cathode to +12V, anode to Drain) — without it, the MOSFET takes the motor's back-EMF spikes

PWM signal not working?

  • Double-check your code and pin configuration — D9 is a PWM pin; D2–D4 and D7–D8 are not
  • Check the 1kΩ series resistor is between D9 and the Gate

Conclusion – Why This Project Works

Learning how to control a DC motor with Arduino using the 75NF75 MOSFET is an essential step in mastering embedded systems. It's simple, effective, and opens up tons of opportunities in automation and robotics.

This project is highly recommended by QKZee Technologies for students looking to learn real-world applications. It's budget-friendly, easy to assemble, and perfect for beginner to intermediate engineers.

For a motor driver that also gives you direction control (forward and reverse), see our L293D motor shield guide — a MOSFET controls speed in one direction; an H-bridge like the L293D adds reverse.

Where to Buy the Parts

The Arduino UNO R3 DIP (Rs 1,200), DC gear motor 12V (Rs 165), 12V 2A adapter (Rs 275), MB102 breadboard (Rs 250) and jumper wires (Rs 180) are available at QKZEE Technologies, Shop 20, 1st Floor, Al-Khalil Center, Hall Road, Lahore, and online at qkzeetech.com with delivery all over Pakistan — see the links above. The 75NF75 MOSFET, 1N4007 diode, 1kΩ resistor and 10kΩ resistor are available on order — message us on WhatsApp and we will arrange them for you.

Still Stuck?

If the motor does not spin, or the MOSFET gets hot immediately, message us — tell us the voltage at the Gate (D9), whether the Arduino GND and the 12V supply GND are joined, and whether the flyback diode is fitted with its cathode to +12V, and we will help you find the fault.

Chat on WhatsApp Visit our YouTube Channel

FAQs

Why does the motor not spin even though the code uploaded?

Check the common GND first — the Arduino GND and the 12V supply GND must be joined. Then check the Gate voltage: D9 should read 5V when the code sets speed to 255. If D9 is 0V, the code or the pin is wrong.

Why does the MOSFET get hot?

The 75NF75 driven from the Arduino's 5V gate is only partly on, so it dissipates more heat than its datasheet rating suggests. Fit a heat sink, and for larger motors use a logic-level MOSFET or a gate driver. Also check the flyback diode is fitted — without it, back-EMF spikes heat and damage the MOSFET.

Why does the motor spin at full speed and never slow down?

The MOSFET is probably stuck ON — check the 10kΩ pull-down resistor is between Gate and GND. If the Gate floats (no pull-down), the MOSFET can turn on by itself. Also check you used a PWM pin (D9) — D2–D4 and D7–D8 cannot do PWM.

Can I control the motor speed with a potentiometer?

Yes — read the potentiometer on A0 with analogRead, map the 0–1023 reading to 0–255 with the map() function, and analogWrite the result to D9. The wiring stays the same; only the code changes.

Can I reverse the motor with this circuit?

No — a single MOSFET switches the motor in one direction only. For forward and reverse you need an H-bridge (two MOSFETs per direction) or a motor driver like the L298N or L293D.

Can I use a 9V battery instead of a 12V adapter?

Yes for a small motor, but a 9V battery cannot supply much current — the motor will be weak and the battery will run down fast. A 12V adapter is better for anything bigger than a toy motor.

Conclusion

A 75NF75 MOSFET with an Arduino is one of the best first motor-control projects: one PWM pin, one gate resistor, one pull-down, one diode, and the motor obeys. Remember the three things that trip everyone up — the Arduino GND and the 12V supply GND must be joined, the flyback diode's cathode goes to +12V, and the 10kΩ pull-down keeps the Gate from floating. That is the whole project, and it works.