Motor Controlled with Arduino

Motor Controlled with Arduino

A simple way to control a motor with a potentiometer and an Arduino.

  • 24,167 views
  • 20 comments
  • 70 respects

Components and supplies

About this project

About

In order to understand how MOFSETs work I hooked one up to an Arduino. It controls a motor and an LED. The speed of the motor and brightness of the LED are controlled by a potentiometer.

Demo

Code

sketch.cC/C++
sketch.c
#define MOF_PIN 6
#define POT_PIN A1

int pot = 0;

void setup() {
  pinMode(MOF_PIN, OUTPUT);
  pinMode(POT_PIN, INPUT);
  Serial.begin(9600);
}

void loop() {
  pot = analogRead(POT_PIN);
  Serial.println(pot);
  
  analogWrite(MOF_PIN, pot/4);
}

Schematics

Fritzing capture
I drew this by looking at the photo so I'm not 100% sure it's correct.
Control%20dc%20motor%20with%20arduino%20and%20pot bb
Full Fritzing file
control%20dc%20motor%20with%20arduino%20and%20pot.fzz
Wiring
Img 20140427 153858

Comments

Similar projects you might like

Simple Programmable Robotic Arm

Project showcase by Ryan Chan

  • 49,025 views
  • 63 comments
  • 145 respects

Temperature-controlled RGB LED

by Benjamin Larralde

  • 19,546 views
  • 7 comments
  • 30 respects

3D Printed Stepper Motor

Project tutorial by Anthony Garofalo

  • 13,054 views
  • 10 comments
  • 54 respects

Smartphone Controlled Arduino 4WD Robot Car

Project in progress by Andriy Baranov

  • 53,239 views
  • 43 comments
  • 98 respects
Add projectSign up / Login