fbpx

Interface Dc-Motor With PIC

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 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.
  • PIC16f877a MicroController.

Circuit

Virtual Circuit

Code

 void main()
 {
 TRISB.F0=0;
 TRISB.F1=0;
 PORTB.F0=0; //rotate in clockwise
 PORTB.F1=1;
 PORTB.F0=1; //rotate in anticlockwise
 PORTB.F1=0;
 } 

Leave a Reply

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