Lab Based Project Report On: Obstacle Avoiding Robot

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 27

LAB BASED PROJECT REPORT ON

OBSTACLE AVOIDING ROBOT

BY

Submitted to :MR. Yekambar Nagavelli

ECIL , Secunderabad

Page | 1
CONTENTS

NAME Page no.

1. ABSTRACT 2

2. INTRODUCTION 4-13

3. HARDWARE & 14-24


SOFTWARE REQUIRED
4. APPLICATIONS 24

5. RESULT 24

6. CONCLUSION 25

7. FUTURE SCOPE 25

8. REFERENCES 26-28

Page | 2
ABSTRACT

In today’s world ROBOTICS is a fast growing and interesting field. ROBOT has
sufficient intelligence to cover the maximum area of provided space. It has
an infrared sensor which are used to sense the obstacles coming in between
the path of ROBOT. It will move in a particular direction and avoid the
obstacle which is coming in its path. Autonomous Intelligent Robots are
robots that can perform desired tasks in unstructured environments without
continuous human guidance. The minimum number of gearmotor allows the
walking robot to minimize the power consumption while construct a
program that can produce coordination of multi-degree of freedom for the
movement of the robot. It is found that two gearmotors are sufficient to
produce the basic walking robot and one voltage regulators are needed to
control the load where it is capable of supplying enough current to drive two
gearmotors for each wheel.

Page | 3
INTRODUCTION :
Now a day’s Robotics is part of today’s communication & communication is part of
advancement of technology, so we decided to work on ROBOTICS field, and design
something which will make human life today’s aspect. There are different types of
mobile robots which can be divided into several categories consists of wheeled robot,
crawling robot and legged robot. This project deals with a wheeled autonomous ROBOT.
It is the part of Automation; Robot has sufficient intelligence to cover the maximum
area. This robot uses infrared sensor to detect the obstacle in between the path and
then avoid them to completes its objective. The IR transmitter continuously generate
an Infrared signal of 38KHz,when an obstacle comes in the path the infrared signal
reflected back from the object and is received by the IR sensor TSOP1738 and then
generate a positive high signal with the help of the receiver circuit that is there is an
obstacle in the path. In such a way the robot is able to detect obstacles of provided
space and able to avoid obstacles coming in between the path of ROBOT with the help
microcontroller board and complete its journey.
The main motto of designing such type of Robot or the technology is that this
technology can be used in today’s very fast transportation to avoid the accident
generally happen in congested or the Metro Politian Areas by applying emergency
break. If we use this technology in the car or any vehicle, it will automatically sense the
obstacles then it will take a side to the available free space. An obstacle may be a living
things or any object. Autonomous Intelligent Robots are robots that can perform
desired tasks in unstructured environments without continuous human guidance. Thus
by using this technology in vehicles we make the drive safe.

Introduction to Arduino UNO:


Arduino Uno is a microcontroller board developed by Arduino.cc which is an open-
source electronics platform mainly based on AVR microcontroller Atmega328. First
Arduino project was started in Interaction Design Institute Ivrea in 2003 by David
Cuartielles and Massimo Banzi with the intention of providing a cheap and flexible
way to students and professional for controlling a number of devices in the real world.
The current version of Arduino Uno comes with USB interface, 6 analog input pins, 14
I/O digital ports that are used to connect with external electronic circuits. Out of 14 I/O
ports, 6 pins can be used for PWM output. It allows the designers to control and sense
the external electronic devices in the real world.

Page | 4
Fig – Arduino UNO

TECHNICAL DESCRIPTION OF ARDUINO UNO:

Arduino UNO

Page | 5
Arduino Uno

Fig -Arduino Uno Pin Diagram

PIN DESCRIPTION :-

Pin Category Pin Name Details

Power Vin, 3.3V, 5V, Vin: Input voltage to Arduino when using an
GND external power source.

5V: Regulated power supply used to power


microcontroller and other components on the board.

3.3V: 3.3V supply generated by on-board voltage


regulator. Maximum current draw is 50mA.

GND: ground pins.

Reset Reset Resets the microcontroller.

Page | 6
Analog Pins A0 – A5 Used to provide analog input in the range of 0-5V

Input/Output Digital Pins 0 - 13 Can be used as input or output pins.


Pins

Serial 0(Rx), 1(Tx) Used to receive and transmit TTL serial data.

External 2, 3 To trigger an interrupt.


Interrupts

PWM 3, 5, 6, 9, 11 Provides 8-bit PWM output.

SPI 10 (SS), 11 Used for SPI communication.


(MOSI), 12
(MISO) and 13
(SCK)

Inbuilt LED 13 To turn on the inbuilt LED.

TWI A4 (SDA), A5 Used for TWI communication.


(SCA)

AREF AREF To provide reference voltage for input voltage.

Table -Pin description

ARDUINO UNO TECHNICAL SPECIFICATIONS

Microcontroller ATmega328P – 8 bit AVR family microcontroller

Operating Voltage 5V

Recommended Input 7-12V


Voltage

Page | 7
Input Voltage Limits 6-20V

Analog Input Pins 6 (A0 – A5)

Digital I/O Pins 14 (Out of which 6 provide PWM output)

DC Current on I/O Pins 40 mA

DC Current on 3.3V Pin 50 mA

Flash Memory 32 KB (0.5 KB is used for Bootloader)

SRAM 2 KB

EEPROM 1 KB

Frequency (Clock Speed) 16 MHz

Table -Arduino UNO technical specifications

Other Arduino Boards

Arduino Nano, Arduino Pro Mini, Arduino Mega, Arduino Due, Arduino Leonardo

Overview

Arduino UNO is a microcontroller board based on 8-bit ATmega328P microcontroller.


Along with ATmega328P, it consists other components such as crystal oscillator, serial
communication, voltage regulator, etc. to support the microcontroller. Arduino Uno has
14 digital input/output pins (out of which 6 can be used as PWM outputs), 6 analog input
pins, a USB connection, A Power barrel jack, an ICSP header and a reset button.

How to use Arduino Board

The 14 digital input/output pins can be used as input or output pins by using pinMode(),
digitalRead() and digitalWrite() functions in arduino programming. Each pin operate at

Page | 8
5V and can provide or receive a maximum of 40mA current, and has an internal pull-up
resistor of 20-50 KOhms which are disconnected by default. Out of these 14 pins, some
pins have specific functions as listed below:

 Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit TTL
serial data. They are connected with the corresponding ATmega328P USB to TTL
serial chip.
 External Interrupt Pins 2 and 3: These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value.
 PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using
analogWrite() function.
 SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for
SPI communication.
 In-built LED Pin 13: This pin is connected with an built-in LED, when pin 13 is
HIGH – LED is on and when pin 13 is LOW, its off.

Along with 14 Digital pins, there are 6 analog input pins, each of which provide 10 bits
of resolution, i.e. 1024 different values. They measure from 0 to 5 volts but this limit can
be increased by using AREF pin with analog Reference() function.

 Analog pin 4 (SDA) and pin 5 (SCA) also used for TWI communication using Wire
library.

Arduino Uno has a couple of other pins as explained below:

 AREF: Used to provide reference voltage for analog inputs with analogReference()
function.
 Reset Pin: Making this pin LOW, resets the microcontroller.

Communication

Arduino can be used to communicate with a computer, another Arduino board or other
microcontrollers. The ATmega328P microcontroller provides UART TTL (5V) serial
communication which can be done using digital pin 0 (Rx) and digital pin 1 (Tx). An
Page | 9
ATmega16U2 on the board channels this serial communication over USB and appears as
a virtual com port to software on the computer. The ATmega16U2 firmware uses the
standard USB COM drivers, and no external driver is needed. However, on Windows, a
.inf file is required. The Arduino software includes a serial monitor which allows simple
textual data to be sent to and from the Arduino board. There are two RX and TX LEDs
on the arduino board which will flash when data is being transmitted via the USB-to-
serial chip and USB connection to the computer (not for serial communication on pins 0
and 1). A SoftwareSerial library allows for serial communication on any of the Uno's
digital pins. The ATmega328P also supports I2C (TWI) and SPI communication. The
Arduino software includes a Wire library to simplify use of the I2C bus.

Arduino UNO to ATmega328 Pin Mapping

When ATmega328 chip is used in place of Arduino Uno, or vice versa, the image below
shows the pin mapping between the two.

Page | 10
Fig - Pin Mapping of Arduino UNO to ATmega328

Software

Arduino IDE (Integrated Development Environment) is required to program the Arduino


Uno board.

Programming Arduino

Once arduino IDE is installed on the computer, connect the board with computer using
USB cable. Now open the arduino IDE and choose the correct board by selecting
Tools>Boards>Arduino/Genuino Uno, and choose the correct Port by selecting
Tools>Port. Arduino Uno is programmed using Arduino programming language based
on Wiring. To get it started with Arduino Uno board and blink the built-in LED, load the
example code by selecting Files>Examples>Basics>Blink. Once the example code (also
shown below) is loaded into your IDE, click on the ‘upload’ button given on the top bar.
Once the upload is finished, you should see the Arduino’s built-in LED blinking. Below
is the example code for blinking:

Page | 11
// the setup function runs once when you press reset or power the board

void setup() {

// initialize digital pin LED_BUILTIN as an output.

pinMode(LED_BUILTIN, OUTPUT);

// the loop function runs over and over again forever

void loop() {

digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)

delay(1000); // wait for a second

digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LO


W

delay(1000); // wait for a second

Applications

 Prototyping of Electronics Products and Systems


 Multiple DIY Projects.
 Easy to use for beginner level DIYers and makers.
 Projects requiring Multiple I/O interfaces and communications.

Page | 12
Arduino UNO 2D Model :

Fig 2.2.2-Arduino UNO 2D Model

Page | 13
HARDWARE & SOFTWARE REQUIRED :

1. ARDUINO UNO
2. BREAD BOARD
3. L298N H-bridge
4. HC-SR04 sensor
5. SG90 Servo
6. DC Motors and Wheels
7. Front Wheel 360
8. Male to Male & Female to Female jumper wires
9. 9v Battery * 2
10.9v Battery power cable

ARDUINO UNO :
Arduino is a single-board microcontroller meant to make
the application more accessible which are interactive objects and its
surroundings. The hardware features with an open-source hardware board
designed around an 8-bit Atmel AVR microcontroller or a 32-bit Atmel ARM.
Current models consists a USB interface, 6 analog input pins and 14 digital
I/O pins that allows the user to attach various extension boards.

BREADBOARD:
A thin plastic board used to hold electronic components
(transistors, resistors, chips, etc.) that are wired together. Used to develop
prototypes of electronic circuits, the boards can be reused for future jobs.
Breadboards can also be used to create one-of-a-kind systems, although
commercial products placed on printed circuit boards are typically much
more robust and can handle greater frequencies.
Page | 14
L298N H-bridge :
This allows you to control the speed and direction of two
DC motors, or control one bipolar stepper motor with ease. The L298N H-
bridge module can be used with motors that have a voltage of between 5
and 35V DC.

HC-SR04 sensor :
HC-SR04 is an ultrasonic ranging module that provides 2
cm to 400 cm non-contact measurement function. The ranging accuracy can
reach to 3mm and effectual angle is < 15°. It can be powered from a 5V
power supply.

SG90 Servo :
Tiny and lightweight with high output power. Servo can rotate
approximately 180 degrees (90 in each direction), and works just like the
standard kinds but smaller. You can use any servo code, hardware or library
to control these servos. Good for beginners who want to make stuff move
without building a motor controller with feedback & gear box, especially
since it will fit in small places. It comes with a 3 horns (arms) and hardware.

DC Motors :
A DC motor is any of a class of rotary electrical machines that
converts direct current electrical energy into mechanical energy. The most
common types rely on the forces produced by magnetic fields.

Page | 15
BLOCK DIAGRAM

LEFT

MOTOR
HC-
L298N H- ARDUINO SR04
bridge
sensor
RIGHT
MOTOR

Robot mainly consists of two


types:

1. Mechanical design

2. Circuit design.

MECHANICAL DESIGN

This includes the hardware design of the robot


that is motor &wheel placement, body setup. Robot uses two Robotics gear
motor & wheel for the movement, Which will help it to move forward, left
or right. Robot uses two motor & wheel in the back side and one
freewheeling ball is placed at the front which helps it to free movement.
The sensor are placed in such a way that they can cover the maximum area
in front of the robot and can be capable to detect an obstacle either
obstacle is small or big.

Page | 16
CIRCUIT DESIGN

Circuit design mainly consist of


two parts
a) Sensor part
b) Control board part

a) Sensor part:-
The sensors used in this robot are Infrared sensor,
consisting two part infrared signal generator and the IR receiver designed
in single PCB. There are two sensors are used as left side sensor and right
side sensor and two sensors are used to sense the obstacle on left and
right side.

IR Detector :-
IR detector circuit is a circuit which gives a low output in
absence of IR signal When some obstacle come in path IR signal reflected
back and fall onto the IR detector. In such a way that obstacle are
detected.
b)Control board:-
Control board is the main driver circuit of the robot. It
mainly contains of the microcontroller of Atmel 89C205I and the motor
driver.

Page | 17
Circuit Diagram :

Block Diagram :

Page | 18
Algorithm:-

1.Start
2.Check either switch (p1.6) is on or off
3.If on then go to next step4, otherwise rotate at the same step.
2.Initialize the input port (P3) & output port(P1).
5.Set the bit of port pin 1.0 and pin1.1
6.Read data from port 3.
7.Check the bit on p3.0
8.If bit is present move left motors in Forward direction and stop the right
motor, else go to next step9
9.Check the bit in p3.2
10.If bit is present on pin p3.2,then move right motor in forward direction
until we get high signal on pin p3.2&stop left motor.
11.Again go to step 6.

NOTE

 As the project is based on Arduino, the programming is very easy and


can be easily modified.
 Doesn’t require the Arduino Motor Shield.
 When using a 9V battery, at least 2 such batteries are needed to power
the robot. It is better to use 2 9V batteries (one for Arduino, Ultrasonic
sensor, Servo Motor and the other one for L293D and motors).
 The Ultrasonic sensor should not be connected directly to power
supply as it might affect the normal performance.
 Instead of ultrasonic sensor, an IR transmitter – receiver pair can also
be used.

Page | 19
TIMING DIAGRAM :

Page | 20
F ig ure 5: - Flow Chart for the movement of the

Page | 21
Program :

int trigPin = 9; // trig pin of HC-SR04


int echoPin = 10; // Echo pin of HC-SR04

int revleft4 = 4; //REVerse motion of Left motor


int fwdleft5 = 5; //ForWarD motion of Left motor
int revright6 = 6; //REVerse motion of Right motor
int fwdright7 = 7; //ForWarD motion of Right motor

long duration, distance;

void setup() {

delay(random(500,2000)); // delay for random time


Serial.begin(9600);
pinMode(revleft4, OUTPUT); // set Motor pins as output
pinMode(fwdleft5, OUTPUT);
pinMode(revright6, OUTPUT);
pinMode(fwdright7, OUTPUT);

pinMode(trigPin, OUTPUT); // set trig pin as output


pinMode(echoPin, INPUT); //set echo pin as input to capture
reflected waves
}

void loop() {

digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH); // send waves for 10 us
delayMicroseconds(10);
duration = pulseIn(echoPin, HIGH); // receive reflected waves
distance = duration / 58.2; // convert to distance
delay(10);
// If you dont get proper movements of your robot then alter the pin
numbers
if (distance > 19)
{
digitalWrite(fwdright7, HIGH); // move forward
Page | 22
digitalWrite(revright6, LOW);
digitalWrite(fwdleft5, HIGH);
digitalWrite(revleft4, LOW);
}

if (distance < 18)


{
digitalWrite(fwdright7, LOW); //Stop
digitalWrite(revright6, LOW);
digitalWrite(fwdleft5, LOW);
digitalWrite(revleft4, LOW);
delay(500);
digitalWrite(fwdright7, LOW); //movebackword
digitalWrite(revright6, HIGH);
digitalWrite(fwdleft5, LOW);
digitalWrite(revleft4, HIGH);
delay(500);
digitalWrite(fwdright7, LOW); //Stop
digitalWrite(revright6, LOW);
digitalWrite(fwdleft5, LOW);
digitalWrite(revleft4, LOW);
delay(100);
digitalWrite(fwdright7, HIGH);
digitalWrite(revright6, LOW);
digitalWrite(revleft4, LOW);
digitalWrite(fwdleft5, LOW);
delay(500);
}

Page | 23
RESULT:
WORKING OF ROBOT
As the robot is switched ON, 1st it will check
either start signal is received or not ,if not then the program counter will
not go to the next address it will remains on the same address until it get a
negative signal. Then the robot continuously check any obstacle in path, if
there is no obstacle then robot will go straight. If any obstacle will found in
left side then the controller send a command to the motor drive to stop the
right motor & move the left motor and just opposite as obstacle found in
right side.

APPLICATION :
Obstacle avoiding technique is very useful in real life,
this technique can also use as a vision belt of blind people by changing the IR
sensor by a kinetic sensor ,which is on type of microwave sensor whose
sensing range is very high and the output of this sensor vary in according to
the object position changes. This technique makes a blind people able to
navigate the obstacle easily by placing three vibrato in left, right and the
centre of a belt named as VISION BELT and makes a blind people able to walk
anywhere.On top of obstacle avoiding robot temperature/pressure sensors
can be added to monitor the atmospheric conditions around. This is useful
in places where the environment is not suitable for humans.

Same technology can be used in various application by modifying the


microcontroller program for example
1. Line / Path finder Robot .
2. As automatic vacuum cleaner.
3. With proper programming we can use it as a weight lifter. 4. In Mines

Page | 24
CONCLUSION :

From this study, a walking robot that achieved the stated


objectives had been developed. This robot is able to produce the basic
walking movements using two gearmotors.we developed the robot with a
very good intelligence which is easily capable to sense the obstacle and by
processing the signal coming from the sensor it is perfectly avoiding the
obstacle coming in between the path .Robot take the left or right or the
forward movement in according to the sensing signal with the help of the
two gear motor which makes the movement of the robot smooth .In future,
the sensing range can be increased by increasing the sensor quality with the
help of ultrasonic sensor or the IR signal spread all over the provide area.

FUTURE SCOPE :
In future, the sensing range can be increased by increasing
the sensor quality with the help of ultrasonic sensor or the IR signal spread
all over the provide area. Performance of this robot can be improved with
the help of Bump sensors, for slow moving robots, Ultrasonic range sensors
for large range up to 6m or LASER range finders. One of the prevailing fields
is the use of camera in robot, Computer vision can be implemented for better
performance.

Page | 25
REFERENCES:

 http://www.engineersgarage.com/electronic_circuits.
 http://www.electricaltechnology.com/motor_driverl293d.
 “Obstacle Avoidance Robot” by K. Bhagt, S. Deshmukh, S. Dhonde, S.
Ghag, V. Waghmare, IJSETR, Volume 5, Issue 2, February 2016, ISSN:
2278 – 7798, pp.439-442 .
 “OBSTACLE AVOIDING ROBOT – A PROMISING ONE” by R. Chandra
Kumar, Md. S. Khan, D. Kumar, R. Birua, S. Mondal, M. Kr. Parai,
IJAREEIE, Volume 2, Issue 4, April 2013, ISSN : 2278 – 8875, pp.1430-
1434 [5] “Obstacle Avoidance Robotic Vehicle Using Ultrasonic Sensor,
Android And Bluetooth For Obstacle Detection” by V. Ankit, P. Jigar, V.
Savan, IRJET, Volume: 03, Issue: 02, Feb-2016, ISSN: 2395 -0056,
pp.339-348

Page | 26
Page | 27

You might also like