fbpx

Interface Dc Motor With ARM7

Description

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

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

L293D Motor Driver

  • L293D is an H-Bridge DC motor controller, which can control DC motor up to 36V.
  • Driver allows the dc motor to rotate in both directions which can interface and control the two motor at a time with the microcontroller.
  • Driver allows voltage to flow in both direction hence motor can rotate in both clockwise and anti-clockwise direction.

Direction Table

Hardware Required

  • Dc Motor.
  • L293D Motor Driver.
  • LPC21XX MicroController.

Circuit

Code

 #include <LPC21xx.H>
 void delay()
 {
 int i,j;
 for(i=0;i<10000;i++)
 {
 for(j=0;j<100;j++);
 }
 }
 int main()
 {
 IO0DIR=0XFFFFFFFF;
 IO1DIR=0XFFFEFFFF;
 while(1)
 {
 if(IO1PIN &(1<<16))
 {
 IO0PIN=0XFFFFFFFE;
 delay();
 IO0PIN=0XFFFFFFFD;
 delay();
 }
 else
 {
 IO0PIN=0XFFFFFFFF;
 delay();
 }
 }
 } 

Leave a Reply

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