12
1

Dc motor interfacing with 8051 microcontroller

Embed Size (px)

Citation preview

Page 1: Dc motor interfacing with 8051 microcontroller

1

Page 2: Dc motor interfacing with 8051 microcontroller

INTRODUCTION

Interfacing DC motor to 8051 forms an essential part in designing embedded

robotic projects. A well designed 8051-DC motor  system  has essentially

two parts. Firstly an 8051 with the required software to control the motor and

secondly a suitable driver circuit. Most of the DC motors have  power

requirements well out of the reach of a microcontroller and more over the

voltage spikes produced while reversing the direction of rotation could easily

damage the microcontroller. So it is not wise to connect a DC motor directly

to the microcontroller. The perfect solution is to use a motor driver circuit in

between the microcontroller and the DC motor.

The driver circuit used in this presentation are:-

a)L293 IC b) H-bridge

2

Page 3: Dc motor interfacing with 8051 microcontroller

USING L293 DRIVER TO INTERFACE DC MOTOR WITH 8051

L293 is a dedicated quadruple half H bridge motor driver IC available in 16 pin

package. L293 has a current capacity of  600mA/channel and has supply

voltage range from 4.5 to 36V DC. They are fitted with internal high speed

clamp diodes for inductive spike protection. Other good features of L293 are

high noise immunity, internal ESD protection, thermal shutdown, separate

input supply for each channel etc. The pin out of L293 motor driver is

shown in the figure below.

 

3

Page 4: Dc motor interfacing with 8051 microcontroller

Below is the diagram that show how l293 is connected to 8051 for bi-

directional control, and also the truth table indicating the direction

of motion of the motor depending on the input from microcontroller

to l293.

4

Page 5: Dc motor interfacing with 8051 microcontroller

5

Page 6: Dc motor interfacing with 8051 microcontroller

6

P1.0

P1.1

State of the motor

0 0 stop or break

0 1 Motor move anti-clockwise

1 0 Motor move clockwise

1 1 Stop or break

Three pins are needed for interfacing a DC motor (A, B, Enable). If

you want the o/p to be enabled completely then you can connect

Enable to VCC and only 2 pins needed from controller to make the

motor to rotate either clockwise or anti-clockwise depending on the

output from microcontroller.

Page 7: Dc motor interfacing with 8051 microcontroller

H-BRIDGE CIRCUIT

The name "H-Bridge" is derived from the actual shape of the switching

circuit which control the motion of the motor. It is also known as

"Full Bridge". Basically there are four switching elements in the H-

Bridge as shown in the figure below.

7

Page 8: Dc motor interfacing with 8051 microcontroller

OPERATIONAL PRICIPLE

The H-bridge is connected to p1.0 and p1.1 of the 8051 microcontroller, if

p1.0 is low and p1.1 is high, the the transistors Q2 and Q4 will be bias and

allow the flow of current from the Vcc through Q4 to Q2 and then to

ground, there by rotating the motor in the anticlockwise direction as shown

below,

8

Page 9: Dc motor interfacing with 8051 microcontroller

If p1.0 is high and p1.1 is low will be bias, Q1 and Q3, thus allowing the

collector current to flows from the Vcc through Q1 to Q3 and then to

ground, there by rotating the motor in clockwise direction as shown in the

diagram below.

9

Page 10: Dc motor interfacing with 8051 microcontroller

The above H-bridge circuit is applicable only when the dc motor voltage is

only 5v, however in the situation where by the dc motor voltage is greater

than 5v, the above H-bridge circuit is modified as shown below

10

Page 11: Dc motor interfacing with 8051 microcontroller

11

The above circuit is also made up of four transistor H-bridge. To run the motor

in one direction, Q5 and Q8 are turned ON and Q6 and Q7 are OFF, the left

side of the motor is at 12v and the right side is at ground. And hence the

motor will rotate clockwise direction. To reverse the direction of rotation of

the motor, Q5 and Q8 are OFF and Q6 and Q7 are ON, this will rotate the

motor in anti-clockwise direction.

Page 12: Dc motor interfacing with 8051 microcontroller

12