0% found this document useful (0 votes)
131 views

Fyp-Obstacle Avoiding Robot

fyp-obstacle avoiding robot

Uploaded by

Giang Bùi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views

Fyp-Obstacle Avoiding Robot

fyp-obstacle avoiding robot

Uploaded by

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

www.final-yearproject.

com

PROJECT REPORT
ON

“OBSTACLE AVOIDING ROBOT”

In the partial fulfillment of the requirement for the award of degree

Of

BACHELOR OF TECHNOLOGY

IN

ELECTRONICS & COMMUNICATION ENGINEERING

MODERN INSTITUE OF ENGINEERING & TECHNOLOGY


KURUKSHETRA UNIVERSITY: KURUKSHETRA

DECEMBER 2012

Submitted To:- Submitted By:-


Er.Nitin Nikesh Sanchit Sharma

Lect.in ECE Deptt. Roll No. 3909256


www.final-yearproject.com

DECLARATION

I, Sanchit Sharma, a student of Bachelor of Technology (ece), in the Department


of ECE , Modern Institute of Engineering and Technology, Kurukshetra
University, Kurukshetra, under class Roll No.3909269 for the session 2009-
2013 hereby, declare that the dissertation entitled “OBSTACLE AVOIDING
ROBOT” has been completed by me in 7th semester.
The matter embodied in this Dissertation has not been submitted earlier for
award of any degree to the best of my knowledge and belief

Sanchit Sharma
www.final-yearproject.com

KURUKHETRA UNIVERSITY :KURUKHETRA

BONAFIDE CERTIFICATE

Certified that this project report “OBSTACLE AVOIDING ROBOT” is the


bonafide work of “Sanchit Sharma” who carried out the project work under my
supervision.

SIGNATURE SIGNATURE

ER.VIKAS SHARMA ER. NITIN NIKESH

(HEAD OF THE DEPARTMENT) SUPERVISIOR

Electronics & Communication Department

MIET ,MOHRI,SHAHABAD

DISTT. KURUKHETRA
www.final-yearproject.com

ACKNOWLEDGEMENTS

The submission of this project gives me an opportunity to convey our gratitude to


all those who have helped me to reach a stage where I have immense confidence to
launch my career in the competitive world of Electronics and communication.

I avail this opportunity to express my profound sense of sincere and deep gratitude
to Mr. Vikas Sharma, Head of the ECE Department of MIET. For her valuable
guidance and meticulous supervision during the preparation of this project report.

I am very much thankful and highly obliged my project supervisor Er. Nitin
Nikesh. I am also very thankful to the staff member of the ECE Department for
providing me the suitable environment in terms of hardware & software.

Last but not least, We also very much thankful to our parents, brother and sisters
for their continuous encouragement and moral support during this project and other
people who helped us in preparing this project knowingly and unknowingly.

Sanchit Sharma
www.final-yearproject.com

ABSTRACT

In the ever-widening world, the present system of education is facing new


challenges.Electronics and communication is one of the most popular engineering
courses of today’s time. The main focus of this program is on wireless technology.
Mobiles, Television, radios etc are common mode of communication and it
fascinates students to work with this modern day technology. We usually recognize
ECE with Semiconductors, Diodes, transistors etc. The department of Electronics
and Communication helps students in developing leadership skills, problem
solving skills & design capability to make a distinguish identity in the industry. So
realizing these fact ,I have chosen ELECTRONICS &COMMUNICATON ENGG
at my esteemed institution MIET.

This degree course aims at providing the student knowledge about the various
applications of electronics. So it is necessary to jump into the practical field.
Hence, I was assigned this project which is part of my syllabus.
www.final-yearproject.com

INDEX

CHAPTER PAGE NO.

1. INTRODUCTION TO DEPARTMENT

1.1 INTRODUCTION 1

2.1 CHARACTERSTICS 1

3.1 APPLICATIONS 2

2. INTRODUCTION TO OBSTACLE AVOIDING ROBOT

2.1 INTRODUCTION 3

2.2 BLOCK DIAGRAM 5

2.3 BLOCK DIAGRAM DESCRIPTION 5

3. HARDWARE DESCRIPTION

3.1 HARDWARE MODULES 10

3.2 HARWARE MODULES DESCRIPTION 10

4. CIRCUIT DIAGRAM OF OBSTACLE AVOIDING ROBOT

4.1 CIRCUIT DIAGRAM 23

4.2 CIRCUIT LEVEL DESCRIPTION 24

5. PROGRAMMING OF OBSTACLE AVOIDING ROBOT 33

CONCLUSION 41

BIBLIOGRAPHY 42
www.final-yearproject.com

LIST OF FIGURES

FIGURE NO. PAGE NO.

2.1 OBSTACLE AVOIDING ROBOT IMAGE 4

2.2 BLOCK DIAGRAM OF ROBOT 5

2.3 IR SENSORS IMAGE 7

2.4 AT89C52 CHIP 8

2.5 L293D MOTOR DRIVER IMAGE 9

3.1 PIN DIAGRAM OF 8051 11

3.2 OSCILLATOR CIRCUIT 16

3.3 INTERNAL ARCHITECHTURE OF 8051 17

3.4TOP VIEW OF L293D 19

3.5 INTERNAL VIEW OF DC MOTOR 21

4.1 CIRCUIT DIAGRAM OF ROBOT 23

4.2 VOLTAGE REGULATOR 25

4.3 PIN DETAILS OF L293D 27

4.4 DIFFERENT TYPES OF MOVEMENT OF ROBOT 31


www.final-yearproject.com

LI ST OF TABLES

TABLE NO. PAGE NO.

3.1 PORT 3 PIN FUNCTIONS 14

4.1 MOTOR MOVEMENT 29

4.2 ROBOT MOVEMENT 32


www.final-yearproject.com

CHAPTER-1

INTRODUCTION TO THE DEPARTMENT

1.1 INTORDUTION:

An embedded system is a computer system designed to perform one or a few


dedicated functions often with real-time computing constraints. It is embedded as
part of a complete device often including hardware and mechanical parts. By
contrast, a general-purpose computer, such as a personal computer (PC), is
designed to be flexible and to meet a wide range of end-user needs. Embedded
systems control many devices in common use today.

Embedded systems are controlled by one or more main processing cores that is
typically either a microcontroller or a digital signal processor (DSP). The key
characteristic is however being dedicated to handle a particular task, which may
require very powerful processors. Since the embedded system is dedicated to
specific tasks, design engineers can optimize it reducing the size and cost of the
product and increasing the reliability and performance.

1.2 CHARACTERISTICS

1. Embedded systems are designed to do some specific task, rather than be a


general-purpose computer for multiple tasks. Some also have real-time
performance constraints that must be met, for reasons such as safety and

usability; others may have low or no performance requirements, allowing the


system hardware to be simplified to reduce costs.

1
www.final-yearproject.com

2. Embedded systems are not always standalone devices. Many embedded


systems consist of small, computerized parts within a larger device that
serves a more general purpose.
3. The program instructions written for embedded systems are referred to as
firmware, and are stored in read-only memory or Flash memory chips. They
run with limited computer hardware resources: little memory, small or non-
existent keyboard and/or screen.

1.3 APPLICATIONS:

Embedded controllers may be found in many different kinds of system and are
used for many different applications. Such as:

 Manufacturing and process control


 Construction industry
 Transport
 Buildings and premises
 Domestic service
 Communications
 Office system and mobile equipment
 Medical diagnostics,monitoring and life support
 Testing ,monitoring and dianostic system
 Banking,finance and commercial
2
www.final-yearproject.com

CHAPTER-2

2.1 INTRODUCTION TO OBSTACLE AVOIDING ROBOT

Robotics is part of Todays communication. In today’s world ROBOTICS is fast


growing and interesting field. It is simplest way for latest technology modification.
Now a days communication is part of advancement of technology, so we decided
to work on ROBOTICS field, and design something which will make human life
simpler in day today aspect. Thus we are supporting this cause. This project is
basic stage of any automatic robot. This ROBOT has sufficient intelligence to
cover the maximum area of provided space. It has a infrared sensor which are used
to sense the obstacles coming in between the path of ROBOT. It will move in a
particular direction and avoid the obstacle which is coming in its path. We have
used two D.C motors to give motion to the ROBOT. The construction of the
ROBOT circuit is easy and small .The electronics parts used in the ROBOT
circuits are easily available and cheap too.

3
www.final-yearproject.com

Figure:2.1 obstacle avoiding robot

The project uses μc AT89C52 as the controlling element. It uses IR (Infra


Red) sensors and two IR transmitting circuitry. When the obstacle comes in
path of robot IR beam is reflected from the obstacle then sensor gives zero
voltage to μc. This zero voltage is detected then μc decides to avoid the
obstacle by taking left or right turn. If the sensor gives +5v to μc that means
there is no obstacle present in it path so it goes straight until any obstacle is
detected. The two IR transmitter circuits are fitted on front and left side of
robot. The two IR sensors are placed near to transmitters’ IR LEDs. The
connections can be given from main circuit to sensors using simple twisted
pair cables. Two motors namely right motor and left motor are connected to
driver IC (L293D). L293D is interface with μc. Micro-controller sends logic
0 & logic 1 as per the programming to driver IC which moves motors
forward or reverse direction.

4
www.final-yearproject.com

2.2 BLOCK DIAGRAM:

Figure:2.2 block diagram of robot

2.3 BLOCK DIAGRAM DESCRIPTION:

1) IR Sensors

2) Microcontroller AT89C52

3) Motor Driver

4) Motors

5
www.final-yearproject.com

1. IR TRANSMITTER & RECEIVER

The IR Transmitter block mainly used to generate IR signal. It uses timer


IC555 in astable multivibrator mode to generate square wave which have
continuous pulses of 50% duty cycle of frequency 38 KHz. This transmitter
is so arranged that the IR rays are focused on the sensor. IR sensor which
gives normally 5v at output of it. After receiving infrared light at output of
sensor we get 0v.

WORKING:

Working of IR sensor is very simple and working principle is totally based


on change in resistance of IR receiver which is similar to LDR ( light
dependent register ) and reflection of light.

Here in this sensor we connect IR receiver in reverse bias so it give very


high resistance if it is not exposed to IR light. the resistance in this case is in
range of Mega ohms.

but when IR light reflected back and fall on IR receiver. The resistance of
Rx it comes in range between Kilo ohms to hundred of ohms.

6
www.final-yearproject.com

We convert this change in resistance to change in voltage . Then this voltage


is applied to a comparator IC which compare it with a threshold level
(defined by us according to required range and sensitivity ).
if voltage of sensor is more than threshold then output is high else it is low
(depends on your connection to comparator ) which can be used directly for
microcontroller

Figure: 2.3 IR Sensors

IR sensor is nothing but a diode, which is sensitive for infrared radiation. This
infrared transmitter and receiver is called as IR TX-RX pair.

It can be obtained from any decent electronics component shop and costs less than
10Rs. Following snap shows 3mm and 5mm IR pairs. Colour of IR transmitter and
receiver is different.

7
www.final-yearproject.com

However you may come across pairs which appear exactly same or even has
opposite colours than shown in above pic and it is not possible to distinguish
between TX and RX visually. In case you will have to take help of multimeter to
distinguish between them.
2. Microcontroller

This is the most important block of the system. Microcontroller is the


decision making logical device which has its own memory, I/O ports, CPU

and Clock circuit embedded on a single chip.

Figure:2.4 AT89C52 Chip

3. MOTOR DRIVER:

The MCU cannot drive the motors (used to actually make the robot run)
directly, so a motor driver is used.
L293D is used as driver IC. Motors are connected to this IC. According to
program in μc it drives the left and right motor.

8
www.final-yearproject.com

Figure:2.5 L293D motor driver

4. MOTOR

Motor are used for the movement of the robot .here we use the dc motor as it
has the principle of speed controlling.

9
www.final-yearproject.com

CHAPTER-3

HARDWARE DISCRIPTION

3.1HARDWARE MODULES:

The hardware modules of this project are:

 Microcontroller
 Motor driver
 Motors
3.2 HARDWARE MODULE DISCRIPITON:

3.2MICROCONTROLLER:-

The AT89C52 is a low power ,high performance CMOS 8 bit microcomputer with
8k bytes of flash programmable and erasable read

Only memory .The device is manufactured using Atmel’s high density nonvolatile
memory technology and is compatible with the industry standard 80C51 and
80C52 instrution set and pinout .

The on-chip flash allows the program memory to be reprogrammed in system or by


a conventional nonvolatile memory programmer.By combining a versatile 8-bit
CPU with Flash on a monolithic chip, the Atmel AT89C52 is a powerful with
Flash on a monolithic chip, the Atmel AT89C52 is a powerful microcomputer

with Flash on a monolithic chip, the Atmel AT89C52 is a powerful


microcomputer 10
www.final-yearproject.com

3.2.1 FEATURES:

 Compatible with MCS-51™ Products


 K Bytes of In-System Reprogrammable Flash Memory
 Endurance: 1,000 Write/Erase Cycles
 Fully Static Operation: 0 Hz to 24 MHz
 Three-level Program Memory Lock
 256 x 8-bit Internal RAM
 32 Programmable I/O Lines
 Three 16-bit Timer/Counters
 Eight interrupt sources

3.2.2 PIN DIAGRAM:

Figure: 3.1 pin diagram of 8051

11
www.final-yearproject.com

3.2.3 PIN DESCRIPTION:

VCC -Supply voltage.

GND-Ground

PORT 0-
Port 0 is an 8-bit open drain bidirectional I/O port.As an output port, each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as
highimpedance inputs

Port 0 can also be configured to be the multiplexed loworder address/data bus


during accesses to external program and data memory. In this mode, P0 has
internal pullups.Port 0 also receives the code bytes during Flash programming
and outputs the code bytes during program verification.External pull ups are
required during program verification.

PORT 1-
Port 1 is an 8-bit bidirectional I/O port with internal pullups.The Port 1 output
buffers can sink/source four TTL inputs.When 1s are written to Port 1 pins, they
are pulled high bythe internal pullups and can be used as inputs. As inputs,

12
www.final-yearproject.com

Port 1 pins that are externally being pulled low will source current (IIL) because of
the internal pullups.

PORT 2-

Port 2 is an 8-bit bidirectional I/O port with internal pullups.The Port 2 output
buffers can sink/source four TTL inputs.When 1s are written to Port 2 pins, they
are pulled high bythe internal pullups and can be used as inputs. As inputs,Port 2
pins that are externally being pulled low will sourcecurrent (IIL) because of the
internal pullups.Port 2 emits the high-order address byte during fetches from
external program memory and during accesses toexternal data memory that use 16-
bit addresses (MOVX @DPTR). In this application, Port 2 uses strong internal
pullupswhen emitting 1s. During accesses to external data memory that use 8-bit
addresses (MOVX @ RI), Port 2emits the contents of the P2 Special Function
Register.Port 2 also receives the high-order address bits and somecontrol signals
during Flash programming and verification.

PORT 3-

Port 3 is an 8-bit bidirectional I/O port with internal pullups.The Port 3 output
buffers can sink/source four TTL inputs.When 1s are written to Port 3 pins, they
are pulled high bythe internal pullups and can be used as inputs. As inputs,Port 3
pins that are externally being pulled low will sourcecurrent (IIL) because of the

13
www.final-yearproject.com

pullups.Port 3 also serves the functions of various special features of the


AT89C51, as shown in the following table.Port 3 also receives some control
signals for Flash programming and verification.

Table3.1 port 3 pin functions

Port Pin Alternate Functions


P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)

RST-
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.

ALE/PROG-

Address Latch Enable is an output pulse for latching the low byte of the address
14
www.final-yearproject.com

during accesses to external memory.This pin is also the program pulse input
(PROG) duringFlash programming.In normal operation, ALE is emitted at a
constant rate of 1/6the oscillator frequency and may be used for external timing
or clocking purposes. Note, however, that one ALE pulse is skipped during each
access to external data memory.If desired, ALE operation can be disabled by
setting bit 0 ofSFR location 8EH. With the bit set, ALE is active only during
a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting
the ALE-disable bit has noeffect if the microcontroller is in external execution
mode.

PSEN-
Program Store Enable is the read strobe to external program memory.When the
AT89C52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during
each access to external data memory.

EA/VPP-
External Access Enable. EA must be strapped to GND in order to enable the device
to fetch code from external program memory locations starting at 0000H up to
FFFFH.Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset.EA should be strapped to VCC for internal program executions.
This pin also receives the 12-volt programming enable voltage(VPP) during Flash
programming when 12-volt programming is selected.

15
www.final-yearproject.com

XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.

XTAL2
Output from the inverting oscillator amplifier.

Oscillator Characteristics

XTAL1 and XTAL2 are the input and output, respectively,of an inverting amplifier
that can be configured for use as an on-chip oscillator, as shown in Figure 7. Either
a quartz crystal or ceramic resonator may be used. To drive the device from an
external clock source, XTAL2 should be left unconnected while XTAL1 is driven,
There are no requirements on the duty cycle of the external clock signal, since the
input to the internal clocking circuitry is through a divide-by-two flip-flop, but
minimum and maximum voltage high and low time specifications must be

Figure: 3.2 oscillator circuit

16
www.final-yearproject.com

3.2.4 BLOCK DIAGRAM:

Figure:3.3 internal architechture of 8051

17
www.final-yearproject.com

3.3 MOTOR DRIVER:

The L293 is a quadruple high-current half-H driver designed to provide


bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. It is
designed to drive inductive loads such as relays,solenoids, dc and bipolar stepping
motors, as wellas other high-current/high-voltage loads in positive-supply
applications.All inputs are TTL compatible. Each output is a complete totem-pole
drive circuit with a Darlington transistor sink and a pseudo-Darlington source.
Drivers are enabled in pairs with drivers 1 and 2 enabled by 1,2EN and drivers 3
and 4 enabled by3,4EN. When an enable input is high, the associated drivers are
enabled and their outputs are active and in phase with their inputs. When the
enable input is low, those drivers are disabled and their outputs are off and in a
high-impedance state. With the proper data inputs, each pair of drivers form a full-
H (or bridge) reversible drive suitable for solenoid or motor applications.
External high-speed output clamp diodes should be used for inductive transient
suppression. AVCC1 terminal, separate from VCC2, is provided for the logic
inputs to minimize device power dissipation.The L293 is designed for operation
from 0°C

18
www.final-yearproject.com

TOP VIEW OF L293:

Figure : 3.4 top view of L293D

3.3.1 FEATURES:

 1-A Output Current Capability Per Driver


 Pulsed Current 2-A Driver
 Wide Supply Voltage Range: 4.5 V to 36 V
 Separate Input-Logic Supply
 NE Package Designed for Heat Sinking
 Thermal Shutdown
 Internal ESD Protection
 High-Noise-Immunity Inputs

19
www.final-yearproject.com

3.4 MOTOR:

A direct current (DC) motor is another widely used device that translates electrical
pulses into mechanical movement. In the DC motor we have only + and - leads.
Connecting them to a DC voltage source moves the motor in one direction. By
reversing the polarity, the DC motor will move in the opposite direction. One can
easily experiment with the DC motor. For example, small fans used in many
motherboards to cool the CPU are run by DC motors. By connecting their leads to
the + and - voltage source, the DC motor moves. While a stepper motor moves in
steps of 1 to 15 degrees, the DC motor moves continuously. In a stepper motor, if

20
www.final-yearproject.com

Figure:3.5 internal view of d.c motor

we know the starting position we can easily count the number of steps the motor
has moved and calculate the final position of the motor. This is not possible in a
DC motor. The maximum speed of a DC motor is indicated in rpm and is given in
the data sheet. The DC motor has two rpms: no-load and loaded. The
manufacturer's data sheet gives the no-load rpm. The no-load rpm can be from a
few thousand to tens of thousands. The rpm is reduced when moving a load and it
decreases as the load is increased. For example, a drill turning a screw has a much
lower rpm speed than when it is in the no-load situation. DC motors also have
voltage and current ratings. The nominal voltage is the voltage for that motor under
normal conditions, and can be from 1 to 150V, depending on the motor. As we
increase the voltage, the rpm goes up. The current rating is the current
consumption when the nominal voltage is applied with no load, and can be from

21
www.final-yearproject.com

25mA to a few amps. As the load increases, the rpm is decreased, unless the
current or voltage provided to the motor is increased, which in turn increases the
torque. With a fixed voltage, as the load increases, the current (power)
consumption of a DC motor is increased. If we overload the motor it will stall, and
that can damage the motor due to the heat generated by high current consumption.

3.4.1ADVANTAGES:

 Easy to understand design

 Easy to control speed

 Easy to control torque

 Simple ,cheap drive design

22
www.final-yearproject.com

CHAPTER-4

4.1 CIRCUIT DIAGRAM OF OBSTACLE AVOIDING ROBOT

Figure:4.1 circuit diagram of robot

23
www.final-yearproject.com

4.2 CIRCUIT LEVEL DESCRIPTION:

Basically the circuit consists of the following blocks:-

 Power supply
 Sensors
 Microcontroller AT89C52
 Motor driver
 Motors

Let us take the overview of each block one by one

POWER SUPPLY CIRCUIT-

In this project we are using a d.c power supply. The power supply for
Microcontroller and H driver ICs are regulated using ics

VOLTAGE REGULATOR:

A dc voltage regulator requires many components such as zener diode, transistors,


resistors & potentiometer etc. all these components were provided in a single
integrated circuit chip a722.it is a monolithic voltage regulator developed by fair
child semiconductor ltd. in 1868. an improved IC was then developed as 7805 by
fair child semiconductor & LM309 by national semiconductor. These IC are three
terminal fixed voltage regulator. This required an unregulated supply between
input and common terminal. It has in One popular line of regulators includes the
three-terminal LM78xx series shown here.The “xx” digits represent the output .

24
www.final-yearproject.com

Fig: 4.2 voltage regulator 7805

voltage, e.g.,7805 (5 V), 7806 (6 V), 7808 (8 V), 7810 (10 V), 7812(12 V), 7815
(15 V), 7818 (18 V), and 7824 (24 V).These devices can handle a maximum output
current of 1.5 A if properly heat-sunk. To remove unwanted input or output
spikes/noise, capacitors can be attached to the regulator’sinput and output

25
www.final-yearproject.com

terminals. A popular series of negative voltage-regulator IC is the LM79xx


regulators,

where “xx” represent the negative output voltage.These devices can handle a
maximum output current of 1.5 A. A number of different manufacturers make their
own kinds of voltage regulators.

SENSORS:-

The IR Transmitter block mainly used to generate IR signal. It uses timer IC555 in
astable multivibrator mode to generate square wave which have continuous pulses
of 50% duty cycle of frequency 38 KHz. This transmitter is so arranged that the IR
rays are focused on the sensor. IR sensor which gives normally 5v at output of it.
After receiving infrared light at output of sensor we get 0v.

MICROCONTROLLER AT89C52:

This is the most important block of the system. Microcontroller is the decision
making logical device which has its own memory, I/O ports, CPU and Clock

circuit embedded on a single chip.

26
www.final-yearproject.com

MOTOR DRIVER:

From microcontroller we can not connect a motor directly because microcontroller


can not give sufficient current to drive the DC motors. Motor driver is a current
enhancing device, it can also be act as Switching Device. Thus we insert motor
driver in between motor and microcontroller.Motor driver take the input signals
from microcontroller and generate corresponding output for motor.
L293D-
This is a motor driver IC that can drive two motor simultaneously.

Figure:4.3 pin details of L293d


27
www.final-yearproject.com

POINTS REGARDING L293D:

Supply voltage (Vss) is the Voltage at which we wish to drive the motor.
Generally we prefer 6V for dc motor and 6 to 12V for gear motor, depending upon
the rating of the motor.

Logical Supply Voltage will decide what value of input voltage should be
considered as high or low .So if we set Logical Supply Voltage equals to +5V,then
-0.3V to 1.5V will be considered as Input Low Voltage and 2.3 V to 5V will be
considered as Input High Voltage.
 L293D has 2 Channels .One channel is used for one motor.
Channel 1 - Pin 1 to 8
Channel 2 - Pin 9 to 16
 Enable Pin is use to enable or to make a channel active .Enable pin is also
called as Chip Inhibit Pin.
 All Input (Pin No. 2, 7,10and 15) of L293D IC is the output from
microcontroller .
 All Output (Pin No. 3, 6,11and 14) of L293D IC goes to the input of Right
and Left motor.

OUTPUT CONNECTIONS:
OUTPUT 1 (Pin No 3) --- Negative Terminal of Right Motor
OUTPUT 2 (Pin No 6) --- Positive Terminal of Right Motor
OUTPUT 3 (Pin No 10) --- Positive Terminal of Left Motor
OUTPUT 4 (Pin No 14) --- Negative Terminal of Left Motor
28
www.final-yearproject.com

For one motor:


Table4.1 motor movement

Positve Terminal Negative Terminal Motor Output

0 0 No Movement

Vss 0 Straight

0 Vss Reverse

Vss Vss No Movement

29
www.final-yearproject.com

One channel corresponds to one motor.


 Enable pin should be high for activating the corresponding channel. Input 1
corresponds to Output 1.
 If Enable 1=High (1)
Input1 =High (1), Output1=Vss
Input1 =Low (0), Output1=0
 If Enable 1=Low (0)
Input1 =High (1), Output1=0
Input1 =Low (0), Output1=0

Means if Enable pin low, the output will be at 0 always. If its high output
depend on input

MOTOR OUTPUT SYSTEM:


For moving a robot we have two dc motors attached to wheels gears.

WHY DC MOTORS:

DC motors are most easy to control. One dc motor requires only two signals for
its operation. If we want to change its direction just reverse the polarity of power
supply across it. We can vary speed by varying the voltage across motor.
WHY TWO MOTORS:

By using two motors we can move our robot in any direction. This steering
mechanism of robot is called as differential drive.

30
www.final-yearproject.com

Figure: 4.4 description of various parts:

Figure:4.5 Different Types of Movement of Robot


31
www.final-yearproject.com

Table4.2 robot movement

Left Motor Right Motor Robot Movement


Straight Straight Straight
Stop Straight Left
Reverse Straight Sharp Left
Straight Stop Right
Straight Reverse Sharp right
Reverse Reverse Reverse

32
www.final-yearproject.com

CHAPTER-4
PROGRAMMING OF OBSTACLE AVOIDING ROBOT
org 000

clr a

mov p0,a

mov p2,a

mov p3,a

mov a,#0ffh

mov p1,a

main:

clr a

mov r6,a

mov r7,a

jmp k2

k2: mov a,r7

call find

k8: mov a,r6

call find13

jnb p1.0,loop1

jnb p1.1,loop2

jmp k2

33
www.final-yearproject.com

loop1:

jnb p1.0,$

call delay

mov p3,#0ffh

inc r7

jmp k2

loop2:jnb p1.1,$

call delay

CJNE R7,#01,AAS21

AAS21:

jc k2

nop

dec r7

mov a,r7

cjne a,#00h,k2

mov a,r6

cjne r6,#00h,k9

mov p3,#00h

jmp k2

jmp k2

34
www.final-yearproject.com

k9: mov r7,#09

dec r6

jmp k8

find: cjne a,# 00,find1

mov p2,#0C0h

ret

find1: cjne a,# 01,find2

mov p2,#0F9h

mov p3,#0ffh

ret

find2: cjne a,# 02,find3

mov p2,#0A4h

mov p3,#0ffh

ret

find3: cjne a,# 03,find4

mov p2,#0B0h

mov p3,#0ffh

ret

find4: cjne a,# 04,find5

mov p2,#99h

mov p3,#0ffh

ret

35
www.final-yearproject.com

find5: cjne a,# 05,find6

mov p2,#92h

mov p3,#0ffh

ret

find6: cjne a,# 06,find7

mov p2,#82h

mov p3,#0ffh

ret

find7: cjne a,# 07,find8

mov p2,#0F8h

mov p3,#0ffh

ret

find8: cjne a,# 08,find9

mov p2,#80h

mov p3,#0ffh

ret

find9: cjne a,# 09,find10

mov p2,#90h

mov p3,#0ffh

ret

find10: cjne a,# 10,find11

mov r7,#00h

36
www.final-yearproject.com

mov p3,#0ffh

inc r6

MOV A,R6

CJNE A ,#10,FIND12

mov r6,#00h

mov r7,#00h

jmp k2

find11: jmp k2

find12: jmp k2

find13: cjne a,# 00,find14

mov p0,#0C0h

ret

find14: cjne a,# 01,find15

mov p0,#0F9h

mov p3,#0ffh

ret

find15: cjne a,# 02,find16

mov p0,#0A4h

mov p3,#0ffh

ret

37
www.final-yearproject.com

find16: cjne a,# 03,find17

mov p0,#0B0h

mov p3,#0ffh

ret

find17: cjne a,# 04,find18

mov p0,#99h

mov p3,#0ffh

ret

find18: cjne a,# 05,find19

mov p0,#92h

mov p3,#0ffh

ret

find19: cjne a,# 06,find20

mov p0,#82h

mov p3,#0ffh

ret

find20: cjne a,# 07,find21

mov p0,#0F8h

mov p3,#0ffh

ret

38
www.final-yearproject.com

find21: cjne a,# 08,find22

mov p0,#80h

mov p3,#0ffh

ret

find22: cjne a,# 09,find23

mov p0,#90h

mov p3,#0ffh

ret

find23: cjne a,# 10,find24

mov r7,#00h

inc r6

MOV A,R6

CJNE A ,#10,FIND25

mov r6,#00h

mov r7,#00h

jmp k2

find24: jmp k2

find25: jmp k2

39
www.final-yearproject.com

delay: mov r0, #255

i2: mov r1, #255

i1: djnz r1, i1

djnz r0, i2

ret

end

40
www.final-yearproject.com

CONCLUSION

The project is “obstacle detection and the avoidance robot” is practically proved by
using the IR pairs for sensing the robot, h bridge for the driving the dc motor, dc
motor isused for the movement of the robot with the help of the micro controller.

41
www.final-yearproject.com

BIBILIOGRAPHY

TEXT BOOKS:
 8051 Microcontroller And Embedded System by” Mazidi”
 8051 Microcontroller by “K.J. Ayala”

WEBSITES:
htttp://www.datasheet4u.com
http://www.final-yearproject.com
http://www.extremeelectronics.co.in

42

You might also like