Professional Documents
Culture Documents
Dualmode Obstacle Avoidance Robot Content
Dualmode Obstacle Avoidance Robot Content
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;
2. BLOCK DIAGRAM
2.2. ROBOT
Availability of IC burner
I/O ports
Also factors like speed, availability, in built ADC, cost of microcontroller and technical
support available is leaded us to select PIC16F877A.
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
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)
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
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.
Amplitude-shift keying (ASK) is a form of amplitude modulation that represents digital data
as variations in the amplitude of a carrier wave.
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
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.
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),
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.
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.
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.
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
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.
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.
The operating voltage for both encoder and decoder is 2.4v to 12v.this ic uses Low
power and high noise immunity CMOS technology.
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
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.
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.2. ROBOT
5. WORKING
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.
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 0111...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.
5.2.ROBOT
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.
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.
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.
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
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
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
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
7. SOFTWARE TOOLS
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
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.
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).
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
#include<pic.h>
{ int i,j;
for (i=0;i<x;i++)
for (j=0;j<3000;j++);
void fw()
PORTD=0X0A;
void back()
{PORTD=0X05;}
void right()
{PORTD=0X09;}
void left()
{PORTD=0X06;}
void stop()
{PORTD=0X0F;}
void main()
TRISC=0xFF;
TRISD=0X00;
TRISA=0xFF;
PORTA=0xff;
PORTC=0xff;
re:
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);
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);
right();
delay(34);
fw();
delay(50);
left();
delay(34);
goto r1;
else
stop();
else
stop();