100% found this document useful (1 vote)
101 views6 pages

DC Motor Control Exp

This document describes an experiment to control DC motors using an L293D motor driver IC and switches. The objectives are to understand how the L293D interface switches with a microcontroller to change the direction of motor rotation. The procedure connects switches and motors to a Proteus simulation with an 8051 microcontroller. An embedded C program is used to read the switches and send signals to the L293D to turn the motors on/off in different directions.

Uploaded by

vijesh_anna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
101 views6 pages

DC Motor Control Exp

This document describes an experiment to control DC motors using an L293D motor driver IC and switches. The objectives are to understand how the L293D interface switches with a microcontroller to change the direction of motor rotation. The procedure connects switches and motors to a Proteus simulation with an 8051 microcontroller. An embedded C program is used to read the switches and send signals to the L293D to turn the motors on/off in different directions.

Uploaded by

vijesh_anna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

RAMRAO ADIK INSTITUTE OF TECHNOLOGY NERUL, NAVI

MUMBAI
DEPARTMENT OF INSTRUMENTATION ENGINEERING

TE Instrumentation
SEM-V
Application of Microcontroller-I
Experiment NumberON-OFF control of DC motor using switches and motor driver IC
Roll NumberNameDiv.-

RAMRAO ADIK INSTITUTE OF TECHNOLOGY NERUL, NAVI


MUMBAI
DEPARTMENT OF INSTRUMENTATION ENGINEERING

Experiment No.:-

Date:-

Aim:- To Perform on-off control of a DC motor using switches and L293D motor driver IC.
Objective:- To make the students understand the use of switches and L293D to change
the direction of rotation of the motor.

Outcome:- After completion of this experiment, the student will be able to


(i)
(ii)
(iii)

Interface switches with 8051.


Use of motor driver IC L293D to interface a DC motor.
Programs the 8051using embedded C language.

Apparatus:- Proteus software, Keil- vision software , PC etc.


Theory:A DC motor requires a Push pull driver circuit with capability of delivering output currents of
1A. The L293 and L293D are quad push-pull drivers capable of delivering output currents to 1A
or 600mA per channel respectively. Each channel is controlled by a TTL-compatible logic input
and each pair of drivers (a full bridge) is equipped with an inhibit input which turns off all four
transistors. A separate supply input is provided for the logic so that it may be run off a lower
voltage to reduce dissipation. L293D is a motor driver. As its name suggests it can drive a motor
(normally DC motors up-to certain range). Since the output voltage of 8051 is limited to 5V only
thus motors with higher required voltage need some drivers to provide them their desired input
voltage.
What L293D does is, it takes the TTL (0/5v) input from the output pins of 8051 microcontroller
and forwards the output through itself of higher voltage (required by DC motors). Connecting a
DC motor directly to the pins of 8051 would not work. It may even damage the microcontroller.

L293D is a 16-pin IC which can control a set of two DC motors simultaneously in any direction.
It means that you can control two DC motor with a single L293D IC.
The l293d can drive small and quiet big motors as well.

There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor, the pin 1
and 9 need to be high. For driving the motor with left H-bridge you need to enable pin 1 to high.
And for right H-Bridge you need to make the pin 9 to high. If anyone of the either pin1 or pin9
goes low then the motor in the corresponding section will suspend working. Its like a switch.
There are 4 input pins for this l293d, pin 2, 7 on the left and pin 15 ,10 on the right. Left input
pins will regulate the rotation of motor connected across left side and right input for motor on the
right hand side. The motors are rotated on the basis of the inputs provided across the input pins
as LOGIC 0 or LOGIC 1.
In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor.
Lets consider a Motor connected on left side output pins (pin 3,6). For rotating the motor in
clockwise direction the input pins has to be provided with Logic 1 and Logic 0.
Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction
Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction
Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]
In a very similar way the motor can also operated across input pin 15,10 for motor on the right
hand side.
VCC is the voltage that it needs for its own internal operation 5v; l293D will not use this voltage
for driving the motor. For driving the motor it has a separate provision to provide
motor supply VSS. L293d will use this to drive the motor. It means if you want to operate a
motor at 9V then you need to provide a Supply of 9V across VSS Motor supply.

The maximum voltage for VSS motor supply is 36V. It can supply a max current of 600mA per
channel. Since it can drive motors Up to 36v hence you can drive pretty big motors with this
l293d.
Below, we interface 2 DC motors using L293D IC with 8051 and turn them ON or OFF using
switches.

Procedure:1.
2.
3.
4.
5.
6.

Create a new project file in Keil- vision software


Select a AT89c51 microcontroller as a target device
Add the .C script file as a source file to the mentioned target device
Create a program, compile and debug it for errors
Create the executable file, i.e. HEX file.
Open Proteus software, add from library the same target device for which the program
was created
7. Interface switches and motors along with motor driver IC L293D as shown.
8. Load the HEX file into the target device
9. Play the simulation and using switches control the direction of the rotation of the motor.

Program:#include<reg51.h>
#define sw P1 //switches be connected to port P1
//P1.1 m1 and m2 forward
//P1.2 m1 and m2 reverse
//p1.3 m1 forward m2 stop
//p1.4 m2 forward m1 stop
sbit EN1=P2^0; //enable pin for motor 1
sbit EN2=P3^0; //enable pin for motor 2
sbit m1_0=P2^1;
sbit m1_1=P2^2;
sbit m2_0=P3^1;
sbit m2_1=P3^2;
void main( )
{
EN1=0;
m1_0=0;
m1_1=0;
4

EN2=0;
m2_0=0;
m2_1=0;
while(1)
{
//both the motors are enabled
EN1=1;
EN2=1;
//sw1 is pressed
if(sw==0xFE) // 1111 1110
{
m1_0=0;
m1_1=1;
m2_0=0;
m2_1=1;
}
//sw2 is pressed
else if(sw==0xFD) // 1111 1101
{
m1_0=1;
m1_1=0;
m2_0=1;
m2_1=0;
}
//sw 3 is pressed
else if(sw==0xFB) // 1111 1011
{
m1_0=0;
m1_1=1;
m2_0=0;
m2_1=0;
}
//sw4 is pressed
else if(sw==0xF7) // 1111 0111
{
m1_0=0;
m1_1=0;
m2_0=0;
m2_1=1;
}

//none is pressed
else
{
m1_0=0;
m1_1=0;
m2_0=0;
m2_1=0;
}
}
}

Output:-

Conclusion:
We successfully implemented ON-OFF control of two DC motors using L293D IC and switches.

You might also like