Dualmode Obstacle Avoidance Robot Content

You might also like

You are on page 1of 44

1

DUAL MODE OBSTACLE AVOIDANCE ROBOT

1. INTRODUCTION

In today’s world robotics is fast growing and interesting field. It is simplest way
for latest technology modification. So we decided to work on robotics field, and design
something which will make human life simpler in day today aspect. Real-time obstacle
avoidance is one of the key issues to successful applications of mobile robot systems. All
mobile robots feature some kind of collision avoidance, ranging from primitive algorithms
that detect an obstacle and steer the robot short of it in order to avoid a collision, through
sophisticated algorithms, that enable the robot to detour obstacles. The latter algorithms are
much more complex, since they involve not only the detection of an obstacle, but also take
appropriate decision concerning movement. Once these have been determined, the obstacle
avoidance algorithm needs to steer the robot around the obstacle and resume motion toward
the original target. The inspiration behind this project was to learn new things regarding our
domain. We wanted to do a project that was creative and practical but at the same time cost
effective... The main objectives of this project are;

i. To design a Mobile Robot with an ability to avoid obstacle


ii. To develop a mobile robot using PIC microcontroller and infrared sensor

This particular robotic device is a combination of both mechanical and electronics


engineering. This system is made so that it can be used to detect and avoid obstacles
successfully. This robot will be just like an electronic car in automatic mode that keeps on
moving in straight line until something comes in its path that’s when it decides to turns into
some other direction so it successfully avoids the obstacle. We have used two dc gear motors
to give motion to the robot. Motor driver IC’s are used for driving this dc motors in both
directions. The robot has an onboard infrared sensor module to detect the obstacles. The main
controller of the robot is implemented in a PIC microcontroller. The algorithms runs on the
PIC microcontroller based on the information received from the remote control and
information from the infrared sensors. A RF-based remote control is used to control the
manual mode and automatic mode functions of the robot. The base chosen for this robot is
metallic with three wheels. The electronic parts used in the robot circuits are easily available
and cheap too.

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


2
DUAL MODE OBSTACLE AVOIDANCE ROBOT

2. BLOCK DIAGRAM

2.1. REMOTE CONTROLE

2.2. ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


3
DUAL MODE OBSTACLE AVOIDANCE ROBOT

3. BLOCK DIAGRAM DESCRIPTION


The block diagram for remote control consists of switches, HT12 encoder and RF
transmitter. Micro switches are used for inputting the binary values to HT12 encoder which
converts parallel data’s in to serial data. The output from the HT12encoder is transmitted
using RF transmitter which uses ASK transmission method. The robotic bloc diagram consists
of RF reciver, HT12 decoder, PIC microcontroller, IR sensor, motor driver and two dc gear
motors. The RF receiver output is converted to parallel output using HT12 decoder. Which is
inputted to the microcontroller also microcontroller receive input from the IR sesors.The
program runs inside the microcontroller based on the obstacle avoidance algorithm
converts these inputs into output to drive the motors in the appropriate direction with the
help of motor diver IC’s.The detailed explanation of each block is given below.

3.1. PIC MICROCONTROLLER


We have selected PIC microcontroller based on the following factors:-

 Availability of IC burner

IC burner for PIC16F877A was available in our hand.

 Availability of software development tool.

The software we are used is MPLABIDE and HI-TECH PIC compiler

 I/O ports

5 I/O ports were available for PIC16F877A.

Also factors like speed, availability, in built ADC, cost of microcontroller and technical
support available is leaded us to select PIC16F877A.

PIC is a family of modified Harvard architecture microcontrollers made by


Microchip Technology, derived from the PIC1650 [1] [2] [3] originally developed by General
Instrument's Microelectronics Division. The name PIC initially referred to "Peripheral
Interface Controller".

Microcontroller PIC16F877A is one of the PIC Family microcontroller which is


popular at this moment, start from beginner until all professionals. Because PIC16F877A

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


4
DUAL MODE OBSTACLE AVOIDANCE ROBOT

have flash memory technology so that can be write-erase until thousand times. The
superiority this RISC Microcontroller compared to with other microcontroller 8-bit especially
at a speed of and his code compression. PIC16F877A have 40 pin by 33 path of
I/O.PIC16F877A perfectly fits many uses, from automotive industries and controlling home
appliances to industrial instruments, remote sensors, electrical door locks and safety devices.
It is also ideal for smart cards as well as for battery supplied devices because of its low
consumption

High-Performance RISC CPU has features like Only 35 single-word instructions


to learn ,All single-cycle instructions except for program branches, which are two-cycle,
Operating speed as DC – 20 MHz clock input DC – 200 ns instruction cycle ,Up to 8K x 14
words of Flash Program Memory, Up to 368 x 8 bytes of Data Memory (RAM), Up to 256 x
8 bytes of EEPROM Data Memory and Pin out compatible to other 28-pin or 40/44-pin
PIC16CXXX and PIC16FXXX microcontrollers.

The Peripheral Features of PIC are 3 timers as Timer0: 8-bit timer/counter with 8-
bit prescaler,Timer1: 16-bit timer/counter with rescale, can be incremented during Sleep via
external crystal/clock and Timer2: 8-bit timer/counter with 8-bit period register, presale and
postscaler.Also have features like Two Capture, Compare, PWM modules, Synchronous
Serial Port (SSP) with SPI™ (Master mode) and I2C™ (Master/Slave),USART(Universal
Synchronous Asynchronous Receiver) Transmitter (USART/SCI) with 9-bit address
detection, Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls
(40/44-pin only) and Brown-out detection circuitry for Brown-out Reset (BOR)

The Analog Features of PIC are 10-bit, up to 8-channel Analog-to-Digital Converter


(A/D), and Analog Comparator module (Two analog comparators , Programmable on-chip
voltage reference (VREF) module , Programmable input multiplexing from device inputs and
internal voltage reference , Comparator outputs are externally accessible)

100,000 erase/write cycle Enhanced Flash program memory typical,1,000,000


erase/write cycle Data EEPROM memory typical, Data EEPROM Retention > 40 years, Self-
reprogrammable under software control, In-Circuit Serial Programming™ (ICSP™) via two
pins, Single-supply 5V In-Circuit Serial Programming, Watchdog Timer (WDT) with its own
on-chip RC oscillator for reliable operation, Programmable code protection, Power saving
Sleep mode, Selectable oscillator options and In-Circuit Debug (ICD) via two pins are special
features of PIC16F877A.

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


5
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Basic circuit for working of PIC is as follows:

Fig 3. 1:Basic circuit of PIC

There are 7 pins you should connect correctly. Likes others electronic component, the
supply pin is the most important. The ideal voltage for PIC16F877A is 5V (Direct Current). It
should not be higher than 5.5V because it going to blow up. It also should not be less then 2V
because it not going to be operates.pin 11 and pin 32 are connected to vcc.pin 11 and pin 32
are connected to ground. The other important pin is Reset pin (MCLR - Master Clear Reset at
Pin number 1). If PIC read 0V at MCLR pin, it will reset the program, so if you not connect
the MCLR pin with 5V, PIC will remain reset and your program will not execute. You can
directly connect the MCLR with 5V (series with resistor likes picture below) but you will
unable to reset if your system goes wrong. If you want to use the reset function, you need to
create logic condition which is 1 and 0 to the reset pin. 1 is mean the reset pin get 5V. If the
reset pin logic is 1, then the program in your PIC will execute, but if the reset pin logic
condition is 0 (which is 0V) then your PIC will not execute the program. As in above circuit,
when the switch is not pushed, current will flow trough 10K resistor and MCLR Pin. As a
result, MCLR Pin receives 5V and PIC read it as logic 1. But when switch is push, current
will flow through 10K resistor, switch and directly to ground. There is no voltage will receive
at MCLR Pin. This gives 0 logic at MCLR Pin. Now there are only 2 pin left which is pin

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


6
DUAL MODE OBSTACLE AVOIDANCE ROBOT

number 13 and 14. Those pin was named as OSC1 and OSC2. You can connect the crystal
oscillator from various frequencies. Pulse generated from the oscillator will some time have
the noise. To reduce the noise, two capacitors in Pico farad value are needed. The value of
capacitor is depending on the speed of oscillator that you use. In our circuit we are using
4MHz crystal.

3.2. RF (ASK) MODULE

The RF module, as the name suggests, operates at Radio Frequency. The


corresponding frequency range varies between 30 kHz & 300 GHz. In this RF system, the
digital data is represented as variations in the amplitude of carrier wave. This kind of
modulation is known as Amplitude Shift Keying (ASK).

Transmission through RF is better than IR (infrared) because of many reasons.


Firstly, signals through RF can travel through larger distances making it suitable for long
range applications. Also, while IR mostly operates in line-of-sight mode, RF signals can
travel even when there is an obstruction between transmitter & receiver. Next, RF
transmission is more strong and reliable than IR transmission. RF communication uses a
specific frequency unlike IR signals which are affected by other IR emitting sources.

Amplitude-shift keying (ASK) is a form of amplitude modulation that represents digital data
as variations in the amplitude of a carrier wave.

Fig 3. 2: ASK communication system

Any digital modulation scheme uses a finite number of distinct signals to represent digital
data. ASK uses a finite number of amplitudes, each assigned a unique pattern of binary digits.
Usually, each amplitude encodes an equal number of bits. Each pattern of bits forms the

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


7
DUAL MODE OBSTACLE AVOIDANCE ROBOT

symbol that is represented by the particular amplitude. The demodulator, which is designed
specifically for the symbol-set used by the modulator, determines the amplitude of the
received signal and maps it back to the symbol it represents, thus recovering the original data.
Frequency and phase of the carrier are kept constant.

Like AM, ASK is also linear and sensitive to atmospheric noise, distortions,
propagation conditions on different routes in PSTN, etc. Both ASK modulation and
demodulation processes are relatively inexpensive. The ASK technique is also commonly
used to transmit digital data over optical fiber. For LED transmitters, binary 1 is represented
by a short pulse of light and binary 0 by the absence of light. Laser transmitters normally
have a fixed "bias" current that causes the device to emit a low light level. This low level
represents binary 0, while a higher-amplitude light wave represents binary 1.The ask
demodulation is a two stage process that is recovery of the band limited bit stream and
regeneration of the binary bit stream.

Fig 3. 3: ASK sample waveform

The simplest and most common form of ASK operates as a switch, using the
presence of a carrier wave to indicate a binary one and its absence to indicate a binary zero.
This type of modulation is called on-off keying, and is used at radio frequencies to transmit
Morse code (referred to as continuous wave operation),

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


8
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Fig 3. 4:ASK module

This RF module comprises of an RF Transmitter and an RF Receiver. The


transmitter/receiver (Tx/Rx) pair operates at a frequency of 434 MHz an RF transmitter
receives serial data and transmits it wirelessly through RF through its antenna connected at
pin4. The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted data is received
by an RF receiver operating at the same frequency as that of the transmitter.

The RF module is often used along with a pair of encoder/decoder. The encoder is used for
encoding parallel data for transmission feed while reception is decoded by a decoder. HT12E-
HT12D, HT640-HT648, etc. are some commonly used encoder/decoder pair ICs.

The advantages of ASK over FSK are

 ASK transmitters are simpler than FSK

 ASK transmitter current is 50% lower than FSK


 FSK transmission requires 1.5 times the bandwidth compared to ASK
 ASK receiver sensitivity is equal to or better than FSK

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


9
DUAL MODE OBSTACLE AVOIDANCE ROBOT

 Properly implemented, ASK receiver performance in the presence of co-channel


interference is generally better than FSK

3.3. MOTOR DRIVER IC L293D

Generally, even the simplest robot requires a motor to rotate a wheel or


performs particular action. Since motors require more current then the microcontroller pin
can typically generate, you need some type of a switch (Transistors, MOSFET, Relay etc.,)
which can accept a small current, amplify it and generate a larger current, which further
drives a motor. This entire process is done by what is known as a motor driver. Motor driver
is basically a current amplifier which takes a low-current signal from the microcontroller and
gives out a proportionally higher current signal which can control and drive a motor. In most
cases, a transistor can act as a switch and perform this task which drives the motor in a
single direction. Turning a motor ON and OFF requires only one switch to control a single
motor in a single direction. In order to rotate the motor in reverse direction we needed to
change polarity. This can be achieved by using four switches that are arranged in an
intelligent manner such that the circuit not only drives the motor, but also controls its
direction .This is called H bridge circuit.L239D IC is a motor driver with H Bridge. L293D IC
generally comes as a standard 16-pin DIP (dual-in line package). This motor driver IC can
simultaneously control two small motors in either direction; forward and reverse with just 4
microcontroller pins (if you do not use enable pins) Some of the features (and drawbacks) of
this IC are:.

1. Output current capability is limited to 600mA per channel with peak output current
limited to 1.2A (non-repetitive). This means you cannot drive bigger motors with this
IC. However, most small motors used in hobby robotics should work. If you are
unsure whether the IC can handle a particular motor, connect the IC to its circuit and
run the motor with your finger on the IC. If it gets really hot, then beware... Also note
the words "non-repetitive"; if the current output repeatedly reaches 1.2A, it might
destroy the drive transistors.
2. Supply voltage can be as large as 36 Volts. This means you do not have to worry
much about voltage regulation.

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


10
DUAL MODE OBSTACLE AVOIDANCE ROBOT

3. L293D has an enable facility which helps you enable the IC output pins. If an enable
pin is set to logic high, then state of the inputs match the state of the outputs. If you
pull this low, then the outputs will be turned off regardless of the input states
4. The datasheet also mentions an "over temperature protection" built into the IC. This
means an internal sensor senses its internal temperature and stops driving the motors
if the temperature crosses a set point
5. Another major feature of L293D is its internal clamp diodes. This fly back diode
helps protect the driver IC from voltage spikes that occur when the motor coil is
turned on and off (mostly when turned off)
6. The logical low in the IC is set to 1.5V. This means the pin is set high only if the
voltage across the pin crosses 1.5V which makes it suitable for use in high frequency
applications like switching applications (up to 5KHz)
7. Lastly, this integrated circuit not only drives DC motors, but can also be used to drive
relay solenoids, stepper motors etc.

Fig 3. 5:L293D pin out

The circuit shown to the above is the most basic implementation of L293D IC.The
pins are explained below.

1. Pin1 and Pin9 are "Enable" pins. They should be connected to +5V for the drivers to
function. If they pulled low (GND), then the outputs will be turned off regardless of
the input states, stopping the motors. If you have two spare pins in your

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


11
DUAL MODE OBSTACLE AVOIDANCE ROBOT

microcontroller, connect these pins to the microcontroller, or just connect them to


regulated positive 5 Volts.
2. Pin4, Pin5, Pin12 and Pin13 are ground pins which should ideally be connected to
microcontroller's ground.
3. Pin2, Pin7, Pin10 and Pin15 are logic input pins. These are control pins which should
be connected to microcontroller pins. Pin2 and Pin7 control the first motor (left);
Pin10 and Pin15 control the second motor (right).
4. Pin3, Pin6, Pin11, and Pin14 are output pins. Tie Pin3 and Pin6 to the first motor,
Pin11 and Pin14 to second motor
5. Pin16 powers the IC and it should be connected to regulated +5Volts
6. Pin8 powers the two motors and should be connected to positive lead of a secondary
battery. As per the datasheet, supply voltage can be as high as 36 Volts.

Truth table for the circuit is as follows.

Pin 1 Pin 2 Pin 7 Function


High High Low Turn Anti-
clockwise
(Reverse)
High Low High Turn clockwise
(Forward)
High High High Stop
High Low Low Stop
Low X X Stop

High ~+5V, Low ~0V, X=either high or low (don't care).

In the above truth table you can observe that if Pin1 (E1) is low then the motor stops,
irrespective of the states on Pin2 and Pin7. Hence it is essential to hold E1 high for the driver
to function, or simply connect enable pins to positive 5 volts with Pin1 high, if Pin2 is set
high and Pin7 are pulled low, then current flows from Pin2 to Pin7 driving the motor in anti-
clockwise direction? If the states of Pin2 and Pin7 are flipped, then current flows from Pin7
to Pin2 driving the motor in clockwise direction.

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


12
DUAL MODE OBSTACLE AVOIDANCE ROBOT

3.4. OTHER COMPONENTS

3.4.1. HT12E/HT12D

HT12E is an encoder integrated circuit of 212 series of encoders. They are paired with 212
series of decoders for use in remote control system applications. It is mainly used in
interfacing RF and infrared circuits. The chosen pair of encoder/decoder should have same
number of addresses and data format.  

Simply put, HT12E converts the parallel inputs into serial output. It encodes the 12
bit parallel data into serial for transmission through an RF transmitter. These 12 bits are
divided into 8 address bits and 4 data bits.  HT12E has a transmission enable pin which is
active low. When a trigger signal is received on TE pin, the programmed addresses/data are
transmitted together with the header bits via an RF or an infrared transmission medium.
HT12E begins a 4-word transmission cycle upon receipt of a transmission enable. This cycle
is repeated as long as TE is kept low. As soon as TE returns to high, the encoder output
completes its final cycle and then stops.

HT12D is a decoder integrated circuit that belongs to 212 series of decoders. In


simple terms, HT12D converts the serial input into parallel outputs. It decodes the serial
addresses and data received by, say, an RF receiver, into parallel data and sends them to
output data pins. The serial input data is compared with the local addresses three times
continuously. The input data code is decoded when no error or unmatched codes are found. A
valid transmission in indicated by a high signal at VT pin.

The operating voltage for both encoder and decoder is 2.4v to 12v.this ic uses Low
power and high noise immunity CMOS technology.

3.4.2. IR TRANSMISSION AND DETECTION

Here we are using IR LED as transmitter and photo


detector as reciever.An IR LED, also known as IR
transmitter, is a special purpose LED that transmits
infrared rays in the range of 760 nm wavelength. Such
LEDs are usually made of gallium arsenide or aluminium
Fig 3. 6: Ir detection
gallium arsenide. They, along with IR receivers, are
commonly used as sensors.The appearance is same as a

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


13
DUAL MODE OBSTACLE AVOIDANCE ROBOT

common LED. Since the human eye cannot see the infrared radiations, it is not possible for a
person to identify whether the IR LED is working or not, unlike a common LED. To
overcome this problem, the camera on a cell phone can be used. The camera can show us the
IR rays being emanated from the IR LED in a circuit. Here we are using photo diode as IR
detector along with a resistance. Since when IR fall on the photo diode it’s conducting and
voltage is developed across the resistance. This voltage is used along with a comparator to act
as a IR detector section.

3.4.3. COMPARATOR

LM324 is a 14pin IC consisting of


four independent operational amplifiers (op-amps)
compensated in a single package. Op-amps are high
gain electronic voltage amplifier with differential
input and, usually, a single-ended output. The
output voltage is many times higher than the voltage
difference between input terminals of an op-amp.

These op-amps are operated by a single


Fig 3. 7: LM324 pin out
power supply LM324 and need for a dual supply is
eliminated. They can be used as amplifiers,
comparators, oscillators, rectifiers etc. The conventional op-amp applications can be more
easily implemented with LM324.In our application we used it as a comparator in order to
compare the input voltage from the IR sensor module to a reference value, which will help us
to adjust the obstacle detection range.

3.4.4. POWER SUPPLY

In our circuit we are using 9V battery for remote control and 12V rechargeable battery
for robotic section. In robotic section some parts need 5V dc source. For that we are using
IC7805.

7805 is a voltage regulator integrated circuit. It is a member of 78xx


series of fixed linear voltage regulator ICs. The voltage source in a
circuit may have fluctuations and would not give the fixed voltage

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING

Fig 3. 8:LM7805 pin out


14
DUAL MODE OBSTACLE AVOIDANCE ROBOT

output. The voltage regulator IC maintains the output voltage at a constant value. The xx in
78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5V
regulated power supply. Capacitors of suitable values can be connected at input and output
pins depending upon the respective voltage levels. In our robot IC 7805 is used in receiver
robotic section since main supply is 12v.

4. CIRCUIT DIAGRAM

4.1. REMOTE CONTROL

4.2. ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


15
DUAL MODE OBSTACLE AVOIDANCE ROBOT

4.3. MOTOR DRIVER PROTECTION CIRCUIT

5. WORKING

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


16
DUAL MODE OBSTACLE AVOIDANCE ROBOT

5.1. REMOTE

The main parts of this remote are micro switches, HT12E encoder and RF
transmitter .The function of encoder is to convert the parallel bits input from the switches to
serial bit format, allows it to transmit via RF transmitter.

By default all the parallel input to the encoder is set high. When a switch is pressed the
corresponding bit goes low by grounding them. Each bit pattern is assigned for movement in
particular direction and also to select mode of operation. The bit pattern generated is assigned
as follows in transmitter section as.

BIT PATTERN OPERATION


0111 Forward movement
1011 Reverse movement
1101 Left movement
1110 Right movement
0011 Enter to automatic mode
1100 Exit from automatic mode

When user fed a bit pattern via micro switches say 0111, it’s parallel input to the
HT12E encoder input pins such as AD8, AD9, AD10 and AD11 respectively. The encoder IC
sends this bit pattern in serial format as 0111...to RF transmitter through pin no 17
(Dout) to the pin no 2 of the RF transmitter. The chosen pair of encoder/decoder should have
same number of addresses and data format. These 12 bits are divided into 8 address bits and
4 data bits.  HT12E has a transmission enable pin which is active low. When a trigger signal
is received on TE pin, the programmed addresses/data are transmitted together with the
header bits via an RF transmission medium. HT12E begins a 4-word transmission cycle upon
receipt of a transmission enable. This cycle is repeated as long as TE is kept low. As soon as
TE returns to high, the encoder output completes its final cycle and then stops. Here address
assigned for encoder is 00000000 via address pins A1 to A7 by grounding them.  

RF transmitter actually works based on ASK (Amplitude Shift Keying) or OOK (On
–Off keying) technique. By doing manipulations on the bit patterns it produces corresponding
signal waves at 433MHz for transmission. The transmission occurs at the rate of 1Kbps -
10Kbps.The power supply used is 9V battery.

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


17
DUAL MODE OBSTACLE AVOIDANCE ROBOT

5.2.ROBOT

The robotic circuit consist of RF reciver,HT12D decoder,PIC microcontroller,IR


module,LM324 comparator,L239D motor driver IC and voltage regulator IC 7805.The
transmitted RF signal is decoded by ASK receiver. . The demodulator, which is designed
specifically for the symbol-set used by the modulator, determines the amplitude of the
received signal and maps it back to the symbol it represents, thus recovering the original data.
Frequency and phase of the carrier are kept constant. In this circuit we uses 15C.M. antenna
at transmitter and receiver.

From the data pin of the RF receiver input is given to Din of HT12D decoder. The
address of the decoder is same as that of encoder as 00000000.Hence it decodes the serial bits
from the RF receiver module into parallel bit. The serial input data is compared with the local
addresses three times continuously. The input data code is decoded when no error or
unmatched codes are found. A valid transmission in indicated by a high signal at VT pin.
Thus we get parallel outputs from pin D8 to D11 respectively.

The output from the decoder is fed to RA0 to RA3 pins of PIC16F877A
microcontroller. This is PORTA of the PIC microcontroller. Also PIC microntroller receive
input from the IR receiver through pins RC4 and RC5 respectively. Which are pins of
PORTC. The IR module consists of IR LED and IR receiver which is a photo diode. The IR
receiver produces a voltage when there is any obstacle. This voltage is compared with a
reference voltage using a comparator IC LM324.The reference voltage is set using a
potentiometer. This comparator helps us to fix the distance at which obstacle has to be
detected. This comparator has 4 OP-amps inside them and we are using only two of them.
This input is actually given as IR module input to RC4 and RC5.The obstacle detection can
be identified by the user using two LED lights at the output of the comparator.

The program runs in the PIC microcontroller based on the obstacle avoidance
algorithm. The program runs and produces the corresponding output for input to run the
motor in the either clockwise or anti-clockwise direction. The rotation of motor in either
direction is achieved by motor driver IC L293D.The output of PIC microcontroller is PORTD
and we are using four pins RD0,RD1,RD2 and RD3.The various output assigned are.

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


18
DUAL MODE OBSTACLE AVOIDANCE ROBOT

BIT PATTERN OPERATION


1010 Forward Movement
0101 Backward Movement
0110 Left Movement
1001 Right Movement

The output from the PIC microcontroller are given to motor driver IC input pins
2,7,10 and 15 respectively. . Motor driver is basically a current amplifier which takes a low-
current signal from the microcontroller and gives out a proportionally higher current signal
which can control and drive a motor. In order to rotate the motor in reverse direction we
needed to change polarity. .This is called H bridge circuit.L239D IC is a motor driver with H
Bridge. At the output of the motor driver pins 3, 6 and 11, 14 two 12v dc geared motor are
connected. This motor has high torque3 and gives motion to the robot. (The detailed working
of motor driver is given in chapter).The reference voltage for motor driver is 12V. Here we
are using some a voltage regulator IC 7805 which is a 5v regulator IC since components need
5V as vcc and we are using 12V rechargeable battery.

5.2.1. MANUAL MODE

The default mode of operation is manual mode. In which the user needs to give each
and every instruction manually by pressing each key assigned for robotic movement. When
user presses key for to take a deviation towards left or right direction the robot is
programmed to take exactly 90degree deviation towards left or right. Manual mode of
operation provides user to control the vehicle .Thus the control of the vehicle by user can be
extended up to wide range depends on the range of operation of RF transmitter-receiver
section.

5.2.2. AUTOMATIC MODE

The main important feature of this robot is its ability to work in automatic mode.
Many robots are basically works fully under control of human. here is the importance of this
robot it enter and exit into the automatic mode by pressing corresponding switches and it
does not need any manual instruction further. This mode is applicable in conditions such as

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


19
DUAL MODE OBSTACLE AVOIDANCE ROBOT

when the range of operation exceeds maximum RF transmission range, when there robot is
out of human visibility and in hazards environments. When 0011 is transmitted robot
recognise it as command for transferring the mode from manual to automatic mode. In
automatic mode the robot moves forward and any obstruction is detected it stops and
works according to the obstacle avoidance algorithm. If we wanted exit from the automatic
mode by transmitting 1100.The algorithm is explained below.

5.3. ALGORITHM

The algorithm on which the PIC works is described as follows.PIC continuously


checks the bit patterns coming through the input. First algorithm checks the mode of
operation on which the robot has to works. The robot works in manual mode by default. In
manual mode .In manual mode it first checks whether there is any obstruction? If there is no
obstruction the robot can move in right ,left , forward and backward direction by checking
corresponding bit patterns(produced from transmitted bits and input from the IR module).If
any obstruction is encountered it suddenly stops and the forward movement is disabled but
left,rigt and backward movement are available. And repeat the above cycle in manual mode.

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


20
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Robot always checks mode of operation. When it entered into the automatic mode it moves
forward direction in a straight line if no obstruction is there. But any obstruction is
encountered the obstacle avoidance algorithm will run. That is firstly it stop then move
reverse , moves right after that it moves left and forward..Repeat the cycle until it avoids
obstruction.

6. PCB LAYOUT
Circuit board required for this project is simply constructed by homemade PCB
fabrication steps with ferrous sulphate and copper cladd board.PCB layout is created using
Dip trace and net list is printed on a hard paper. Then the paper is fixed on the copper board
in such a way that the printed side and copper surface are in contact. Then it ironed using an
iron box for 8 minutes. This process will mask copper clad surface in the shape of net list.
Masking process is actually protects the copper from exposing it to chemical solution. Then
board is immersed in the ferrous sulphate solution which is made by dissolving 50gm of
FeSo4 in 500 ml of water. The board is immersed for 40 minutes which will remove the
copper content which is exposed to solution. Thus we will get the PCB. The mask is removed

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


21
DUAL MODE OBSTACLE AVOIDANCE ROBOT

using thinner . After that component is placed according to circuit and soldered.The PCB
layouts of circuits is given below.

6.1. REMOTE

6.2. ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


22
DUAL MODE OBSTACLE AVOIDANCE ROBOT

6.3. PROTECTION CIRCUIT FOR MOTOR DRIVER IC

7. SOFTWARE TOOLS

The various software tools we are used are

1. DIP TRACE
Dip trace 2.3.1.0 provides very handy and easy to use tool for the PCB layout.
Many of its features were utilized leading to an accurate and efficient design. It has
design error check and electrical rool check tools which provide to be helpful in the
design. It is loaded with huge components list that is categorized in various libraries
for giving simplicity. Placement of component is also very easy & they can be rotated
in 360 degree to customize the design.

2. MPLAB IDE
MPLAB provides I.D.E for PIC programming and is very easy to use. We are
used MPLAB version 7.6 to program PIC microcontroller. We are user HI-TECH PIC
complier along with the MPLAB as compiler .This software’s are helpful to create
HEX file which is required for burning on to the PIC.It has powerful debugging tool
Which detect the most of the errors in the program?
3. PROTEUS
Proteus pro 7.6 was very helpful in the case of stimulation of PIC
microcontroller. In this software we could virtually burn the PIC and verify its
working using a simple circuit.PCB layout can be also created using this tool but
DIPTRACE were more advanced in PCB layout creation.

8. ADVANTAGES

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


23
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Robots can accomplish complicated or enormous projects more precisely than


humans can Robots- sometimes called "artificial intelligence" do many things faster than
humans, and make everyday life safer. For example- The military has begun to use robots in
the warzones. Robots make everyday life more enjoyable.

Ability to Work in Environments that are Inhospitable to humans: This is an interesting


set of advantages of robotics. There are a number of tasks that are too dangerous, too exposed
to toxins, or just plain too dirty for humans to conveniently do them. These are ideal robotics
tasks. This includes tasks as simple as spray painting, because there is no need to worry about
the robot inhaling the paint fumes! It also includes such daunting tasks as defusing bombs
and such dirty tasks as cleaning sewers. They can do jobs in dangerous situations and save
lives of thousands of peoples.

Automatic control: The auto mode does not require human guidance. The robot has the
capability to find it’s on path, so it can be used for a particular task once the task is set it will
work automatically.

Quality and Accuracy of Work: Robotic systems have the capability of impressively
meliorating the quality of work. They don't make any mistakes and errors as humans do. This
saves a lot of important output and production time. They provide optimum output in regards
to quality as well as quantity.

9.DISADVANTAGES

Limitations using IR module: Here we used IR module as the obstacle detecting system
although it has the advantages it holds some disadvantages like the receivers and transmitters
must be in direct line of sight of each other, high intensity or fluorescent lights cause
interference and the Quality varies with the company. The edge obstacles are sometimes not
detected this can be adjusted by placing more sensors.

Algorithm: The algorithm is perfect for small areas .it’s a basic model which needs further
development to present in complicated environment.

Speed Control: In this model the robot works in a constant speed adjustment can be done on
further improvement of circuit.

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


24
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Battery backup: Battery can be selected for task requirement but considering it as a wireless
robot recharging is a disadvantage

10. APPLICATION
This device has application in surveying different landscapes and mapping them. it can
also be used in commercial devices like
·         automated lawn mower 
·         smart room cleaner etc
Some of the applications are mentioned below:
1.      Obstacle Detection for a Mining Vehicle
Reliable obstacle detection is an essential element of an autonomous mining
vehicle system. An autonomous vehicle must be capable of detecting potentially dangerous
obstacles that would endanger the vehicle itself, other vehicles, personnel or expensive site
infrastructure while navigating through the mine. Autonomous vehicles will not be deployed
in the field alongside manned vehicles until robust obstacle detection systems have been
developed.
The development of robust obstacle detection systems for these vehicles is difficult because
of the relatively harsh conditions encountered in mining environments. The operating
environment could include rain, dust, mud, high humidity,diesel fumes (small particles),
extremes of temperature, severe vibration, extreme vehicle pitching and rolling, and bright
light sources (e.g. the sun).

2.     Driverless vehicles running along beams


Behind obstacle detection as it stands today, and how it might fill the needs of
driverless vehicles running along beams. To replace the eyes and brains of a human driver
with equally good (or better) technological devices is very tricky. The human mind´s ability
to process sensory information is very advanced and complex. The research going on today
to make robots detect obstacles is very much based on how insects do the same
thing.                      
The sensors of the obstacle detection systems that are of interest to us are built on different
technologies. Those that are available to us today are:
1.     Infrared sensors

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


25
DUAL MODE OBSTACLE AVOIDANCE ROBOT

2.     Common radar


3.     Microwave-based radar
4.     Digital cameras
5.     Laser
6.     Combination of digital cameras and laser
The present invention provides a digital ultrasonic obstacle detection system for vehicles,
which can tune reference data, which is the basis for the determination of whether an
obstacle has been detected. This system executes a parking assist mode or a tuning mode in
response to a command from an external master. The system is configured to store
reflected wave signal data received from a sensor unit, in memory and transmit the
reflected wave signal data to the external master via vehicle communication, at the time of
executing the tuning mode.

3.     Obstacle detecting system for a motor vehicle


An obstacle detecting system for a motor vehicle which is capable of detecting not
only the distance to an obstacle(s) existing in front of the motor vehicle and the width there
of, but also its height to thereby allow a motor vehicle control to be effected more
appropriately with high reliability. The distance to the object and its width are detected by a
laser radar type distance detecting unit, while the distance to the object lying within a
window preset by a window setting device is also detected by a distance detecting circuit of
a stereoscopic video camera unit. An object size determining unit is provided for selecting a
window corresponding to a distance value detected by the stereoscopic video camera unit
and which coincides with a distance value calculated by the laser radar type distance
detecting unit, to thereby determine the size of the object on the basis of the preset
position of the selected window.
                                   

4.     Autonomous cleaning robot


This invention relates to an obstacle detection system for an autonomous
cleaning robot .There is a long felt need for autonomous robotic cleaning devices for

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


26
DUAL MODE OBSTACLE AVOIDANCE ROBOT

dusting, mopping, vacuuming, and sweeping operations. Although technology exists for


complex robots which can, to some extent, "see" and "feel" their surroundings, the
complexity, expense and power requirements associated with these types of robotic
subsystems render them unsuitable for the consumer marketplace. It is therefore an object
of this invention to provide a robot obstacle detection system which is simple in design, low
cost, accurate, easy to implement, and easy to calibrate.
It is a further object of this invention to provide such a robot detection system
which prevents an autonomous cleaning robot from driving off a stair or over an obstacle
which is too high or  too low is a further object of this invention to provide a robotic wall
detection system which is low cost, accurate, easy to implement and easy to calibrate.It is a
further object of this invention to provide such a robot wall detection system which effects
smoother robot operation in the wall following mode.

5. Fire fighting robot

We could use obstacle avoidance robot as a fire fighting robot by adding


temperature sensor, water tank and making some changes in the algorithm.

11. FUTURE SCOPE


Future scope of this robotic project is various application as described above.We
could add camera for surveillance,microphone can be implemented for voice recording,and
other sensors to improve obstacle detection.This robot can work in hazardous environments
were human cannot reach.If it implemented in vehicle such as mining,good transporting
vehicle etc it will improve it’s performance.This robot can be implemented in driver less
vehicle (like Google Car).

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


27
DUAL MODE OBSTACLE AVOIDANCE ROBOT

12. CONCLUSION

Robotics is a rapidly growing field of technology in which the science tries to create a replica for
human brain in sense of intelligence and creativity. Scientists are try to build more and more
developed and multifunctional robot day by day. Here is our simple aim to build a simple version of
this intelligent robot which inelligent sense the obstructive condition in front of it and take suitable
decision based on them.

Here the not only a simple obstruction detection robot but also an avoidance robot which is
intelligently avoid the obstruction and find its path. The main brain part of this project is PIC
microcontroller ie, pic16f877a.the selection factors of PIC is depends on its special in built features
and availability etc. here the RF signal transmission, technique is used for communication between
transmitter and receiver. The movement is achieved with the help of two inexpensive dc motors
supplied from 12v battery.l293d driver is used for driving the motor.The obstruction is detected with
the help of two IR sensors and photodiodes. This method is always cheapest.

The peculiarity is this robot can work in both manual and automatic mode. This extends its
application to the region were the humans cannot reach. The transition between these modes can
be done with the help of simple commands . Along with the advantages it has some sort of
disadvantages also . The IR sensor used is very vulnerable to IR noise, since the IR reflection method
is used, small obstruction cannot be detected, the battery used must has better backup and so
on..These cons can be removed by better advancement of the robot by more efficient program or by
better sensing components . Hence we can conclude that robotics is a Vast area of research in which
more and more inventions are doing in day by day. So a simple project on this field is more capable
giving more awareness about it.

13. REFERANCE

www.efy.com
www.engineersgarage.com
www.wikipedia.com

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


28
DUAL MODE OBSTACLE AVOIDANCE ROBOT

14. APPENDIX A: PROGRAME

#include<pic.h>

void delay(int x)//delay function

{ int i,j;

for (i=0;i<x;i++)

for (j=0;j<3000;j++);

// Function for movement of robot

void fw()

PORTD=0X0A;

void back()

{PORTD=0X05;}

void right()

{PORTD=0X09;}

void left()

{PORTD=0X06;}

void stop()

{PORTD=0X0F;}

void main()

ADCON1=0x06;// configuring PortA to normal i/o ports

// Port's register settings

TRISC=0xFF;

TRISD=0X00;

TRISA=0xFF;

PORTA=0xff;

PORTC=0xff;

re:

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


29
DUAL MODE OBSTACLE AVOIDANCE ROBOT

while(1)

if (RC4==0 && RC5==0 &&RA0==0 && RA1==1 && RA2==1 && RA3==1)

fw();

delay(10);

else if (RC4==0&&RC5==0&&RA0==1&&RA1==0&&RA2==1&&RA3==1)

back();

delay(10);

else if (RC4==0&&RC5==0&&RA0==1&&RA1==1&&RA2==0&&RA3==1)

right();

delay(10);

else if (RC4==0&&RC5==0&&RA0==1&&RA1==1&&RA2==1&&RA3==0)

left();

delay(10);

else if (RC4==1&&RC5==1&&RA0==1&&RA1==0&&RA2==1&&RA3==1)

back();

delay(10);

else if (RC4==1&&RC5==1&&RA0==1&&RA1==1&&RA2==0&&RA3==1)

right();

delay(10);

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


30
DUAL MODE OBSTACLE AVOIDANCE ROBOT

else if (RC4==1&&RC5==1&&RA0==1&&RA1==1&&RA2==1&&RA3==0)

left();

delay(10);

else if (RC4==0&&RC5==0&&RA0==0&&RA1==0&&RA2==1&&RA3==1)

while(1)

if (RC4==0&&RC5==0&&RA0==1&&RA1==1&&RA2==1&&RA3==1)

while(1)

{r1:

if (RC4==1&&RC5==1&&RA0==1&&RA1==1&&RA2==0&&RA3==0)

goto re;

Elseif RC4==0&&RC5==0&&RA0==1&&RA1==1&&RA2==0&&RA3==0)

goto re;

else if (RC4==0&&RC5==0&&RA0==1&&RA1==1&&RA2==1&&RA3==1)

fw();

delay(10);

else if ((RC4==1&&RC5==1&&RA0==1&&RA1==1&&RA2==1&&RA3==1))

stop();

delay(10);

back();

delay(50);

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


31
DUAL MODE OBSTACLE AVOIDANCE ROBOT

right();

delay(34);

fw();

delay(50);

left();

delay(34);

goto r1;

else

stop();

else

stop();

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


32
DUAL MODE OBSTACLE AVOIDANCE ROBOT

15. APPENDIX B: DATA SHEETS

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


33
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


34
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


35
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


36
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


37
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


38
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


39
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


40
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


41
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


42
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


43
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING


44
DUAL MODE OBSTACLE AVOIDANCE ROBOT

Dept. of ECE MANGALAM COLLEGE OF ENGINEERING

You might also like