Вы находитесь на странице: 1из 54

Fire Extinguishing Vehicle by Using GSM

Technology

By

Ahsan Ullah Khan


CUI/FA14-BEE-008/ATD
Bilal Ahmad
CUI/FA14-BEE-088/ATD
Raja Sabahat Ali
CUI/FA14-BEE-076/ATD

BS Thesis
In
Electrical (Electronics) Engineering

COMSATS University Islamabad


Abbottabad Campus-Pakistan

Spring 2018
COMSATS University Islamabad-Abbottabad Campus
Fire Extinguishing Vehicle by Using GSM
Technology
A Thesis Presented to

COMSATS University Islamabad- Abbottabad Campus


In partial fulfillment
of the requirement for the degree of

BS Electrical (Electronics) Engineering


By

Ahsan Ullah Khan


CUI/FA14-BEE-008/ATD
Bilal Ahmad
CUI/FA14-BEE-088/ATD
Raja Sabahat Ali
CUI/FA14-BEE-076/ATD

Spring 2018

ii
Fire Extinguishing Vehicle by Using GSM

Technology

A Under Graduate Thesis submitted to Electrical and Computer Engineering

Department as partial fulfillment of the requirement for the award of Degree of

Bachelor of Science in Electrical (Electronics) Engineering

Name Registration Number

Ahsan Ullah CUI/FA14-BEE-008/ATD

Bilal Ahmad
CUI/FA14-BEE-088/ATD

Raja Sabahat Ali


CUI/FA14-BEE-076/ATD

Supervisor

Engr. Adnan Anwar Awan


Lecturer, Electrical and Computer Engineering
Abbottabad Campus
COMSATS University Islamabad (CUI)
Abbottabad Campus
July 2018

iii
Final Approval

This thesis titled

Fire Extinguishing Vehicle by Using GSM


Technology
By
Ahsan Ullah khan
CUI/FA14-BEE-008/ATD
Bilal Ahmad
CUI/FA14-BEE-088/ATD
Raja Sabahat Ali
CUI/FA14-BEE-076/ATD
Has been approved

For the COMSATS University Islamabad, Abbottabad Campus

Supervisor: ______________________________________________
Engr. Adnan Anwar Awan, Lecturer
Department of Electrical and Computer Engineering Engineering/CUI,
Abbottabad Campus

HOD: ______________________________________________
Dr. Imdad Khan, Associate Professor
Department of Electrical and Computer Engineering, CUI, Abbottabad Campus

iv
Declaration

We Ahsan Ullah Khan (CUI/FA14-BEE-008/ATD), Bilal Ahmad (CUI/FA14-BEE-


088/ATD) and Raja Sabahat Ali (CUI/FA14-BEE-076/ATD) hereby declare that I have
produced the work presented in this thesis, during the scheduled period of study. I also
declare that I have not taken any material from any source except referred to wherever due
that amount of plagiarism is within acceptable range. If a violation of HEC rules on
research has occurred in this thesis, I shall be liable to punishable action under the
plagiarism rules of the HEC.

Date: _________________ Signature of the student:

Ahsan Ullah Khan


CUI/FA14-BEE-008/ATD

Bilal Ahmad
CUI/FA14-BEE-088/ATD

Raja Sabahat Ali


CUI/FA14-BEE-076/ATD

v
Certificate

It is certified that Ahsan Ullah Khan (CUI/FA14-BEE-008/ATD), Bilal Ahmad


(CUI/FA14-BEE-088/ATD) and Raja Sabahat Ali (CUI/FA14-BEE-076/ATD) has carried
out all work related to this thesis under my supervision at the Department of Electrical and
Computer Engineering, COMSATS University Islamabad, Abbottabad Campus and the
work fulfills the requirement for award of BS degree.

Date: _________________

Supervisor:

Engr. Adnan Anwar Awan


Lecturer
Department of Electrical and
Computer Engineering

Head of Department:

Dr. Imdad Khan


Department of Electrical and Computer Engineering

vi
Dedication

Starting with the name of ALLAH ALL MIGHTY, against WHOSE WILL we are
nothing but dust. We dedicate this thesis to our Parents who have never failed to give us
financial and moral support as well as fulfilling all our needs during the time we developed
this system and throughout the course of our educational career. Their evergreen love and
encouragement never let us down and empowered us to purpose beyond our imaginations.
To our supervisor Engr. Adnan Anwar Awan for humbly accepting our proposal, for his
support, teachings and his enlightening ideas, which kept us working day and night with
devotion to reach our goal. To our friends for their incessant support, and their streaming
philosophies no matter how absurd they were, that helped us in understanding most of the
things which alone or small group cannot achieve. We are also thankful to various
colleagues, teachers and other lab staff who supported, advised and assisted our project.

vii
ACKNOWLEDGEMENTS

All praises to ALLAH, the source of all knowledge, wisdom within and beyond
comprehensions, whom enabled us to accomplish our goal. The completion and production
of every book and project is not a single man’s task. One takes the assistance and
cooperation of some people. We have also completed our work on the same mantra. Many
people have extended their valuable assistance, which enable us to give final shape of this
manuscript. We express our deepest gratitude to our parents and family for their prayers,
moral support and sincere wishes for the completion of our work. We would also like to pay
our gratitude to our thesis advisor and teacher Engr. Adnan Anwar Awan for his enduring
interest and support for our project. His generosity to share his ideas with us was the
founding block for this project and thesis. We would like to offer thanks to our friends for
their help and suggestions throughout this work.

Ahsan Ullah Khan FA14-BEE-008


Bilal Ahmad FA14-BEE-088
Raja Sabahat Ali FA14-BEE-076

viii
ABSTRACT

Fire Extinguishing Vehicle by Using GSM


Technology

Voice controlled robotic system is very beneficial in areas where there is high risk for
humans to enter. Voice controlled robotic system is controlled through voice commands
received via android device. The integration of control unit with Bluetooth device is
achieved using a Bluetooth module to capture and read the voice commands. The robotic
vehicle operates as per the command received via android device, for this Arduino is
integrated in the system. The controlling device may be any smart phone having an Android
OS. The transmitter uses an android application required for transmitting the data. The
receiver end reads these commands and interprets them into controlling the robotic vehicle.
The android device sends commands to move the vehicle in forward, backward, right and
left directions. After receiving the commands, Arduino operates the motors in order to
move the vehicle in four directions. The communication between android device and
receiver is sent as serial communication data. Arduino program is designed to move the
motor through a motor driver circuit as per the commands sent by android device. The
wireless camera is interfaced with Arduino to record forward movement of the robotic
system which also includes wireless camera which will not only allow viewing whatever
will be recorded in day time but also during night.

ix
Table of Contents
CHAPTER 1 ...................................................................................................................... 1
INTRODUCTION............................................................................................................. 1
1.1 History and Background .................................................................................................. 2
1.2 Project Overview ............................................................................................................. 2
1.3 Sensing Module ............................................................................................................... 3
1.4 Fire Extinguishing Vehicle (mobile robot) ...................................................................... 3
1.5 Objective .......................................................................................................................... 3
1.6 Importance ....................................................................................................................... 4
1.7 Limitation......................................................................................................................... 4
CHAPTER 2 ...................................................................................................................... 5
LITERATURE REVIEW ................................................................................................ 5
2.1 System Design ......................................................................................................... 6
2.1 Hardware Components Overview .................................................................................... 6
2.1.1 Gas Sensor (MQ2) ................................................................................................... 6
Introduction .......................................................................................................... 6
Features ................................................................................................................ 6
Working ............................................................................................................... 6
2.1.2 UNO Arduino: ......................................................................................................... 7
Arduino Overview ............................................................................................... 7
Arduino Features .................................................................................................. 7
Arduino Power ..................................................................................................... 8
Arduino Memory ................................................................................................. 8
Arduino Communication...................................................................................... 8
Arduino Coding Software .................................................................................... 9
2.1.3 GSM 900(a) Module ................................................................................................ 9
Module Overview ................................................................................................ 9
GSM 900(a)Features .......................................................................................... 10
Hardware connections ........................................................................................ 10
SIM 900(a) AT commands ................................................................................ 10
Sim 900 Application .......................................................................................... 11
CHAPTER 3 .................................................................................................................... 12
IMPLEMENTATION .................................................................................................... 12
Hardware Architecture .................................................................................................. 12
x
3.1 Designing the Sensing Module ............................................................................ 13
3.1 Smoke Detecting Circuit: ............................................................................................... 13
3.2 Smoke Detecting Flow Process: .................................................................................... 14
3.3 Calculation: .................................................................................................................... 15
3.3.1 Homogeneous line of equation: ............................................................................. 15
CHAPTER 4 .................................................................................................................... 16
SOFTWARE ARCHATECTURE................................................................................. 16
4.1 SOFTWARE ARCHATECTURE ...................................................................... 17
4.1 Introduction .................................................................................................................... 17
4.1.1 Simulation of System Design ................................................................................. 17
Sensing system: .................................................................................................. 17
Mobile Robot: .................................................................................................... 17
4.2 Working ......................................................................................................................... 17
4.3 Sensing system simulation: ............................................................................................ 18
4.4 Proposed Algorithm 1: ................................................................................................... 19
4.4.1 Genetic Algorithm: ................................................................................................ 19
Step 1: Initialization ........................................................................................... 20
Step 2: Goal Heading Algorithm ....................................................................... 20
Step 3: Remove Redundant Point Algorithm ..................................................... 21
Step 4: Path Optimization Algorithm................................................................. 21
Step 5: Detect Obstacle Algorithm .................................................................... 21
Step 6: No Dynamic Random Obstacle ............................................................. 21
Step 7: Encounter Dynamic Random Obstacle .................................................. 21
4.4.2 Problems with Genetic Algorithm: ........................................................................ 21
4.5 Proposed Algorithm 2: ................................................................................................... 22
4.5.1 Bug-2 algorithm: .................................................................................................... 22
4.6 Simulation Results: ........................................................................................................ 24
4.6.1 SCENARIOS 1(Rectangular -Shaped obstacle) .................................................... 24
4.6.2 SCENARIOS 2:( U-Shaped obstacle).................................................................... 25
4.6.3 SCENARIOS 3:(V- Shaped obstacle).................................................................... 26
4.6.4 SCENARIOS 4:(Complex-Shaped obstacle) ......................................................... 27
4.6.5 SCENARIOS 5:(Complex-Shaped obstacle) ......................................................... 28
CHAPTER 5 .................................................................................................................... 29
5.1 FUTURE WORK ................................................................................................. 30

xi
5.1 Implementation of Low-cost Embedded Control Devices: ............................................ 30
APPENDIX ...................................................................................................................... 31
6.1 Appendix:.............................................................................................................. 32
REFERENCES ................................................................................................................ 40
7.1 References ............................................................................................................. 41

Tables of figures
Figure 1 ............................................................................................................................... 7
Figure 2 ............................................................................................................................... 9
Figure 3 ............................................................................................................................. 11
Figure 4 ............................................................................................................................. 13
Figure 5 ............................................................................................................................. 14
Figure 6 ............................................................................................................................. 18
Figure 7 ............................................................................................................................. 19
Figure 8 ............................................................................................................................. 20
Figure 9 ............................................................................................................................. 23
Figure 10 ........................................................................................................................... 23
Figure 11 ........................................................................................................................... 24
Figure 12 ........................................................................................................................... 24
Figure 13 ........................................................................................................................... 25
Figure 14 ........................................................................................................................... 25
Figure 15 ........................................................................................................................... 26
Figure 16 ........................................................................................................................... 26
Figure 17 ........................................................................................................................... 27
Figure 18 ........................................................................................................................... 27
Figure 19 ........................................................................................................................... 28
Figure 20 ........................................................................................................................... 28

xii
CHAPTER 1

INTRODUCTION

1
INTRODUCTION

1.1 History and Background


Everyone must have some interaction with fire either directly or indirectly. Due our
mistakes it causes serious harm to human and property. Analyzing past fire incidents, facts
are revealed. Some of the main causes are insufficient fire defense materials, electric short
circuit from faulty electrical wiring, presence of inflammable materials, violation of fire
safety and lack of adequate awareness etc.
There are different sources which caused fire like gas (methane), liquid (petrol, diesel),
wood, paper and short circuit in electrical wiring. Typically, different extinguishing
materials are uses as extinguisher material which are water, chemical foam, dry powder,
halon, or carbon dioxide CO 2.

Mobile robots permit human access to unreachable locations including accidental


situations like fire, building collapse, fire, earthquake and hazardous scenarios such as
Nuclear Power Plant (NPP) [4], chemical industry, transmission lines etc. Deployment of
a mobile robot in real world applications demands addressing several new issues regarding
robot interaction. The increasing development in robotics has brought up various
challenges including obstacle avoidance, path planning, navigation, localization,
autonomous control etc.
Intelligence in the robot navigation to achieve autonomy is a challenging problem for
researchers, as it is an important task to design the robot which can perform variety of
tasks, such as surveillance, transportation, exploration or human locomotion [6,7]. The
existing robot navigation algorithms can be categorized into three main types based on
knowledge of environment: completely known, partially known and unknown environment

1.2 Project Overview


Nowadays, machinery and Vehicle design become important in helping human. This Fire
Extinguishing Vehicle was design to help people in any destructive burnt situation where
this Vehicle can extinguish burnt area immediately using autonomous system.
In completely known environment, it is easy to tune a robot, by simply creating a map and
applying A* search algorithm [8] to generate a reference path. On the other hand, in a
partially or completely unknown environment, an obstacle avoidance algorithm is required.
Obstacle avoidance is the backbone of autonomous control in the robot navigation
especially in a fully unknown environment as it plays the key role in safe path planning.
The algorithm for this purpose must be efficient enough, so that it can take a quick decision
while encountering an obstacle without human intervention. Wide sample space of obstacle
shapes that can be encountered in real world applications further necessitates the algorithm
intelligence. In the field of mobile robotics, intelligent obstacle avoidance is the most
2
important task, since every autonomous robot must plan a safe path for its trajectory
towards destination. This is achieved with an intelligent algorithm that uses knowledge of
goal position and the sensorial information of the surrounding environment. With a focus
on these primary features, the present research proposes an intelligent goal-oriented
algorithm for autonomous navigation of mobile robots. The proposed algorithm does
outperform the existing an approaches’ also tackle the guidance of the mobile robot was
from the starting position to the desired goal and do not take into consideration the
circumstances when mobile robot is trapped inside acute ‘U’ or ‘V’ shaped obstacles. Also,
it proves the convergence with relatively short, smooth and safe trajectory.

1.3 Sensing Module

First, we have developed a sensing module which used to sense the fire where it implants.
It has a sensor (MQ2) which is used for sensing of fire on smoke concentration value. When
smoke concentration value is above the threshold value it output pin give signal to Arduino
(UNO) input by serially communicating. We defined the location of implant module in
Arduino coding. The location is in longitude and attitude form. Mobile number of users
also record in coding of GSM module. Here a GSM (Global System for Mobile
Communication) 900 module for sending the location of fire from Arduino to user mobile.
Whenever the signal is received by sensor to Arduino, it communicates with GSM module
and location will received at user mobile phone. DC battery is also used for power given
to all module.

1.4 Fire Extinguishing Vehicle (mobile robot)

Second portion of project is fire extinguishing autonomous Vehicle(simulation). When


SMS is received at user phone, these coordinates are used to make the grid destination
position. In which we first make the 2D(planner) world with free space (0) and occupied
space (1) using grid process by means of Bug algorithms which uses MVTB to make these
occupied spaces into K-cell obstacle with desired color and the robot starts after detecting
an obstacle starts follow-in the edge of obstacle until it reaches to the point from where the
robot started following the edge. It simultaneously calculates the distance from current
position to destination and finally stores the point having minimum distance. This point,
after one complete cycle of the robot is considered as leaving point. The robot restarts
following the edge until it reaches to the calculated leaving point. After avoiding obstacle,
robot computes new path from the leaving point to destination using straight line equation

1.5 Objective

The main objective of our project is

1. To design a system which detect fire automatically.


2. Design is totally wireless system.

3
3. When mobile robot is trapped inside acute ‘U’ or ‘V’ shaped obstacles. Robot was
able to move away from ‘U-shaped’ type obstacles and it did not navigate in
between two obstacles.
4. Find a shortest path from starting position to the goal position.

1.6 Importance

Our project aims are to detect fire and extinguish it automatically by vehicle by means of
path planning algorithms(bug). We are using GSM technology which is totally wireless
communication. This system has facility of avoiding the obstacle and move to its
destination. It follows the colliding free path (non-repeated path).

1.7 Limitation

The focus of our project is designing an automatic and obstacle avoiding system. Like all
other project our project have limitation too. First limitation is that system is not completely
automatic. Vehicle will not move until the user sent SMS from its mobile phone. Secondly,
we are dealing only with statics obstacle, circumstances of dynamics obstacle are not
handling, because dynamics obstacle treating is very difficult at this stage. Although we
only work on simulation environment may possibly practically different results in practical
environment.

4
CHAPTER 2

LITERATURE REVIEW

5
2.1 System Design
2.1 Hardware Components Overview

 Gas Sensor (MQ2)


 Arduino UNO
 GSM 900(a) Module

2.1.1 Gas Sensor (MQ2)


Introduction

The MQ-2 Gas Sensor module detects gas leakage in home and industry. The MQ series of gas
sensors use a small heater inside with an electrochemical sensor. They are sensitive to a range
of gasses and are used indoors at room temperature. The output is an analog signal and can be
read with an analog input of the Arduino. [1]

Features

1. Wide detecting scope


2. High sensitivity and fast response
3. Long life and stable
4. Simple drive circuit

Working

The MQ2 has an electrochemical sensor, which changes its resistance for different
concentrations of varied gasses. The sensor is connected in series with a variable resistor
to form a voltage divider circuit (Fig 2.1), and the variable resistor is used to change
sensitivity. When one of the above gaseous elements comes in contact with the sensor after
heating, the sensor’s resistance change. The change in the resistance changes the voltage
across the sensor, and this voltage can be read by a microcontroller. The voltage value can
be used to find the resistance of the sensor by knowing the reference voltage and the other
resistor’s resistance. The sensor has different sensitivity

6
different types of gasses. The sensitivity characteristic curve (Fig 2.1,2.2) is shown below
for the different type of gasses [1].

Figure 1

Gas Sensor Internal Circuit (MQ2)

2.1.2 UNO Arduino:

Arduino Overview
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset
button. It contains everything needed to support the microcontroller, connect it to a
computer with a USB cable or power it with an AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2)
programmed as a USB-to-serial converter shown in figure 2.2 [2].

Arduino Features

 5V operating voltage
 6-20V input voltage (limit)
 14 (with 6 providing PWM output) digital I/O pins
 Six analog input pins

7
 20mA DC current per I/O pin
 50mA DC current for 3.3V pin
 32KB Flash memory (ATmega328P)
 1KB EEPROM (ATmega328P)
 16MHz clock speed
 68.6mm x 53.4mm (Length x Width)
 25g weight

Arduino Power
The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically. External (non-USB) power can come
either from an AC-to-DC adapter (wall-wart) or battery. [2][3]
The adapter can be connected by plugging a 2.1mm center-positive plug into the board's
power jack. Leads from a battery can be inserted in the Ground and Vin pin headers of the
POWER connector (figure 2.2).

 VIN. The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source).

 5V. This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or
the VIN pin of the board (7-12V. Supplying voltage via the 5V or 3.3V pins bypasses the
regulator and can damage your board. (figure 2.2)
 3V3. A 3.3-volt supply generated by the on-board regulator. Maximum current draw is
50 mA.
 GND. Ground pins.

Arduino Memory

Memory the ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2
KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library).

Arduino Communication

 Includes a number of facilities for communicating with a computer, another Uno


board, or other MCUs

8
 ATmega328 provides UART TTL (5V) serial communication, available on digital
pins 0 (RX) and 1 (TX) [2][3]
 ATmega16U2 on board channels this serial communication over USB and appears
as virtual com port to software on the computer [4].

Arduino Coding Software

Arduino IDE Arduino IDE is programming environment that allows the user to draft
different kind of programs and load them into the Arduino microcontroller. Arduino uses
user-friendly programming language, which is based on programming language called
Processing. After the user has written his code, IDE compiles and translates the code to the
assembler language. After translating the code, the IDE uploads the program to the Arduino
microcontroller. Arduino IDE has a built-in code parser that will check the user written
code before sending it to the Arduino. Software have c language for coding [4][3].

Figure 2

Arduino Programming Board

2.1.3 GSM 900(a) Module


Module Overview

This is an ultra-compact and reliable wireless module. The SIM900A is a complete Dual-
band GSM/GPRS solution in a SMT module which can be embedded in the customer
applications. Featuring an industry-standard interface, the SIM900A delivers GSM/GPRS
900/1800MHz performance for voice, SMS, Data, and Fax in a small form factor and with
low power consumption. (Figure 2.3) [3]

9
GSM 900(a)Features

 Power Supply: +5V


 Fully compatible with Arduino/Raspberry Pi/AVR/PIC/ARM/FPGA
 Free serial port connecting, you can select Hardware/Software Serial port control
 Super capacitor power supply for the RTC
 Not only can use the button for power on, but also can use the digital pin of
Arduino to power on and reset the SIM900 module
 Quad-Band GSM(2G) GPRS/EDGE 850/900/1800/1900 MHz
 GPRS multi-slot class 10/8
 GPRS mobile station class B
 Compliant to GSM phase 2/2+
 Class 4 (2 W @850/ 900 MHz)
 Class 1 (1 W @ 1800/1900MHz)
 Supply voltage range 3.1-4.8V
 Low power consumption: 1.5mA (sleep mode)
 Dimension:60 mm x 53 mm

Hardware connections
The SIM900 module has 6pins in which two pins for Vic and GND and the rest are
3VR&3VT (3volt Rx & TX) and 5VR,5VT (5volt Rx & TX) and the connections are made
as follows: [3]

 Vic to 5V
 Gnd to Gnd
 5VR digital pin 7
 5VT digital pin 8

SIM 900(a) AT commands

 Set the SIM900 to text mode: AT+CMGF=1\r


 send SMS to a number: AT+CMGS=PHONE_NUMBER (in international
format)
 read the first SMS from the inbox: AT+CMGR=1\r
 read the second SMS from the inbox: AT+CMGR=2\r
 read all SMS from the inbox: AT+CMGR=ALL\r
 call to a number: ATDP+ PHONE_NUMBER (in international format)
 hang up a call: ATH
 receive an incoming call: ATA. (Figure 2.3)

10
Sim 900 Application
Applications of SIM 900(a) are
 Remote control of appliances.
 Remote Weather station or a Wireless Sensor Network
 Interactive Voice Response System
 Vehicle Tracking System.
 Multiple DIY Projects.

Figure 3

GSM Sim 900 (a)Module

11
CHAPTER 3

IMPLEMENTATION

Hardware Architecture

12
3.1 Designing the Sensing Module

This chapter covers the following areas


 Smoke Detecting Circuits
 Smoke Detecting Flow Process
 Calculations

3.1 Smoke Detecting Circuit:

This design is used to detect the fire and send the GPS coordinates through SMS (short-
message-send) using GSM modem (sim900a). Smoke sensor module (MQ2) is used for
sensing the smoke concentration. LED and Buzzer are used for indicating alert when smoke
concentration is high, two resistors (100 ohms) are used to prevent the LED and Buzzer
from damage usually controlling the current. By virtual terminal we can see the GPS
coordinates of fire place as shown fig 3.1

Figure 4

Smoke Detecting Circuit

13
3.2 Smoke Detecting Flow Process:

When concentration of fire smoke is more than the predefined(threshold) smoke


concentration value in sensor module (MQ2), the output signal of sensor become high and
give a high signal to Arduino module (UNO R3). Arduino will serial communicate with
GSM module(sim900a) and send location of fire place to mobile phone by GSM module.
Also, the LED and Buzzer become ON for indicating the alerted SMS is received by
another GSM modem (sim900a) which will then move the robot.

Figure 5

Flow chart of Smoke Detecting Circuit

14
3.3 Calculation:
3.3.1 Homogeneous line of equation:
HOMLINE Homogeneous line from two points
L = HOMLINE (X1, Y1, X2, Y2) is a vector (3x1) which describes a line in
homogeneous form that contains the two Euclidean points (X1, Y1) and (X2, Y2).
Homogeneous points X (3x1) on the line must satisfy L'*X = 0.
L = homline (x1, y1, x2, y2)
L= cross ([x1 y1 1], [x2 y2 1]);
normalize so that the result of x*l' is the pixel distance from the line
L = L / norm (L (1:2));
c = reshape(size(a));

15
CHAPTER 4

SOFTWARE ARCHATECTURE

16
4.1 SOFTWARE ARCHATECTURE

4.1 Introduction
4.1.1 Simulation of System Design
In this chapter we will explain the process flow of our project:
This chapter is divided into two parts:
1.Sensing system
2.Mobile robot

Sensing system:
This part of project in which the smoke of fire is to be sensed and sends the coordinates (I-
e longitude & latitude) of that location where this system is implanted to user through SMS.

Mobile Robot:
Using 2D environment these longitude & latitude are converted into Cartesian coordinates
by means of which the robot starts from initial to goal position avoiding the obstacles.

4.2 Working
When concentration of fire smoke is more than the predefined(threshold) smoke
concentration value in sensor module (MQ2), the output signal of sensor become high and
give a high signal to Arduino module (UNO R3). Arduino will serial communicate with
GSM module(sim900a) and send location (coordinates) of fire place to mobile phone by
GSM module. Also, the LED and Buzzer become ON for indicating the alerted SMS is
received by another GSM modem (sim900a) which will then move the robot. Using
MATLAB, by means of Goal heading Bug algorithms (path planner) the robot starts
moving at desired location by avoiding obstacle as shown in Figure 6.

17
4.1 Block Diagram:

Figure 6

Block diagram of autonomous fire extinguishing GSM system


4.3 Sensing system simulation:
When the digital pin of smoke sensor(MQ2) is on is gives the signal to Arduino in form
of voltages(analog). Arduino compare these voltages with threshold voltage when it
meets the buzzer and led becomes ON. Arduino serially communicates to GSM modem
and sends the coordinates which becomes appeared on virtual terminal shows in Figure 7.

18
Figure 7

Simulation of smoke Sensing system


4.4 Proposed Algorithm 1:
4.4.1 Genetic Algorithm:
A genetic algorithm (GA) offers an alternative to traditional local search algorithms. It is
an optimization algorithm inspired by the well-known biological processes of genetics and
evolution. Genetics is the study of the inheritance and variation of biological traits.
Manipulation of the forces behind genetics is found in breeding animals and genetic
engineering. Evolution is closely intertwined with genetics. It results in genetic changes
through natural selection, genetic drift, mutation, and migration. Genetics and evolution
result in a population that is adapted to succeed in its environment. In other words, the
population is optimized for its environment. [10].

19
Figure 8

Flow chart of Goal Heading Genetic Algorithm

Step 1: Initialization
GOPPA based controller starts with the initialization of the parameters. [9]

Step 2: Goal Heading Algorithm


Goal Heading Algorithm is activated to assist the mobile robot travel from the starting
position to the desired goal in a collision free path. [9]
The algorithm has the following steps:
1. Create an initial population.
2. Evaluate the fitness of each population member.
3. Invoke natural selection.
4. Select population members for mating.
5. Generate offspring.
6. Mutate selected members of the population.
7. Terminate run or go to step 2.

20
Step 3: Remove Redundant Point Algorithm
After new collision free path is found, unnecessary neighboring coordinate(s) is/are
screened out to remover redundant points lying along the path through Remove Redundant
Point Algorithm [9]

Step 4: Path Optimization Algorithm


When the collision free path without redundant point is found, Path Optimization
Algorithm is utilized to find the optimum path from the obstacle free path obtained after
Goal Heading Algorithm and Remove Redundant Point Algorithm. [9]

Step 5: Detect Obstacle Algorithm


Detect Obstacle Algorithm is called to identify if there is/are any dynamic obstacle(s) while
guiding the mobile robot to travel from the starting position to the desired goal according
to the optimized collision free path. [9]

Step 6: No Dynamic Random Obstacle


If no dynamic random obstacle is detected during the process of guiding the mobile to the
desired goal, the mobile robot will travel from the starting position to the desired goal
according to the optimized collision free path determined by Path Optimization Algorithm.
[9]

Step 7: Encounter Dynamic Random Obstacle


In the cases where dynamic random obstacle(s) is/are positioned in the environment, the
current position is taken as the new starting position. The original goal remains as the new
desired goal of the mobile robot and Step 2 – Step 7 are repeated. Goal Heading Algorithm
is activated to search for new obstacle free path from the new starting position to the desired
goal. [9]

4.4.2 Problems with Genetic Algorithm:


1. The main problem is to tackle the position of robot from starting to goal point due
to computation of four problems which are as following.
2. The initial population contains many infeasible paths, which have negative
influence on the performance of the genetic algorithm.
3. Secondly, there are not sufficient heuristic knowledge based genetic operators.
4. Thirdly, after each generation, offspring may contain infeasible path.
5. Forth, the guidance of the mobile robot was from the starting position to the desired
goal and do not take into consideration the circumstances when mobile robot is
trapped inside acute ‘U’ or ‘V’ shaped obstacles.

Hence, these all problems would be solved by the bug2 algorithm.

21
4.5 Proposed Algorithm 2:
4.5.1 Bug-2 algorithm:

Bug-2 algorithm is an improved version, which generates initial path from source to
destination and stores slope of this path in its move to goal behavior. The behavior of the
Vehicle is changed to obstacle avoidance when an obstacle is encountered in 2d grid
environment Figure 10, where the Vehicle starts following edge of the obstacle and
continuously calculates slope of the line from its current position to the destination. When
this slope becomes equal to slope of initial path (from source to destination), the behavior
of the Vehicle is changed to move to goal.
Initially, in move to goal behavior, a reference path is generated from source to goal
position and the robot is forced to follow it until an obstacle is encountered or destination
is reached. The behavior of the robot is changed to obstacle avoidance when an obstacle is
sensed, and the robot is commanded to follow the edges of the obstacle until leaving point
is reached. leaving point by taking the goal position into account is selected based on free
path toward the destination. The robot monitors the obstacles in the path towards
destination while detecting edge in obstacle avoidance behavior. The obstacle-free path
towards goal is also considered. This ensures that the robot does not have to wait for the
point having minimum distance to goal. The flowchart Bug-2 is shown in Figure 9.

22
FLOW CHART:

Figure 9

Flow chart of Bug-2 Algorithm

Figure 10

Grid mapping for obstacles and free space

23
4.6 Simulation Results:

4.6.1 SCENARIOS 1(Rectangular -Shaped obstacle)

This type of obstacle is dealing with robot calculates the distance from initial to goal
point makes homogenous m-line Figure 11. when robot starts moving from initial to
goal position along with the homogenous straight line encounter the obstacle the robot
becomes following the edge of obstacle continuously calculating the distance from
homogenous line and existing position until it reaches destination Figure 12.

Figure 11

Rectangular Shaped Obstacle

Figure 12

Rectangular Shaped Obstacles Avoidance

24
4.6.2 SCENARIOS 2:( U-Shaped obstacle)

This type of obstacle is dealing with robot calculates the distance from initial to goal
point makes homogenous m-line Figure 13. In order to avoid trap in this type obstacle
the robot starts moving from initial to goal position along with the homogenous
straight line encounter the obstacle the robot becomes following the edge of U-shaped
obstacle continuously calculating the distance from homogenous line and existing
position until it reaches destination Figure 14.

Figure 13

U-Shaped obstacle

Figure 14

U-Shaped Obstacles Avoidance

25
4.6.3 SCENARIOS 3:(V- Shaped obstacle)

This type of obstacle is dealing with robot calculates the distance from initial to goal
point makes homogenous m-line Figure 15. In order to misplace the destination in this
type obstacle the robot starts moving from initial to goal position along with the
homogenous straight line encounter the obstacle the robot becomes following the edge
of U-shaped obstacle continuously calculating the distance from homogenous line and
existing position until it reaches destination Figure 16.

Figure 15

V-Shaped obstacle

Figure 16

V-Shaped Obstacles Avoidance


26
4.6.4 SCENARIOS 4:(Complex-Shaped obstacle)

This type of obstacle is dealing with robot calculates the distance from initial to goal
point makes homogenous m-line Figure 17. In order to avoid non-repeated path in this
type obstacle the robot starts moving from initial to goal position along with the
homogenous straight line encounter the obstacle the robot becomes following the edge
of complex-shaped obstacle continuously calculating the distance from homogenous
line and existing position until it reaches destination Figure 18.

Figure 17

Complex Shaped Obstacle

Figure 18

Complex Shaped Obstacles Avoidance

27
4.6.5 SCENARIOS 5:(Complex-Shaped obstacle)

This type of home two-dimensional environment is dealing with robot calculates the
distance from initial to goal point makes homogenous m-line Figure 19. In order to
track the destination, path the robot starts moving from initial to goal position along
with the homogenous straight line encounter the obstacle the robot becomes following
the edge of all shaped obstacles continuously calculating the distance from
homogenous line and existing position until it reaches destination Figure 20.

Figure 19

Static Environment Obstacle

Figure 20

Static Environment Obstacle Avoidance


28
CHAPTER 5

29
5.1 FUTURE WORK

5.1 Implementation of Low-cost Embedded Control Devices:


• For intelligent wheelchairs
• Service robots

30
APPENDIX

31
6.1 Appendix:
//FYP Project
//AHSANULLAH FA14-BEE-008
//RAJASABAT FA14-BEE-076
//BILAL AHMAD FA14-BEE-088
#include <SoftwareSerial.h>
Software Serial sim900a (10, 11); // 10=RX, 11=TX // GSM RX SHOULD CONNECT
TO 11, GSM TX SHOULD CONNECT TO 10
int redLed = 13;
int buzzer = 6;
int smokeA0 = A0;
char sms;
// Your threshold values
int sensorThres = 200;

void setup() {
sim900a.begin(9600);
Serial.begin(9600);
pinMode(redLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
delay(100);
}

void loop() {

int analogSensor = analogRead(smokeA0);


Serial.println(analogSensor);
if (analogSensor > sensorThres )

32
{
digitalWrite(redLed, HIGH);
tone(buzzer, 200, 1000);
delay(1000);
SendMessage();
delay(1000);
}
digitalWrite(redLed, LOW);
}
void SendMessage()
{
sim900a.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
sim900a.println("AT+CMGS=\"03479268016\"\r"); // Replace x with mobile number
delay(1000);
sim900a.println("Gps corindates ");
delay(1000);
sim900a.println("ALert :fire: ");
delay(1000);
sim900a.println("lat:34.229047 long:73.240750");// The SMS text you want to send
delay(1000);
sim900a.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}

Part 2:
%//FYP Project
%//AHSANULLAH FA14-BEE-008
%//RAJASABAT FA14-BEE-076

33
%//BILAL AHMAD FA14-BEE-088

%rectangular goal points


% start=[40,60];
% goal = [140,20];
%U-SHAPE GOAL POINTS
% goal = [140,20];
% start = [80,70];
%v-shape points
% start=[60,70];
% goal = [140,20];
% complex shape
% start=[35,50];
% goal = [140,20];

start=[ ];
goal = [ ];
about map
bug = Bug2(map)
bug.plot()% create navigation object
bug.query(start, goal,'animate');

%BUG2 Bug navigation class


%
% A concrete subclass of the abstract Navigation class that implements the bug2
% navigation algorithm. This is a simple automaton that performs local
% planning, that is, it can only sense the immediate presence of an obstacle.
%

classdef Bug2 < Navigation

properties(Access=protected)
H % hit points
j % number of hit points
mline % line from starting position to goal
step % state, in step 1 or step 2 of algorithm
edge % edge list
k % edge index
end

methods

34
function bug = Bug2(varargin)
%Bug2.Bug2 Construct a Bug2 navigation object
%
% B = Bug2(MAP, OPTIONS) is a bug2 navigation object, and MAP is an occupancy
grid,
% a representation of a planar world as a matrix whose elements are 0 (free
% space) or 1 (occupied).

% invoke the superclass constructor


bug = bug@Navigation(varargin{:});

bug.H = [];
bug.j = 1;
bug.step = 1;
end

function pp = query(bug, start, goal, varargin)


%Bug2.query Find a path
%
% B.query(START, GOAL, OPTIONS) is the path (Nx2) from START (1x2) to GOAL

opt.animate = false;
opt.movie = [];
opt.current = false;

opt = tb_optparse(opt, varargin);

if ~isempty(opt.movie)
anim = Animate(opt.movie);
opt.animate = true;
end

% make sure start and goal are set and valid


bug.start = []; bug.goal = [];
bug.checkquery(start, goal);

% compute the m-line


% create homogeneous representation of the line
% line*[x y 1]' = 0
bug.mline = homline(bug.start(1), bug.start(2), ...
bug.goal(1), bug.goal(2));
bug.mline = bug.mline / norm(bug.mline(1:2));

if opt.animate

35
bug.plot();

bug.plot_mline();
end

% iterate using the next() method until we reach the goal


robot = bug.start(:);
bug.step = 1;
path = [];
while true
if opt.animate
plot(robot(1), robot(2), 'g.', 'MarkerSize', 12);
if opt.current
h = plot(robot(1), robot(2), 'ko', 'MarkerSize', 8);
end
drawnow
if ~isempty(opt.movie)
anim.add();
end
if opt.current
delete(h)
end
end

% move to next point on path


robot = bug.next(robot);

% are we there yet?


if isempty(robot)
% yes, exit the loop
break
else
% no, append it to the path
path = [path robot(:)];
end
end

if ~isempty(opt.movie)
anim.close();
end

% only return the path if required


if nargout > 0
pp = path';
end
end

36
function plot_mline(bug, ls)

% parameters of the M-line, direct from initial position to goal


% as a vector mline, such that [robot 1]*mline = 0

if nargin < 2
ls = 'k--';
end
dims = axis;
xmin = dims(1); xmax = dims(2);
ymin = dims(3); ymax = dims(4);

hold on
if bug.mline(2) == 0
% handle the case that the line is vertical
plot([start(1) start(1)], [ymin ymax], 'k--');
else
x = [xmin xmax]';
y = -[x [1;1]] * [bug.mline(1); bug.mline(3)] / bug.mline(2);
plot(x, y, ls);
end
end

function n = next(bug, robot)

% implement the main state machine for bug2


n = [];
robot = robot(:);
% these are coordinates (x,y)

if bug.step == 1
% Step 1. Move along the M-line toward the goal

if colnorm(bug.goal - robot) == 0 % are we there yet?


return
end

% motion on line toward goal


d = bug.goal-robot;
if abs(d(1)) > abs(d(2))
% line slope less than 45 deg
dx = sign(d(1));
L = bug.mline;
y = -( (robot(1)+dx)*L(1) + L(3) ) / L(2);
dy = round(y - robot(2));

37
else
% line slope greater than 45 deg
dy = sign(d(2));
L = bug.mline;
x = -( (robot(2)+dy)*L(2) + L(3) ) / L(1);
dx =round(x - robot(1));
end

% detect if next step is an obstacle


if bug.isoccupied(robot + [dx; dy])
bug.message('(%d,%d) obstacle!', n);
bug.H(bug.j,:) = robot; % define hit point
bug.step = 2;
% get a list of all the points around the obstacle
bug.edge = edgelist(bug.occgridnav == 0, robot);
bug.k = 2; % skip the first edge point, we are already there
else
n = robot + [dx; dy];
end
end % step 1

if bug.step == 2
% Step 2. Move around the obstacle until we reach a point
% on the M-line closer than when we started.
if colnorm(bug.goal-robot) == 0 % are we there yet?
return
end

if bug.k <= numcols(bug.edge)


n = bug.edge(:bug.k); % next edge point
else
% we are at the end of the list of edge points, we
% are back where we started. Step 2.c test.
error('robot is trapped')
return;
end

% are we on the M-line now ?


if abs( [robot' 1]*bug.mline') <= 0.5
bug.message('(%d,%d) moving along the M-line', n);
% are closer than when we encountered the obstacle?
if colnorm(robot-bug.goal) < colnorm(bug.H(bug.j,:)'-bug.goal)
% back to moving along the M-line
bug.j = bug.j + 1;
bug.step = 1;
return;

38
end
end
% no, keep going around
bug.message('(%d,%d) keep moving around obstacle', n)
bug.k = bug.k+1;
end % step 2
end % next

function plan(bug)
error('RTB:Bug2:badcall', 'This class has no plan method');
end

end % methods
end % classdef

39
REFERENCES

40
7.1 References
[1] MQ2GasSensor[online]. available” Components101.com/mq2-gas-
sensor”. [Accessed 2017]

[2] Arduino Uno R3 [online]. available” https://store.arduino.cc/usa/arduino-


uno-rev3”. [Accessed 2017]

[3] GSMsim900[online].available’’https://simcom.ee/documents/
SIM900/SIM900_AT%20Command%20Manual_V1.11.pdf’’[Accessed
2017]

[4] A.R. Khoogar and J. K. Parker. “Obstacle Avoidance of Redundant


RIanipulators Lysing Genetic Algorithms,” Proc. IEEE International
Conference on Robotics and Automaton, 1991.

[5] Fundamentals of Cellular Network Planning and Optimization, Ajay R.


Mishra, John Wiley & Sons, 047086267Xbps

[6] Kam, M., Zhu, X., Kalata, P.: Sensor Fusion for Mobile Robot Navigation.
Proceedings of the IEEE 85(1), 108–119 (1997) R. L. Haupt, An
introduction to genetic algorithms for electromagnetics, IEEE AP-S Mag.
37:7–15 (April 1995).

[7] Sgorbissa, A., Zaccaria, R.: Planning and Obstacle Avoidance in Mobile
Robotics. Robotics and Autonomous Systems vol. 60(4), pp. 628–638
(2012)

[8] Martin, F. Robotic Explorations, a Hands-On Introduction to Engineering.


Upper Saddle River, New Jersey: Prentice Hall, 2001

[9] Soh Chin Yun1, S. Parasuraman1, and V. Ganapathy21 School of


Engineering, Monash University, Sunway Campus, Jalan Lagoon Selatan,
46150 Bandar Sunway, Malaysia2 Department of Electrical Engineering,
Faculty of Engineering, University of Malaya, 50603 Kuala Lumpur,
Malaysia

[10] Genetic Algorithms in Electromagnetics, Randy L. HauptApplied


Research Laboratory Pennsylvania State University

[11] phi. corke, robotics, vision & control: fundamental algorithms in


mat lab. second edition. springer, 2017. isbn 978-3-319-54413-7.

41
[12] Iqbal, J., Nabi, R.U., Khan, A.A., Khan, H.: A Novel Track-Drive
Mobile Robotic Framework for Conducting Projects on Robotics and
Control Systems. Life Sci J, ISSN 1097-8135, vol. 10 (3), pp.130-137
(2013)

[13] Quinlan, S., Khatib, O.: Elastic Bands: Connecting Path Planning
and Control, IEEE International Conference on Robotics and Automation
(ICRA), pp. 802–807 (1993)

[14] N. Ayache and 0. D. Fougera’s, “Maintaining representations of the


environment of a mobile robot,” Autonomous Robot Vehicles. Berlin:
Springer-Verhg, 1990.

[15] Saffiotti,A.: Fuzzy Logic in Autonomous Robotics: Behavior


Coordination. In: Proceedings of the 6th IEEE Int. Conf. on Fuzzy Systems,
Pages, pp. 573–578 (1997)

[16] Tunstel, E., Lippincott, Y., Jamshidi, M.: Behaviour Hirarchy for
Autonomous Mobile Robots - Fuzzy-behaviour Modulation and Evolution.
International Journal of IntelligentAutomation and Soft Computing 3(1),
37–50 (1997)

[17] Elshamli, H. A. Abdullah and S. Areibi,“Genetic algorithm for


dynamic path planning”. In:Proc. Canadian Conf. Elect. and Comput. Eng.
Niagara Falls, Vol.2, May 2-5, 2004, pp: 677-680, ISBN: 0-7803-8253-
6/04/$/7.00© 2004 IEEE.

[18] Khatib, “Real-time obstacle avoidance for manipulators and mobile


robots, “Proceedings of the IEEE International Conference Robotics and
Automation, vol. 5, no. 1, pp. 90-98, 1986. Research, ISSN 0973- 4562
Vol. 10 Issue No.87, pp:139-150, (2015).

42

Вам также может понравиться