Obstacle Detection Robot Using 8051 Microcontroller: Palaparthi Abhijith
Obstacle Detection Robot Using 8051 Microcontroller: Palaparthi Abhijith
Obstacle Detection Robot Using 8051 Microcontroller: Palaparthi Abhijith
BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION ENGINEERING
Submitted By
PALAPARTHI ABHIJITH
(17131A04G4)
Under the Guidance of
Sri P. SRINU
Assistant Professor Dept. of E.C.E.
COLLEGE OF ENGINEERING
(AUTONOMOUS)
Accreditedby NBA & NAAC with “A” Grade with CGPA 3.47/4.00
COLLEGE OF ENGINEERING
(AUTONOMOUS)
CERTIFICATE
This is to certify that the mini project entitled ‘ OBSTACLE DETECTION ROBOT USING 8051
MICROCONTROLLER’ is a Bona fide record of work done by PALAPARTHI ABHIJITH
(Regd.no.17131A04G4) to the Department of Electronics and Communication Engineering, Gayatri
Vidya Parishad College of Engineering (Autonomous),Visakhapatnam, affiliated to Jawaharlal
Nehru Technological University, Kakinada in partial fulfilment of the requirement for the award
of the degree of Bachelor of Technology in electronics and communication engineering during
the academic year 2020-21.
BY
PALAPARTHI ABHIJITH
ABSTRACT
An industrial robotics is an automatic, servo-controlled, freely
programable, multipurpose manipulator which is used for handling
the work pieces, tools and also several handling devices. A robot can
also determine its own behaviour and conduct through its functions
of sense and recognition.
The Obstacle Avoiding Robot using 8051 microcontroller Project is
the foundation level of any automatic robot. The technology has
enough conceptual to include the great field of given area. This
includes using infrared rays that are applied to identify the hurdles
which comes in the field of ROBOTICS. The manufacturing of the
circuit ROBOT is simple and easy to construct.
The zero voltage is seen and hence the microcontroller concludes to
ignore the hurdles by turning from left to right or vice versa. When
the sensor produces +5v to microcontroller it ensures that there are
no hurdles found in the way and hence it moves straight unless and
until any hurdle is found.
CONTENTS
CERTIFICATE
ACKNOWKEDGEMENT
ABSTRACT
1. INTRODUCTION--------------------------------------------------------------------------------------1
1.1 OVERVIEW---------------------------------------------------------------------------------------------1
1.2 WORKING OF OBSTACLE DETECTION--------------------------------------------------------1
1.3 HISTORY OF 8051 MICROCONTROLLER------------------------------------------------------2
2. USED SOFT WARES----------------------------------------------------------------------------------2
2.1 KEILUVISION 4----------------------------------------------------------------------------------------2
2.2 PROTEUS 8----------------------------------------------------------------------------------------------3
3.DESCRIPTION OF BLOCK DIAGRAM--------------------------------------------------------------4
4. CONCEPT OF PROJECT--------------------------------------------------------------------------------4
5. DESCRIPTION OF CIRCUIT DIAGRAM-----------------------------------------------------------5
6. COMPONENTS DESCRIPTION-----------------------------------------------------------------------6
6.1 8051 MICROCONTROLLERS------------------------------------------------------------------------6
6.2 LCD DISPLAY-----------------------------------------------------------------------------------------10
6.3 INFRARED SENSOR---------------------------------------------------------------------------------11
7. SYSTEM IMPLEMENTATION----------------------------------------------------------------------12
7.1 SOFTWARE DESIGN--------------------------------------------------------------------------------12
7.2 SOFTWARE DEVELOPMENT---------------------------------------------------------------------12
7.3 DEVELOPMENT PROCESS------------------------------------------------------------------------14
7.4 CHOICE OF PROGRAMMING LANGUAGE---------------------------------------------------14
7.5 COMPILING AND LINKING-----------------------------------------------------------------------14
7.6 PROGRAM---------------------------------------------------------------------------------------------14
8. METHODOLOGY--------------------------------------------------------------------------------------18
8.1 PROCEDURE FOR SIMULATION----------------------------------------------------------------18
8.2 OPERATION OF THE CIRCUIT-------------------------------------------------------------------18
9. ADVANTAGES-----------------------------------------------------------------------------------------19
10. DIS ADVANTAGES---------------------------------------------------------------------------------19
11. SIMULATION RESULTS---------------------------------------------------------------------------19
12. APPLICATIONS--------------------------------------------------------------------------------------20
13. CONCLUSION--------------------------------------------------------------------------------------21
14. FUTURE SCOPE------------------------------------------------------------------------------------21
15. REFERENCES---------------------------------------------------------------------------------------21
FIGNO FIGURE CAPTION PAGE NO
3.1 BLOCK DIAGRAM OF OBSTACLE DETECTOR 4
1.1 OVERVIEW
Robotics is a branch of science that deals with mechanical, electrical and
software fields. Robots are the machines that are used in our day to day life
to reduce men power and work accurately without any distortions. Robots
are classified into two sections based upon their skills as automated and
manual, automated robot recognizes the obstacle in its path and moves in
obstacle free path.
Whenever the robot is going on the desired path the ultrasonic sensor
transmits the ultrasonic waves continuously from its sensor head. Whenever
an obstacle comes ahead of it the ultrasonic waves are reflected from an
object and that information is passed to the microcontroller. The
microcontroller controls the motors left, right, back, front, based on ultrasonic
signals. To control the speed of each motor pulse width modulation is used.
1|Page
1.3 HISTORY OF 8051 MICROCONTROLLER
A highly integrated chip that contains all the components comprises a
controller. Typically this includes a CPU, RAM, some form of ROM, I/O
ports, and timers. Unlike a general purpose computer, which also includes
all of these components, a microcontroller is designed for a very specific
task; to control a particular system. As a result, the parts can be simplified
and reduced, which cuts down on production costs. Microcontrollers are
sometimes called embedded microcontrollers. This just means that they
are part of anembedded system; that is, one part of a larger device or
system. Microcontrollers are used in automatically controlled products and
devices, such as automobile engine control systems, implantable medical
devices, remote controls, office machines, appliances, power tools, toys and
other embedded systems. The first integrated circuit was developed by Jack
Kilby of Texas Instruments and Robert Noyce of Fairchild Semiconductor
in 1950.
2. USED SOFTWARES
2.1 KEIL uVERSION4
Keil is a German software subsidiary of Arm Holdings. It was founded in
1982 by Gü nter and Reinhard Keil, initially as a German GbR. In April 1985
the company was converted to Keil Elektronik GmbH to market add-on
products for the development tools provided by many of the silicon
vendors. Keil implemented the first C compiler designed from the ground-
up specifically for the 8051 microcontroller.
It's a free software which solves many of the pain points for an embedded
program developer. This software is an integrated development
environment (IDE), which integrated a text editor to write programs, a
compiler and it will convert your source code to hex files too.
Here is simple guide to start working with Keil vision which can be used for
Debugging program
2.2 PROTEUS 8
The first version of what is now the Proteus Design Suite was called PC-B
and was written by the company chairman, John Jameson, for DOS in 1988.
Schematic Capture support followed in 1990, with a port to the Windows
environment shortly thereafter. Mixed mode SPICE Simulation was first
integrated into Proteus in 1996 and microcontroller simulation then
arrived in Proteus in 1998. Shape based auto routing was added in 2002
and 2006 saw another major product update with 3D Board Visualisation.
More recently, a dedicated IDE for simulation was added in 2011 and MCAD
import/export was included in 2015. Support for high-speed design was added
in 2017. Feature led product releases are typically biannual, while
maintenance-based service packs are released as it is required.
5. CIRCUIT DIAGRAM
The emitter is simply an IR LED which is called as Light Emitting Diode and the
detector is simply an IR photodiode. Photodiode is sensitive to IR light of the
same wave length which is emitted by the IR LED. When the IR light falls on the
photodiode, the resistances and the output voltages will change in proportion
to the magnitude of the IR light received.
The other common packaging type is 44 – Lead PLCC (Plastic Leaded Chip
Carrier). It is a kind of surface mount package.
Pins 1 – 8 (PORT 1):Pins 1 to 8 are the PORT 1 Pins of 8051. PORT 1 Pins
consists of 8 – bit bidirectional Input / Output Port with internal pull – up
resistors. In older 8051 Microcontrollers, PORT 1 doesn’t serve any
additional purpose but just 8 – bit I/O PORT.
In some of the newer 8051 Microcontrollers, few PORT 1 Pins have
dual functions. P1.0 and P1.1 act as Timer 2 and Timer 2 Trigger Input
respectively.P1.5, P1.6 and P1.7 act as In-System Programming Pins i.e.,
MOSI, MISO and SCK respectively.
Pin 9 (RST):Pin 9 is the Reset Input Pin. It is an active HIGH Pin i.e. if the
RST Pin is HIGH for a minimum of two machine cycles, the microcontroller
will be reset. During this time, the oscillator must be running.
Pins 18 & 19: Pins 18 and 19 i.e. XTAL 2 and XTAL 1 are the pins for
connecting external oscillator. Generally, a Quartz Crystal Oscillator is
connected here.
Pin 29 (PSEN):Pin 29 is the Program Store Enable Pin (PSEN). Using this
pins, external Program Memory can be read.
Pin 30 (ALE/PROG):Pin 30 is the Address Latch Enable Pin. Using this
Pins, external address can be separated from data (as they are multiplexed
by 8051).During Flash Programming, this pin acts as program pulse input
(PROG).
Pin 31 (EA/VPP):Pin 31 is the External Access Enable Pin i.e., allows
external Program Memory. Code from external program memory can be
fetched only if this pin is LOW. For normal operations, this pin is pulled
HIGH.
Pin 40 (VCC): Pin 40 is the power supply pin to which the supply voltage is
given (+5V).
Liquid crystal displays (LCD) use the properties of liquid crystal for
displaying. LCD will not emit the light directly. These LED’s or LCD are used
to display the required numeral or alphabet. Single seven segment or
number of segments arranged in an order meets our requirements.
This is kind of word processing that is used. After keying in the used in
programs code using the input device and the programs is display on the
VDU, the text edition can be used to check and correct errors in
thprograms. In a nutshell, the text edition is used to edit the programs
after it has been written.
TRANSLATOR:
There are two types of translators, assembler, interpreter and compiler. An
assembler translates assembly language in the form of ammonic (memory
aids) into machine code. A good feature of assembler is creating a list that
shows the machine code and the assembly language of the programs side
by side. A compiler on the other hand translates a 54 high-level language
into machine code. An interpreter reads the source code of our programs
one line at a time and performs the specification instructions contained in
that line.
LINKER/LOCATOR:
This is used to join the different modules that make up the programs
together in the correct sequence and this is to be bound to addresses. The
linker/locator pair works together to co-ordinate between the separate
modules for smooth programs execution.
LOADER:
TESTING:
After the programs is written, it was tested, this involve executing the
programs with selected input called test cases, the result whether or not
the program is functioning as desired.
DEBUGGING:
In writing the software for this project, a modular approach was employed.
This made it easier to check for errors and debug the program. Three
majortools were used in the development process; the C51 compiler was
used to translate from the source code into the object code. The SDCPP was
employed to link the program while the PACKIHX did the conversion from
binary to hexadecimal.
sbit rs=p3^4;
sbit rw=p3^5;
sbit en=p3^7;
sbit mot1p=p3^0;
sbit mot1n=p3^1;
sbit mot2p=p3^2;
sbit mot2n=p3^3;
//Driver ic inputs//
sbit sensor=p1^0;
sbit buzz=p1^1;
void lcdinit();
void delay();
void main();
mot1p=mot1n=mot2p=mot2n=0; buz=0;
lcdinit();
lcddis("OBSTACLE DETECTION");
lcdcmd(0xc0); lcddis("
ROBOT ")
delay();delay();delay();delay();
delay();delay();delay();delay();
delay();delay();delay();delay();
while(1)
lcdcmd(0x01);
lcddis("ROBOT IS MOVING");
mot1p=mot1n=mot2p=mot2n=0; buz=1;
lcdcmd(0x01); lcddis("OBSTACLE
DETECTED");
while(sensor==1);
void lcdinit()
lcdcmd(0x38);
lcdcmd(0x10);
lcdcmd(0x06);
lcdcmd(0x0c);
lcdcmd(0x80);
='\0';w++)
{
lcddat(s[w]);
p2=val;
rs=1;
rw=0;
en=1;
delay();
en=0;
p2=val;
rs=0;
rw=0;
en=1;
delay();
en=0;
void delay()
{
unsigned int v; for(v=0;v<3000;v+
+);
8. METHODOLOGY
If logic pin is zero, then motors move in forward direction then LCD
displays “ROBOT IS MOVING”.
If logic pin is one, then motors stop moving then LCD displays
“OBSTACLE DETECTED”.
Again logic pin changes to zero then motor starts moving in forward
direction and LCD displays “ROBOT IS MOVING”, like this the
operation continues.
9. ADVANTAGES
Whenever robot senses any obstacle automatically diverts its
position to left or right and follows the path without humans
guidance.
10. DISADVANTAGES
It is time consuming project.
It is use for short distances only.
It is not recommended to keep the range very long because this
would cause the ROBOT to keep moving forward and backward as it
senses any obstacle, even far away from it.
If the user entered the logic one pin, then motors stops moving and LCD
displays as
12 APPLICATIONS
Obstacle detection robot can be applied at the toys where small
children will play.
The modification of this logic has been specially designed for vacuum
cleaner.
14 FUTURE SCOPE
15 REFERENCES
[1] “8051 and embedded system” by Mazidi and
[2] www.keil.com