Interfacing DC Motor with 8051 with Proteus Simulation.

Here we are going to study DC Motor interfacing with 8051 microcontroller (AT89C51) on proteus simulation and you can implement this live on your circuit which is easy using l293d motor driver. DC Motor can also be controlled using Arduino Board.

Check out: Speed Control of DC Motor using Arduino

Why L293D motor driver required?

Ans. Microcontroller works on 5v and it cannot source current more than 15mA. As we are interfacing a motor it requires large amount of power to operate which 8051 cannot deliver. The source current require to operate dc motor is more then 20mA, that is why L293D motor driver is used. L293D motor driver provides that require power which helps to isolate 8051 and dc motor.

Circuit Diagram:

CIRCUIT DIAGRAM OF DC MOTOR INTERFACING WITH 8051
CIRCUIT DIAGRAM OF DC MOTOR INTERFACING WITH 8051
  • The circuit consists l293d driver which is connected on port2
  • IN1 and IN2 are the two inputs to drive the motor. One input should be at logic high and other input should be at logic low.
  • OUT1,OUT2 are the output pins directly connected to motor.
  • VS=12v DC supply.
  • VSS 5v DC supply.

Know more about l293d: download datasheet [from texas instruments]

CODE[written in KEIL]:

THIS CODE WILL ROTATE THE MOTOR IN FORWARD DIRECTION FOR SOMETIME AND REVERSE DIRECTION FOR THE SAME TIME


#include

int i,j;

void delay();

void main(void)

{

while(1)

{

P2=0X01;//forward

delay();

P2=0X02;//reverse

delay();

}

}

//DELAY FUNCTION

void delay(void)

{

for (i=0;i<1000;i++)

{

for(j=0;j<1000;j++);

}

}

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here