You are on page 1of 8

QUAID-E-AWAM UNIVERSITY OF ENGINEERING,

SCIENCE & TECHNOLOGY NAWABSHAH, SINDH,


PAKISTAN

PROJECT REPORT
INTERFACING DC MOTOR WITH 8051
MICROCONTROLLER

SUBJECT: EMBEDDED SYSTEM


SUBMITTED TO: DR. BHAGWAN DAS

MEMBERS
ROLL # 18ES-03 (GROUP LEADER)
ROLL # 18ES-40
ROLL # 18ES-41
ROLL # 18ES-37
ROLL # 18ES-07

1
Table of Content

Introduction…………………………………….……………………..3

Working…………………………………………….…………….…..3

Coding………………………………………………………………..3

How to Operate……………………………………………..………..6

Applications…………………………………………………...……..7

Circuit Diagram……………………………………………….……..7

Hardware Interface…………………………………………..………8

Conclusion…………………………………………………………...8

2
INTRODUCTION

In this Project, we will learn about L298N Motor Driver and


also about interfacing DC Motor with 8051(89S52)
Microcontroller with the help of L298N. When we are talking
the controlling the robot, the first things come into the mind is
controlling DC motors. Interfacing DC Motor to the
Microcontroller is very important concept in Robotic
Applications. By interfacing DC Motor to the
Microcontroller, we can do many things like controlling the
direction of motor, controlling the speed of motor. This
project tells about that how to control DC Motor using 89S52.

WORKING

After loading the Program in the Microcontroller the motor


will not start turning until the buttons are not clicked.
According to my work, When I click the switch 1, the motor
will start in clockwise direction. When I click the switch 2,
the motor will start in Anti-clockwise direction. When I click
the switch 3, the motor will stop.

CODING

#include<reg51.h>

sbit mot1 = P0^0;

3
sbit mot2 = P0^1;

sbit forward = P0^5;

sbit backward = P0^6;

sbit stop = P0^7;

void main()

mot1=0;

mot2=0;

forward=1;

backward=1;

stop=1;

while(1)

if(forward==0)

{
4
mot1=1;

mot2=0; while(forward==0);

else if(backward==0)

mot1=0;

mot2=1; while(backward==0);

else if(stop==0)

mot1=0;

mot2=0;

while(stop==0);

5
}

while(1); 

HOW TO OPERATE?

 Burn the program to the 8051 microcontroller.

 Now give the connections as per the circuit diagrams.

 While giving the connections, make sure that there is no


direct supply connection from battery to the controller.

 Switch on the board supply, now the motor is at


stationary condition.

 Press first button, you can observe that motor will rotate
in clockwise direction.

 Press the second button, now the motor rotates in


anticlockwise direction.

 Switch off the board supply

6
APPLICATIONS

1. This concept is used in robots to control the robot


directions.

2. Used to control the speed of the DC motor.

3. It is used in the applications where we need to drive the


high voltage motors.

CIRCUIT DIAGRAM 

7
HARDWARE INTERFACE

CONCLUSION

In this Project, we will learn about L298N Motor Driver and


also about interfacing DC Motor with 8051(89S52)
Microcontroller with the help of L298N. Interfacing DC
Motor to the Microcontroller is very important concept in
Robotic Applications. By interfacing DC Motor to the
Microcontroller, we can do many things like controlling the
direction of motor, controlling the speed of motor. This
project tells about that how to control DC Motor using 89S52.
8

You might also like