Arduino Tutorials – Lesson 10 – DC Motor Control Using Arduino UNO

Creating DC Motor Control program using Arduino UNO

Required Components

  1. DC motor -1 no
  2. L293D Driver sheild -1 no
  3. Arduino UNO -1 no
  4. Bread board -1 no
  5. Connecting wires -1 set

Circuit

Steps

  1. Make sure the components are working properly.
  2. Connect the Motor Driver Shield to the Arduino UNO Board.
  3. Connect the DC motor to the Shield Pin 3.
  4. Connect the 9V Battery to the L293D Motor Driver carefully.
  5. Check the Circuit Connections.
  6. Check the Arduino program.
  7. Run the Arduino program

Arduino Program

#include <AFMotor.h>
AF_DCMotor motor1(3);

void setup() 
{
  motor1.setSpeed(200);
  motor1.run(RELEASE);
}

void loop()
{
  motor1.run(FORWARD);
  motor1.setSpeed(255);
  delay(1000);
  motor1.run(BACKWARD);
  motor1.setSpeed(255);
  delay(1000);
}

Usage

  1. Moving wheel Robot
  2. Rotating Robot Arms
  3. For pump related applications

Leave a Reply

Your email address will not be published. Required fields are marked *