Obstacle Detection robot detects the obstacle to avoid collision using ultrasonic sensor. The motors are connected through motor driver IC to microcontroller , to control the speed PWM is used.
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
Impediment detection robot using Arduino
1. OBSTACLE SENSING ROBOT USING ARDUINO
J COMPONENT PROJECT
By-
Nikhil Gupta – 15BCE0235
Faheem Ali – 15BCE0740
Ayush Chhangani – 15BCE0824
For the course
CSE2006-Microprocessor and interfacing
UNDER THE GUIDANCE OF
Prof. Jimmy Mathew
Assistent Professor(Senior)
VIT UNIVERSITY, VELLORE
MARCH 2017
2. Introduction
Now day’s many industries are using robots due to their high level of performance and reliability and which is a
great help for human beings. The obstacle avoidance robotics is used for detecting obstacles and avoiding the
collision. This is an autonomous robot. The design of obstacle avoidance robot requires the integration of many
sensors according to their task. The obstacle detection is primary requirement of this autonomous robot. The
robot gets the information from surrounding area through mounted sensors on the robot. Some sensing devices
used for obstacle detection like bump sensor, infrared sensor, ultrasonic sensor etc. Ultrasonic sensor is most
suitable for obstacle detection and it is of low cost and has high ranging capability.
Abstract
The obstacle avoidance robotic vehicle uses ultrasonic sensors for its movements. The motors are connected
through motor driver IC to microcontroller. The ultrasonic sensor is attached in front of the robot. 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 back from an object and
that information is passed to the microcontroller. The microcontroller controls the motors left, right, back, front,
based on ultrasonic signals. In order to control the speed of each motor pulse width modulation is used (PWM).
Problem definition
Robotics is the branch of technology that deals with the design, construction, operation, and application of robots.
A machine capable of carrying out a complex series of actions automatically, esp. one programmable by a
computers is defined as a robot. The project is to develop a robot that will move according to the code
assigned but find a free space, navigating from any obstacle on its way. This kind of obstacle is very useful in
industries where automatic supervision is needed, for example, in places where it might be risky for humans to
be. This robot can also be made by putting other sensors like light sensors or line sensors, ultrasonic sensors and
ultrasound sensor depending on the need.
5. Model-
Literature survey-
This project represents a unique obstacle detection approach for manipulators and mobile robots based on the
artificial potential field concept. Collision detection and avoidance, traditionally considered a high level
6. planning problem, can be effectively distributed between different levels of control, allowing real-time robot
operations in a complex environment. This method has been extended to moving obstacles by using a time-
varying artificial patential field. We have applied this obstacle avoidance scheme to robot arm mechanisms and
have used a new approach to the general problemof real-time manipulator control. We reformulated the
manipulator control problemas direct control of manipulator motion in operational space—the space in which
the task is originally described—rather than as control of the task's corresponding joint space motion obtained
only after geometric and kinematic transformation. Outside the obstacles'regions of influence, we caused the
end effector to move in a straight line with an upper speed limit. The artificial potential field approach has been
extended to collision avoidance for all manipulator links. In addition, a joint space artificial potential field is
used to satisfy the manipulator internal joint constraints. We have designed a simple robot which detects
obstacles and correspondingly changes its direction to avoid collisions. The 3 ultrasonic sensors are used to
detect obstacles in the front, right and left and back direction. The front sensor is the primary sensor which keeps
checking if there are any obstacles in its path in the front direction. Simultaneously the right and left sensors also
keep checking for obstacles in the right and left direction respectively. Whenever there is any obstacle detected
in the range of 10 centimeters by the front sensor, the robot will stop and take a turn in either the right or left
direction depending on which side is clear and free from obstacles. If both the right and left side are free from
obstacles, we have made the robot turn right (One could make it turn left by choice). When the front sensor and
left sensor both detect obstacles within the range of 10 centimeters, the robot is made to turn right. Similar logic
is used to make the robot left turn. If all the 3 sensors detect obstacles within the range of 10 centimeters, the
robot moves in the reverse direction.
Hardware requirements-
1) Arduino
2) Ultrasonic sensor
3) Male-to-female jumping wires
4) Connecting wires
5) Relays
6) Induction motors
7) Wheels
8) Wooden Base
9) 9v battery
10) Batterytop
11) 12V battery
Software requirements-
1) Arduino Programming
2) C Sharp
Circuit diagram-
7. Explanation of major components-
1) Ultrasonic Sensor:
The ultrasonic sensor is used for obstacle detection. Ultrasonic sensor transmits the ultrasonic waves
from its sensor head and again receives the ultrasonic waves reflected from an object. There are many
applications use ultrasonic sensors like instruction alarm systems, automatic door openers etc. The
ultrasonic sensor is very compact and has a very high performance.
2) Arduino –
Arduino Uno is an ATmega 328p Microcontroller based prototyping board. It is an open source
electronic prototyping platformthat can be used with various sensors and actuators.
Arduino Uno has 14 digital I/O pins out of which 6 pins are used in this project.
3) Motors
4) For the motors you could use any normal DC motor of preferably lower RPM. Although BO type DC
motors are quite popular in robotics for low torque applications. Get about a 60-100 RPM motor. You
will need two of them (There is one Castor wheel in the middle of the front end).
Design
Arduino is the main processing unit of the robot. Out of the 14 available digital I/O pins, 6 pins are used in this
project design. The ultrasonic sensor has 4 pins: Vcc, Trig, Echo and Gnd. Vcc and Gnd are connected to the
supply pins of the Arduino. Trig is connected to the 11th pin and Echo is connected to 10th pin of the Arduino.
L293D is a 16 pin IC. Pins 1 and 9 are enable pins. They are connected to Vcc. Pins 2 and 7 are control inputs
from microcontroller for first motor. They are connected to pins 9 and 8 of Arduino respectively. Similarly, pins
10 and 15 are control inputs from microcontroller for second motor. They are connected to pins 4 and 3 of
Arduino. Pins 4, 5, 12 and 13 of L293D are ground pins and are connected to Gnd.
First motor (consider this as the motor for left wheel) is connected across the pins 3 and 6 of L293D. The second
motor, which acts as the right wheel motor, is connected to 11 and 14 pins of L293D. The 16th pin of L293D is
8. Vcc1. This is connected to 5V Vcc. The 8th pins is Vcc2. This is the motor supply voltage. This can be
connected anywhere between 4.7V and 36V. In this project, pin 8 if L293D is connected to 9V supply.
Motor Driver boards are available with on – board 5V voltage regulator. A similar one is used in the project.
Working
Before going to working of the project, it is important to understand how the ultrasonic sensor works. The basic
principle behind the working of ultrasonic sensor is as follows:
Operation of the ultrasonic sensor:
When an electrical pulse of high voltage is applied to the ultrasonic transducer it vibrates across a specific
spectrumof frequencies and generates a burst of sound waves. Whenever any obstacle comes ahead of the
ultrasonic sensor the sound waves will reflect back in the form of echo and generates an electric pulse. It
calculates the time taken between sending sound waves and receiving echo. The echo patterns will be
compared with the patterns of sound waves to determine detected signal’s condition.
The ultrasonic sensor emits the short and high frequency signal. These propagate in the air at the velocity of
sound. If they hit any object, then they reflect back echo signal to the sensor. The ultrasonic sensor consists
of a multi vibrator, fixed to the base. The multi vibrator is combination of a resonator and vibrator. The
resonator delivers ultrasonic wave generated by the vibration. The ultrasonic sensor actually consists of
two parts; the emitter which produces a 40 kHz sound wave and detector detects 40 kHz sound wave and
sends electrical signal back to the microcontroller.
The ultrasonic sensor enables the robot to virtually see and recognize object, avoid obstacles, measure
distance. The operating range of ultrasonic sensor is 10 cm to 30 cm.
Using an external trigger signal, the Trig pin on ultrasonic sensor is made logic high for at least 10µs. A sonic
burst from the transmitter module is sent. This consists of 8 pulses of 40KHz.
The signals return back after hitting a surface and the receiver detects this signal. The Echo pin is high from the
time of sending the signal and receiving it. This time can be converted to distance using appropriate
calculations.
The aim of this project is to implement an obstacle detecting robot using ultrasonic sensor and Arduino. All the
connections are made as per the circuit diagram. The working of the project is explained below.
When the robot is powered on, both the motors of the robot will run normally and the robot moves forward.
During this time, the ultrasonic sensor continuously calculate the distance between the robot and the reflective
surface.
This information is processed by the Arduino. If the distance between the robot and the obstacle is less than
15cm, the left wheel motor is reversed in direction and the right wheel motor is operated normally.
This will rotate the robot towards right. This rotation continues until the distance between the robot and any
obstacle is greater than 15cm. The process continues forever and the robot keeps on moving without hitting any
obstacle.
9. Code-
const int trigPin = 2;
const int echoPin1 = 3;
const int echoPin2 = 4;
const int echoPin3 = 5;
const int echoPin4 = 6;
const int relay1= 7;
const int relay2= 8;
const int relay3= 9;
const int relay4= 10;
const int relay5= 11;
const int relay6=12;
void setup() {
Serial.begin(9600);
}
void loop()
{
long duration1,duration2,duration3,duration4,inches1,inches2,inches3,inches4,cm,front,back,left,right;
long relay1,relay2,relay3,relay4,relay5,relay6;
pinMode(trigPin, OUTPUT);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
pinMode(echoPin1, INPUT);
duration1 = pulseIn(echoPin1, HIGH); inches1
= microsecondsToInches(duration1); front =
microsecondsToCentimeters(duration1);
15. }
long microsecondsToInches(long microseconds)
{
return microseconds / 74 / 2;
}
long microsecondsToCentimeters(long microseconds)
{
return microseconds / 29 / 2;
}
Problems Encountered and Possible Solutions
The robot turns approximately by 90 degrees since we have used the wait function to make it turn. It could be
made to turn to exact 90 degrees by using a compass module. But the problem is that the robot DC motors have
magnets. The magnetic field of these magnets interfere with the field of the compass and hence the compass gives
stray values.
One can try to eliminate this problem by placing the compass as far as possible by placing the compass on a pole
of a reasonably large height. The compass needs to be at a minimum distance of greater than 5 inches to work
properly. Also one needs to take care of the magnetic fields of the surroundings in order to make the compass
work properly.
DRAWBACKS OF EXISTING SYSTEM
1) It is time consuming project.
2) It is use for short distance only.
3) It is not in human control.
4) 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 obstacle, even far away from it.
Applications of Obstacle Avoidance Robotic Vehicle:
1) Especially militaryapplications.
2) It can be used for city wars.
3) Obstacle avoiding robots can be used in almost all mobile robot navigation systems.
4) They can be used for household work like automatic vacuum cleaning.
5) They can also be used in dangerous environments, where human penetration could be fatal.
Future enhancements-
Work for an extended period of time without intervention from human or a need for power supply.
Avoid situations that are harmful.
The designed mobile robot will be able to avoid obstacle perfectly like programmed.
16. If the current project is interfaced with a camera robot can be driven beyond line of sight & range
become practically
Unlimited as networks have very large range.
By adding temperature sensor, water tank and making some change in programming we can use this
robot as fire fighting robot.
Conclusion-
The robot moves around detecting the obstacles on its way and thus making its way through the free space
avoiding all the obstacles it encounters. After the completion of the robot, the robot can now emit IR ray through
the IR emitter, and the IR receiver will detect receive the bounced IR ray that strikes the obstacles if there are
any. If there are any obstacles and IR collides with them, then brain of the robot (micro controller) will calculate
the distance. The robot is made activated after the switch on the activity board is turned on. If there seems to have
any obstacle with in the distance set to it, it will move to the opposite direction of the obstacle detected. That is,
if the right sensor detects the object on its way, it will turn left and start moving straight again and if left sensor
detects an obstacle, it will turn right and continue moving. Additionally, if there seems to be obstacle all around
the robot within the detection distance, robot will keep on rotating 360°.
The Obstacle Car successfully detects and avoids obstacles. Simple algorithms used to steerand reducing the
turning radius, successfully navigated the vehicle. In conclusion, the group successfully interfaced every
component that was originally planned.
References-
1) Takeuchi, T., Nagai, Y., & Enomoto, N. (1988). Fuzzy control of a mobile robot for obstacle
avoidance. Information Sciences, 45(2), 231-248.
2) Gill, M. A., & Zomaya, A. Y. (1998). Obstacle avoidance in multi-robot systems: experiments in
parallel genetic algorithms (Vol. 20). World Scientific.
3) http://google.com
4) http://wikipedia.com
5) Lundgren, M. (2003). Path tracking and obstacle avoidance for a miniature robot. Umeå University,
Umeå, Master Thesis.