Sie sind auf Seite 1von 4

Microcontroller and Microprocessor Project

TEAM DETAILS

Name M.Shafiudeen S.Sushindren


Dept ECE ECE
Roll.No 17BEC031 17BEC011
Interfacing DC Motor with 8051

Aim:
The Aim of the project to Interface the DC motor with 8051 using Proteus.

DC Motor:
A DC motor is any of a class of rotary electrical machines that converts direct
current electrical energy into mechanical energy. The most common types rely on the forces
produced by magnetic fields. Nearly all types of DC motors have some internal mechanism,
either electromechanical or electronic, to periodically change the direction of current flow in
part of the motor.
DC motors were the first form of motor widely used, as they could be powered from existing
direct-current lighting power distribution systems. A DC motor's speed can be controlled over
a wide range, using either a variable supply voltage or by changing the strength of current in
its field windings.

8051 Microprocessor:
8051 microcontroller is designed by Intel in 1981. It is an 8-bit microcontroller.
It is built with 40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM
storage, 2 16-bit timers. It consists of are four parallel 8-bit ports, which are programmable as
well as addressable as per the requirement. An on-chip crystal oscillator is integrated in the
microcontroller having crystal frequency of 12 MHz.

Algorithm:
• Declare P0.5 and P0.6 as inputs and P0.0 and P0.1 as outputs.
• Now check weather the first button is pressed or not. If pressed, then send logic one to
P0.0 and logic 0 to P0.1. This will make the motor to rotate in forward direction.
• Next check whether the second button is pressed or not. If pressed, then send logic 1
to P0.1 and logic 0 to P0.0 to rotate the motor in reverse direction.

Working:
In the project we are going to DC motor in unidirectional Rotation

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

Code:

#include<reg51.h>

sbit mot1 = P0^0;

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)

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);

while(1);

Applications:

• This concept is used in robots to control the robot directions.


• Used to control the speed of the DC motor.
• It is used in the applications where we need to drive the high voltage motors.

Das könnte Ihnen auch gefallen