Dc Motor Mosfet Control Speed Using Arduino

Photo of Ron

Made by Ron / Automotive / Robotics

About the project

In this tutorial we will learn how to control a DC Motor speed using a MOSFET Module. Watch the video!

Project info

Difficulty: Easy

Platforms: ArduinoVisuino

Estimated time: 1 hour

License: GNU Lesser General Public License version 3 or later (LGPL3+)

Items used in this project

Hardware components

Jumper wires (generic) Jumper wires (generic) x 1
DC Motor, 12 V DC Motor, 12 V x 1
mosfet module mosfet module x 1
Arduino UNO Arduino UNO x 1

Software apps and online services

Visuino Visuino
Arduino IDE Arduino IDE

Story

In this tutorial we will learn how to control a DC Motor speed using a MOSFET Module.

Watch the video!

Step 1: What You Will Need

1 / 5

  • DC Motor
  • MOSFET Module
  • Potentiometer
  • Arduino UNO (or any other Arduino)
  • Jumper wires
  • Visuino software: https://www.visuino.eu

Step 2: Circuit

  • Connect potentiometer pin OTB to Arduino Analog Pin A0
  • Connect potentiometer pin VCC to Arduino Analog Pin 5V
  • Connect potentiometer pin GND to Arduino Pin GND
  • Connect Arduino digital pin [ 5] to MOSFET Module pin [Sig]
  • Connect MOSFET Module pin VCC to Arduino Analog Pin 5V
  • Connect MOSFET Module pin GND to Arduino Pin GND
  • Connect DC motor positive pin (+) to MOSFET Module pin [V+]
  • Connect DC motor negative pin (-) to MOSFET Module pin [V-]
  • Connect Power Supply positive pin (+) to MOSFET Module pin [VIN]
  • Connect Power Supply negative pin (-) to MOSFET Module pin [GND]

Step 3: Start Visuino, and Select the Arduino UNO Board Type

1 / 2

The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

Step 4: In Visuino

Connect Arduino Analog pin 0 to Arduino digital pin 5

Step 5: Generate, Compile, and Upload the Arduino Code

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Step 6: Play

If you power the Arduino module, the motor will start to spin and you can change the speed by sliding the potentiometer.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this tutorial, you can download it and open it in Visuino: https://www.visuino.eu

Schematics, diagrams and documents

Visuino File

Code

Visuino File

Credits

Photo of Ron

Ron

Arduino Developer

   

Leave your feedback...