Motor Controlled with Arduino

Motor Controlled with Arduino

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

  • 34,715 views
  • 25 comments
  • 87 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

Bluetooth Controlled Bot (Using Adafruit L293D Motor Driver)

Project showcase by Chandran N

  • 3,664 views
  • 1 comment
  • 15 respects

Clap Controlled DC Motor

Project tutorial by Nakshatra401

  • 1,942 views
  • 1 comment
  • 7 respects

Simple Programmable Robotic Arm

Project showcase by Ryan Chan

  • 99,594 views
  • 94 comments
  • 256 respects

Temperature-controlled RGB LED

by Benjamin Larralde

  • 25,546 views
  • 9 comments
  • 38 respects

LCD (Liquid Crystal Display)

by MicroBob

  • 54,486 views
  • 69 comments
  • 168 respects

Check a Stepper Motor From the DVD-ROM

by Ingo Lohs

  • 18,505 views
  • 2 comments
  • 44 respects
Add projectSign up / Login