fbpx

Interface Dc Motor With Arduino Uno

DC Motor is small in size, inexpensive and powerfull.It is widely used in robotics for their small size and high energy out.

  • A typical DC motor operates at very high speed.
  • Gear reduces the speed of motor and increases the torque.

L293D Motor Driver

  • L293D is a H-BRIDGE dc motor controller,which can control dc motor upto 36V.
  • Driver allow dc motor to rotate in both direction, which can interface and control the two motor at a time with microcontroller.
  • Driver allow voltage to flow in both direction hence motor can rotate in both clockwise and anti-clock wise direction.

Direction Table

Hardware Required

  • DC Motor.
  • L293D Motor Driver.
  • Arduino Uno.

Circuit

Code

int button =12;
 void setup()
 {
 pinMode(11, OUTPUT);
 pinMode(10, OUTPUT);
 pinMode(button,INPUT);
 }
 void loop()
 {
 if (button == LOW)
 {
 //Rotate In Clock Wise
 digitalWrite(11, HIGH);
 digitalWrite(10, LOW);
 delay(1000);
 //Rotate In AntiClock Wise
 digitalWrite(11, LOW);
 digitalWrite(10, HIGH);
 delay(1000);
 }
 else
 {
 // Motor Turn Off
 digitalWrite(11, LOW);
 digitalWrite(10, LOW);
 }
 }

Leave a Reply

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