Professional Documents
Culture Documents
Certificate
by
CMERI, Durgapur.
Shri S. K. Das
Dr S. N. Shome
Scientist
Scientist
Robotics and Automation
Group Head & DU Head
Laboratory
ACKNOWLEDGEMENT
We will also like to thank Dr.S.N.Shome, Scientist G and Group head who
offered us the opportunity to carry out our training at Robotics and
Automation Lab under the supervision of Shri S.K.Das Scientist-C. We
acknowledge our indebtedness to Shri S.K.Das for providing his esteemed
guidance and substantial guidance to our Final Year Project.
Mr. A. Basu Adhikari (JRF) of CMERI and Mr. Biplap CMERI, Durgapur,
Mr. Jyotirmaya Karmkar and Mr. Sonatan Dutta need a distinct mention
here, because without there perpetual efforts to systematize our work it
wouldn‟t have been possible to complete the project on time.
We are also greatly indebted to our college for making provisions for the
arrangement of our summer training at such a reputed organization of
CMERI.
Supriya
Aatreyee Sarkar
Dipu Kumari
Mukund Bihari
Contents
1. Summary 6
2. Overview 7
3. Flowchart 9
4. Components used
Microcontroller AT89C52 11
Voltage comparator 23
Motor driver 25
Variable resistance 28
IR sensors 29
Crystal oscillator 32
Voltage regulator 34
Other components 35
DC motor 38
Robotic wheel 39
Vehicle Base 39
5. Circuit Implementation
Voltage comparator 41
AT89C52 circuit 44
Motor Driver circuit 47
Voltage Regulator 50
6. Microcontroller programing
C program 52
ALL100 61
Screen shots of program loading 62
9. Possible Improvements 77
SUMMARY
The main objective of this project is to design a obstacle detection and
collision avoidance robot with help IR sensors embedded around the body
of robotic vehicle.This design can be used in fully automated vehicles like
cars etc , moving materials in industries fom one to another place and
similar other commercial application.
Starting with an overview of the system the document would cover
implementation details like components used ,circuits and algorithms,
problems faced during designing of the obstacle detection and collision
avoidance robot .
It has also been described that how the microcontroller program has been
embedded in the microcontroller with help of a burner device.
The „Reference and Resources‟ page has a list of relevant books, websites,
electronic shops and commonly used parts & their prices.
Prerequisites:
Knowledge of electronics devices and circuits and microcontroller.
Knowledge of circuit design.
Knowledge of Keilμvision 3.
Knowledge of ALL 100 program burner.
OVERVIEW
The robot uses four IR sensors to sense any obstacle in between its
path.The data coming out from those sensors are fed into voltage
comparators where the sensor data is compared with a fixed reference
voltage.After the comparision of sensor data nad the Vref the volatge
comparator gives output as 0V for presence of any obstacle and
The output of microcontroller is fed into the motor driver circuit which
ampifies the low output current coming from microcontroller so that its
output becomes capable to drive the DC motors fitted in the robotic vehicle
base.
FLOWCHART
COMPONENTS USED
Microcontroller(AT89C52)
Voltage Comparator(LM311P)
Motor Driver(L293D)
Variable Resistance
IR Sensor(GP2D12)
Crystal Oscillator(ML 11.0592)
Voltage Regulator(LM7805)
Other Components
IC Base
Vero Board
Wire Connectors
DC Motor
Robotic Wheel
Vehicle Base
MICROCONTROLLER
(AT89C52 24PI)
The AT89C52 is a low-power, high-performance CMOS 8-bit
microcomputer with 8 Kbytes of Flash programmable and erasable read
only memory (PEROM). The device is manufactured using Atmel‟s high
density nonvolatile memory technology and is compatible with the industry
standard 80C51 and 80C52 instruction set and pinout.
AT89C51 24PI
Pin Description
VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 also receives the code bytes during Flash programming and
outputs the code bytes during program verification. External pullups
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 by the internal pullups
and can be used as inputs. As inputs, Port 1 pins that are externally
being pulled low will source current (IIL) because of the internal
pullups.
Port 2
The Port 2 output buffers can sink/source four TTL inputs. When 1s
are written to Port 2 pins, they are pulled high by the internal pullups
and can be used as inputs. As inputs, Port 2 pins that are externally
being pulled low will source current (IIL) because of the internal
pullups.
Port 2 emits the high-order address byte during fetches from external
program memory and during accesses to external data memory that
uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2
uses strong internal pullups when emitting 1s. During accesses to
external data memory that uses 8-bit addresses (MOVX @ RI); Port 2
emits the contents of the P2 Special Function Register.
Port 2 also receives the high-order address bits and some control
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 by the internal pullups
and can be used as inputs. As inputs, Port 3 pins that are externally
being pulled low will source current (IIL) because of the pullups.
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 during accesses to external memory.This pin is also the program
pulse input (PROG) during Flash programming.
PSEN
EA/VPP
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
Interrupts
The AT89C52 has a total of six interrupt vectors: two external interrupts
(INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial
port interrupt. These interrupts are all shown in Figure below. Each of these
interrupt sources can be individually enabled or disabled by setting or
clearing a bit in Special Function Register IE. IE also contains a global
disable bit, EA, which disables all interrupts at once. Note that Table below
shows that bit position IE.6 is unimplemented. In the AT89C51, bit position
IE.5 is also unimplemented. User software should not write 1s to these bit
positions, since they may be used in future AT89 products. Timer 2
interrupt is generated by the logical OR of bits TF2 and EXF2 in register
T2CON. Neither of these flags is cleared by hardware when the service
routine is vectored to. In fact, the service routine may have to determine
Whether it was TF2 or EXF2 that generated the interrupt, and that bit will
have to be cleared in software.
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 below. 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, as shown in Figure below. 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
observed.
Crystal Oscillator
VOLTAGE COMPARATOR
(LM311P)
The LM311 are single high-speed voltage comparators. These devices are
designed to operate from a wide range of power-supply voltages, including
15-V supplies for operational amplifiers and 5-V supplies for logic
systems. The output levels are compatible with most TTL and MOS circuits.
These comparators are capable of driving lamps or relays and switching
voltages up to 50 V at 50 mA. All inputs and outputs can be isolated from
system ground. The outputs can drive loads referenced to ground, VCC+ or
VCC–. Offset balancing and strobe capabilities are available, and the
outputs can be wire-OR connected. If the strobe is low, the output is in the
off state, regardless of the differential input.
MOTOR DRIVER
(L293D)
BLOCK DIAGRAM
Specifications
Applications
PIN CONFIGURATION
VARIABLE RESISTANCE
Variable resistors consist of a resistance track with connections at both
ends and a wiper which moves along the track as you turn the spindle. The
track may be made from carbon, cermet (ceramic and metal mixture) or a
coil of wire (for low resistances). The track is usually rotary but straight
track versions, usually called sliders, are also available.
Variable resisitance
IR SENSORS
(GP2D12)
General Description
The Sharp GP2D12 is an analog distance sensor that uses infrared to
detect an object between 10 cmand 80 cm away. The GP2D12 provides a
non-linear voltage output in relation to the distance an objectis from the
sensor and interfaces easily using any analog to digital converter.
Features
• High immunity to ambient light and color of object
• No external control circuitry required
DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 30
mukundbihari.blogspot.com 2010
GP2D12
The angles in this triangle vary based on the distance to the object. The
receiver portion of these new detectors is actually a precision lens that
transmits the reflected light onto various portions of the enclosed linear
CCD array based on the angle of the triangle described above. The CCD
array can then determine what angle the reflected light came back at and
therefore, it can calculate the distance to the object.
CRYSTAL OSCILLATOR
(ML 11.0592)
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 below. 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, as shown in Figure below. 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
observed.
Crystal oscillator
Why two 33pF capacitors are used with crystal oscillator in 89C52
microcontroller?
Usually, crystal is between two pins of the CPU, and two caps of 33 pF are
mounted from these pins to the ground.
The purpose is to "dephase" the crystal signal to provide a lead/lag to the
buffers inside the CPU and allows the oscillation! (The oscillator is a feed-
back loop around a buffer: you need input/output OUT OF PHASE to
maintain oscillation. The caps shift the phase, while the Xtal maintains the
frequency).
VOLTAGE REGULATOR
(LM7805)
The LM78M05, a three-terminal positive voltage regulator employ built-in
current limiting, thermal shutdown, and safe-operating area protection
which makes them virtually immune to damage from output overloads.
Features
• Output current in excess of 0.5A
• No external components
• Internal thermal overload protection
• Output voltages of 5V
OTHER COMPONENTS
RESISTORS
10 kΩ
8.2 kΩ
330 kΩ
CAPACITORS
10 µF
330 µF
0.1 µF
33 pF
DIODES
1N4007
IC BASE
40 pin
16 pin
40 pin 16pin
VERO BOARD
Stripboard is a widely-used type of
electronics prototyping board
characterized by a 0.1 inch (2.54
mm) regular (rectangular) grid of
holes, with wide parallel strips of
copper cladding running in one
direction all the way across one side
of the board. It is usually known by
the name Veroboard, which is a
trademark, in the UK, of British
company Vero Technologies Ltd, who
invented this kind of board.
WIRE CONNECTORS
8 pin
4 pin
2 pin
ROBOTIC WHEEL
Two types of wheel
have been used:
Main
wheel(Front)
Support
wheel(Rear)
VEHICLE BASE
It is made up of light weight material alumunium which provides easy
movement of the robotic vehicle. It has folowing provisions in it:
CIRCUIT IMPLEMENTATION
AT89C52 circuit
Voltage comparator
Motor Driver circuit
Voltage Regulator
Lower the value of reference voltage is set ,greater will be the sensing distance
of sensors.
Vref α OF OBSTACLE
DESIGN Sensing distance
DETECTION ofAVOIDANCE
AND COLLISION sensor ROBOT 43
mukundbihari.blogspot.com 2010
Vref is fed into pin no. 2 and the sensor input is fed into pin 3 of the LM311P
IC.Pin no. 1 and 4 si shorted and connected with ground. Vcc (5V) is
connected with pin no. 8 of the comparator .Pin no.7 and 8 are shorted
through 330 kΩ resistor.But here we have used resistor of value of about
400kΩ.Pin no. 5 and 6 do not have any connection.
MICROCONTROLLER CIRCUIT
AT89C52
AT 89C52
Pin 2.0
Pin 2.1
} MOTOTR 1
Pin 2.2
Pin 2.3
} MOTOTR 2
MOTOR DRIVER
L293D
L293D motor driver needs two voltage levels :
The main function of driver is to amplify the 15mA current, coming from the
microcontroller which is incpable to drive 50mA rating motor.It can give
output current upto 600mA.
The driver circuit basically consists two H-bridges for driving small DC
motors.In a H-bridge circuit ther are four transistors of which only two are in
ON state which are located diagonally.The two pair of transistors gives us
the bidirectional rotation of motor.
VOLTAGE REGULATOR
Voltage Regulator is needed as because we have different voltage level
requirement in different components.e.g.Our motor requires 12v supply but
circiuts like microcontroller board and voltage comparator requires only 5 V
suply.
MICROCONTROLLER PROGRAMMING
Microcontroller
program has been
done usinng the
software µvision 3
keil.This software
provides Keil C51
Compiler to compile
program.It converts
C program into Hex
format , Binary
format nad asm
format.
C PROGRAM
#include<reg52.h>
void main ()
while(1)
if(irinf==1&&((irinr==1&&irinl==1)||(irinr==1&&irinl==0)||(irinr==0&&irinl
==1)||
(irinr==0&&irinl==0)||(irinb==1||irinb==0)))
outlp = 1;
outln = 0;
outrp = 0;
outrn = 1;
MSdelay(250);
DESIGN OF OBSTACLE DETECTION AND COLLISION AVOIDANCE ROBOT 57
mukundbihari.blogspot.com 2010
else if(irinf==0&&((irinr==1&&irinl==1)||(irinr==0&&irinl==0)))
outlp =1;
outln =0;
outrp =0;
outrn =0;
MSdelay(250);
outlp =0;
outln =0;
outrp =0;
outrn =1;
MSdelay(250);
outlp =0;
outln =1;
outrp =1;
outrn =0;
MSdelay(250);
else if(irinf
==0&&irinl==0&&irinr==0&&irinb==0) //both motor OFF and vehicle stops//
outlp =0;
outln =0;
outrp =0;
outrn =0;
MSdelay(250);
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
STEP 5: Checking of IC
Syntax
P1 = 1;
VOLTRAGE DROP OF 2V
This was the greatest problem ever we faced in our project.We faced lots of
difficulty to debug the problem of 2V votage drop when the all the circuits
were interconnected with each other.We checked our whole circuit twice
and thrice but we were unable to find the error.Finally after long manoeuvre
the fault was detected in the comaprator circuit.There was a short circuit in
the comaprator circuit between the fist sensor input male connector pin and
first comparator output male connector pin.
We observed that when power supply was given continuosly for more than
6 to 7 mins. LM7805 got heated upto undesirabel level enough to burn
human skin.To overcome this excessive heat we incorporated alumunium
heat sink with both the LM7805 ICs.
Possible Improvements
Use of differential steering with gradual change in wheel
speeds.
Use of Hysteresis in sensor circuit using LM339
Increment in number of sensors to enhance the obstacle
detection capibilty
Incorporation of a camera whose data can be sending
through wirless tehnology to a fixed station.
Incorporation of robotic hand to remove the obstacle in
case there is no way for the movement of the robot.
General improvements like using a low dropout voltage
regulator, lighter chassis etc.
http://www.letsmakerobots.com
http://www.acronamerobotics.com
http://www.ti.com
http://www.st.com
TOOLS
µVision keil 3
ALL 100 IC program burner
Drill machine for drilling holes in vero board
File to adjust the motors in chassis
SHOPS
Gemini radio , Chandni Chowk , Kolkata
Reliance Electronics , Asansol
THE END