0% found this document useful (0 votes)
377 views69 pages

Design of IoT Based Gas Leakage Detection Andsafety System

This document presents a research project submitted in partial fulfillment of the requirements for a B.Eng. (Honors) degree in Electronics Engineering (Industrial) at Sudan University of Science and Technology. The project discusses the design of an IoT-based gas leakage detection and safety system using an Arduino microcontroller to control components and provide quick response in the event of detected gas or fire. The system is able to detect gas or flame using various sensors, trigger an alarm, shut off gas valves, operate ventilation fans, and send alerts to responsible parties.

Uploaded by

Menen Simmon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
377 views69 pages

Design of IoT Based Gas Leakage Detection Andsafety System

This document presents a research project submitted in partial fulfillment of the requirements for a B.Eng. (Honors) degree in Electronics Engineering (Industrial) at Sudan University of Science and Technology. The project discusses the design of an IoT-based gas leakage detection and safety system using an Arduino microcontroller to control components and provide quick response in the event of detected gas or fire. The system is able to detect gas or flame using various sensors, trigger an alarm, shut off gas valves, operate ventilation fans, and send alerts to responsible parties.

Uploaded by

Menen Simmon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

Sudan University of Science and Technology

College of Engineering

School of Electronic Engineering

Design of IoT Based Gas Leakage Detection and


Safety System

A Research Submitted in Partial fulfillment for the requirements of the


Degree of B.Eng. (Honors) in Electronics Engineering (Industrial)

Prepared by:

1. Malaz Mansour Jadkream

2. Muna Abdelhakim Elhag Omar

3. Shahrazad Abdallah Mahmoud

Supervised by:

Dr. Fadul Ahmed Mohamed Hussain

March 2022
‫استهالل‬

‫‪I‬‬
DEDICATION

As well as everything that we do, we would be honored to


dedicate this work to our parents for their emotional support, our
brothers, our sisters and our friends, our college, especially our friend
Iqan Haidar, whose has been a constant source of inspiration for us.
Without their love and support this project would not have been made
possible.

II
ACKNOWLEDGEMENT

Thanking Allah before and after... First and foremost; the greatest
thanking to our teachers for their continuous support... and for their great
efforts, they were the best guide and monitor... Finally; thanking our
colleagues and workers at the College of Engineering for their
cooperation...

III
ABSTRACT

The gas and fire detection system plays an important role in


saving lives and properties and maintaining and monitoring a safe
environment and situation. This project discusses the effective method to
use the microcontroller (Arduino) to control the other components to
provide a gas and fire safety system. From the project done, the system is
giving quick response to current situation. System can detect gas and
flame sensed by the detectors. When the sensors from each level
triggered individually, the gas valve turn off, the ventilation fan, the
alarm system operates and it shows in the control panel liquid crystal
display alert, a message will be send to the person in charge of the
factory in case of gas leakage, and make a call in case of fire detection,
finally the factory power is shut down.

IV
‫المستخلص‬

‫إٌ ألَظًة اكتشبف انحشائك و انغبصات انًتسشبة دوس يهى فً انحفبظ عهى األسواح‬
‫وانًًتهكبت و انحفبظ عهى بٍئة آيُة و يشالبتهب‪ .‬هزا انًششوع ٌُبلش أنٍة تحكى األسدوٌُى‬
‫ببعط انعُبصش الكتشبف انحشائك و انغبصات انًتسشبة‪ ,‬هزا انُظبو رو استجببة سشٌعة نحبالت‬
‫انحشائك و انغبصات انًتسشبة عٍ طشٌك استخذاو حسبسبت حشائك و غبصات‪ ,‬عُذيب تستشعش‬
‫هزِ انحسبسبت ٌمىو انُظبو بئغالق يفتبح تأيٍٍ انغبص‪ ,‬و تشغٍم يشاوح شفط انهىاء نتمهٍم‬
‫تشكٍض انغبص انًتسشة أو دخبٌ انحشائك‪ ,‬و يٍ ثى تشغٍم َظبو اإلَزاس انزي ٌتضًٍ شبشة‬
‫تعشض انحبالت انطبسئة‪ .‬فً حبنة تسشة انغبص ٌتهمى انًسؤول سسبنة َصٍة تُبٍهٍة‪ ,‬أيب فً‬
‫حبنة انحشائك ٌتهمى يكبنًة هبتفٍة‪.‬‬

‫‪V‬‬
CONTENTS

Title Page

‫استهالل‬ I

Dedication II

Acknowledgement III

Abstract IV

‫انًستخهص‬ V

Contents VI

List of Tables VII

List of Figures VIII

Chapter One 1

Introduction 1

Preface 1

Critical Systems 2

Safety Critical 2

Business Critical 2

Mission Critical 2

Security Critical 3

Problem Statement 3

Proposed Solution 3

The Objectives 3

Methodology 4

Thesis layout: 4

VI
Chapter Two 5

background and related work 5

2.1 Background 5

2.2 Safety Critical System 6

2.2.1 Process Safety System or Process Shutdown System


(PSD) 6

2.2.2 Safety Shutdown System 7

2.3 Alarm systems 8

2.3.1 Alarm Control Panel 8

2.3.2 Detectors 9

2.3.2.1 Gas Detectors 9

2.3.2.1.1Gas Sensor (MQ-2) 11

2.3.2.1.2.Gas Sensor (MQ-7) 12

2.3.2.2 Beam Detectors 13

2.3.4 Alarm Unit 13

2.4.1 Fire Sprinklers System 14

2.4.2 Temperature Sensor 15

2.4.3 Flame Sensor 15

2.4.4 Liquid Crystal Display (LCD) 16

2.4.5 Wireless Module (SIM900) 17

2.4.6 Arduino Mega 17

2.4.7 WiFi Module (MODMCU ESP8266) 18

2.4.8 Relay 19

2.4.8.1 Solid State Relay 19


2.4.9 Solenoid Valve 20

2.4.10 Ventilation Fan 21

2.4.11 Buzzer 22

2.4.12 Three Phase AC Contactor 23

2.5 Internet of Things (IoT) 24

2.6 The Cloud 25

2.6.1 Things-board Cloud 27

2.7 Related Work 28

Chapter Three 33

Methodology 33

3.1 Overview 33

3.2 Simulation 34

3.3 System Interfacing 35

3.3.1 Interfacing Gas Sensor (MQ-2, MQ-7) with Arduino 35

3.3.2 Interfacing Flame and Temperature Sensors with Arduino35

3.3.3 Interfacing the First Relay Circuit with Arduino 36

3.3.4 Interfacing the Second Relay Circuit with Arduino 36

3.3.5 Interfacing the Third Relay Circuit with Arduino 36

3.3.6 Interfacing the Liquid Crystal Display (LCD) with


Arduino 36

3.3.7 Interfacing the Ventilation Fan with Arduino 37

3.3.8 Interfacing the Buzzer with Arduino 37

3.3.9 Interfacing the Light Emitting Diode (LED) (Red, Green)


with Arduino 37
3.3.10 Interfacing the Wireless Module (GSM900) with Arduino37

3.4 System Operation 38

3.5 System Work Flow 40

Chapter Four 41

System result 41

4.1 System Operating Condition 41

4.1.1 Fire is Detected 41

4.1.2 Gas is Detected 42

4.1.3 Fire and Gas is Detected 42

4.1.4 No Detection 43

4.2 Results 44

4.2.1 Case One 44

4.2.2 Case Two 45

4.2.3 Case Three 46

4.2.4 Case Four 46

Chapeter Five 48

Conclusion and Recommendation 48

5.1 Conclusion 48

5.2 Recommendation 48

References 49

Appendix A
LIST OF TABLES

Title Page

Table 2-1: Gas Sensors 10

VII
LIST OF FIGURES

Title Page

Figure 2-1: Alarm Control Panel 9

Figure 2-2: Gas Sensor (MQ-2) 12

Figure 2-3: Gas Sensor (MQ-7) 12

Figure 2-4: Beam Detectors 13

Figure 2-5: Alarm Unit 14

Figure 2-6: Fire Sprinklers System 14

Figure 2-7: Temperature Sensor 15

Figure 2-8: Flame Sensor 16

Figure 2-9: Liquid Crystal Display (LCD) 16

Figure 2-10: Wireless Module (SIM900) 17

Figure 2-11: Arduino Mega 18

Figure 2-12: WiFi Module (MODMCU ESP8266) 18

Figure 2-13: Relay Diagram 19

Figure 2-14: Relay 19

Figure 2-15: Solid State Relay 20

Figure 2-16: Solenoid Valve 21

Figure 2-17: Ventilation Fan 22

Figure 2-18: Buzzer 22

Figure 2-19: Three Phase AC Contactor Diagram 23

Figure 2-20: Three Phase AC Contactor 24

Figure 2-21: Internet of Things (IoT) System 25

VIII
Figure 2-22: The Cloud 25

Figure 2-23: Models of Cloud 27

Figure 2-24: Things-board Cloud 27

Figure 3-1: System Block Diagram 34

Figure 3-2: Simulation System 35

Figure 3-3: System Work Flow 40

Figure 4-1: Fire Detection 41

Figure 4-2: Gas Detection 42

Figure 4-3: Fire and Gas Detection 43

Figure 4-4: No Detection 44

Figure 4-5: SMS Gas Alarm 45

Figure 4-6: Liquid Crystal Display (LCD) Gas Alarm 45

Figure 4-7: GSM Call Alarm 46

Figure 4-8: Liquid Crystal Display (LCD) Fire Alarm 46

Figure 4-9: Fire and Gas Alarm 46

Figure 4-10: Cool Temperature 47


CHAPTER ONE

INTRODUCTION

Preface

Gas leakage leads to various accidents resulting in both material


loss and human injuries. The risk of explosion, firing and suffocation are
based on their physical properties such toxicity, flammability, etc. The
number of deaths due to explosion of gas cylinders and gas pipelines has
been increasing in recent years. The reason for such explosion is due to
substandard cylinders, old valves, worn out regulators and lack of
awareness in handling gas cylinders or leakage in gas pipelines due to
creaks or the effect of heat. Flammable gases are used as fuel in many
applications like homes, hostels, industries, automobiles, vehicles. The
serious problem of this gas‟s leakage is that they are heavier than air;
these gases do not disperse easily. It may lead to suffocation when
inhaled and may lead to explosion. Due to the explosion of gases, the
number of deaths has been increased in recent years. To avoid this
problem there is a need for a system to detect the gas leakage. The
situation should be taken before any fire/blast could happen because of
its highly sensitive and flammable nature it can cause great disaster if
any fire source is exposed to the gas so special countermeasure should be
taken for the gas leakage. Gas leak detection is the process of identifying
potentially hazardous gas leaks by means of various sensors. This paper
presents a gas leakage detection and alert system to avoid fire accidents
and to provide safety. The infamous Bhopal gas tragedy of 1984, which
claimed the lives of thousands, is one of the major accidents due to gas

1
leakage[1]. And another instance, the HPCL refinery disaster destroyed
the lives of many families.

Critical Systems

A critical system is a system which must be highly reliable and


retain this reliability as they evolve without incurring prohibitive costs,
and whose failure could threaten human life, the system‟s environment
or the existence of the organization which operates the system.

Safety Critical

Is a system whose failure or malfunction may result in death or


serious injury to people, loss or severe damage to equipment/property,
environmental harm, a safety-critical system can be a control system for
a chemical manufacturing plant or aircraft.

Business Critical

A system whose failure may result in the failure of some goal-


directed activity and is essential to the survival of a business or
organization, an example of a mission-critical system is a navigational
system for a spacecraft.

Mission Critical

A mission critical system also known as mission essential


equipment and mission critical application is any system that is essential
to the survival of an organization and the operation of the organization is
affected if the system fails or is interrupted in any way, an examples of
mission critical systems include control systems for aircraft, electricity
grid systems, and emergency communications systems.

2
Security Critical

Safety critical systems (SCS) are systems designed with the intent
of curbing the effects of an accident from a hazardous event. This can be
implemented in the aviation industry, the medical profession.

Problem Statement

The gas and fire safety system in Saria batteries factory which
uses different toxic gases that can result in a hazardous work
environment if a gas leakage due to creaks in pipelines or old valves in
gas cylinders occurred, it can also lead to explosions when exposed to
heat or sparks, which could result in great losses both material and
human lives.

Proposed Solution

A gas detection and monitoring system based on IoT using MQ-2


and MQ-7 sensors and Arduino microcontroller, allowing remote
monitoring of the system, and notifying the person in charge when the
gas exceeds a threshold level or a fire is detected through SMS or a
phone call.

The Objectives

1- activate the safety system to reduce the leakage gas and fire
accident by implementing gas concentration detection and fire
detection

2- make the work environment healthier by reducing the toxic gas

3
Methodology

To build system that is able to detect gas leakage, Fire detection


and alerting its owner to take precautions. We start building the
hardware part which consist of Flame Sensor, Gas sensors (MQ-2 and
MQ-7) and temperature sensor, All these sensors are collecting the
environment data as Input, the feedback from this data is shown in the
actuators which are gas valve, electrical panel, fire fighting system,
ventilation fan, alarm lamp, liquid crystal display and GSM900 Module,
these actuators will turn on/off depending on the sensor data. The
interface GSM Module SIM900 is able to connect with a cellular
network. The internet of things part consist of WI-FI Module (Nodemcu-
ESP8266) and Thingsboard cloud in this part we send sensor data to be
stored in the cloud server so we can get it back when we need it .

Thesis layout:

The Chapters of the Research are Organized as Follows:

Chapter one gives a general overview for the system, this chapter
also includes the problem statement, objectives and the methodology
which was followed to solve the research problem. Chapter Two gives a
summary of the background and the related literature up to the state-of-
the-art regarding the problem and its possible solutions. Chapter Three
shows the methodology and simulation setting up. Chapter Four involves
the results which are analyzed and interpreted to evaluate the proposed
algorithms and the system performance. Finally, Chapter Five the thesis
is concluded in the conclusion along with suggestions for further future
research.

4
CHAPTER TWO

BACKGROUND AND RELATED WORK

2.1 Background

An estimated average of 4,200 home structure fires per year


started with the ignition of natural gas. These fires caused an average of
40 deaths per year. US Local fire departments responded to an average
of 125,000 natural gas or LPG-Gas leaks per year that did not result in
fires in or at home properties in 2012-2016. Since 2007, these incidents
have generally been increasing. Also, gas leak can cause various health
issues such as natural gas poisoning which is caused by High levels of
natural gas exposure, which is characterized by fatigue, severe
headaches, memory problems, loss of concentration, nausea, loss of
consciousness, and suffocation. Early identification of gas leakage can
prevent hazardous results, a hazard can be material, or an activity, or a
procedure that can cause harm to human, or environment, or incur
economical loss. After studying the related works for similar topics, the
proposed system was designed. An MQ-2 and MQ-7 sensors detects the
gas level and if the sensor value is greater than the threshold value then it
will alarm the owner through GSM signal and turns on an alarm to alert
nearby people and display the gas level on LCD to alert the users. It will
turn on an exhaust ventilation fan to transfer the gas to an open space
which will eventually dissolve into normal air pressure very quickly, and
a relay will cut off the main power supply and the valve is turned off to
prevent further leakage. To avoid any accident we find many kind of
safety system.

5
2.2 Safety Critical System

Safety-critical systems are those systems whose failure could


result in loss of life, significant property damage or damage to the
environment. There are many well-known examples in application areas
such as medical devices, aircraft flight control, weapons and nuclear
systems. Many modern information systems are becoming safety-critical
in a general sense because financial loss and even loss of life can result
from their failure. Future safety-critical systems will be more common
and more powerful. From a software perspective, developing safety-
critical systems in the numbers required and with adequate dependability
is going to require significant advances in areas such as specification,
architecture, verification and the software process. The very visible
problems that have arisen in the area of information system security
suggest that security is a major challenge too. For examples: Circuit
breaker, emergency services dispatch system, electricity exaggeration
transmission and distribution, fire alarm and fire sinker[2].

Types of Safety Critical System:

2.2.1 Process Safety System or Process Shutdown System (PSD)

PSD Is defined as the automatic isolation and the activation of all


part of a process, during a PSD the process remain pressurized. Basically
PSD consist of field mounted sensors. Valves and trip relays, a system
logic unit for processing of incoming signals, alarm and MHI units. The
system is able to process all input signals and activating output in
accordance with the applicable cause and effect matrix chart

6
Typical Action from PSD Systems:

1. Shutdown the whole process.


2. Shutdown part of the process.
3. Depressurize/Blow down parts of the process.

2.2.2 Safety Shutdown System

The safety shutdown system (SSS) shall shut down the facilities to
a safe state in case of an emergency situation, thus protecting personnel,
the environment and the asset. The safety shutdown system shall manage
all inputs and outputs relative to emergency shutdown (ESD) functions
(environment and personnel protection). This system might also be fed
by signals from the main fire and gas system. it has two types:

1) Emergency Shutdown (ESD)

ESD Is designed to minimize the consequences of emergency


situations, such as outbreak of fire in gas filled areas or areas which may
otherwise be hazardous.

An emergency shutdown system for a process control system


includes an emergency shutdown (ESD) valve and an associated valve
actuator. An emergency shutdown (ESD) controller provides output
signals to the ESD valve in the event of a failure in the process control
system, a solenoid valve responds to the ESD controller to vent the
actuator to a fail state, a digital valve controller (DVC) test strokes the
ESD valve. An impedance booster device enables the dc powering of the
solenoid valve and the DVC over a two wire line while still permitting
digital communication over the same two wire line.

7
Typical Actions from an Emergency Shutdown System:

• Shutdown of part systems and equipment.

• Isolate electrical equipment.

• Prevent escalation of events.

• Depressurize / Blow down.

• Emergency ventilation control.

• Close watertight doors and fire doors.

• Centralized Project Development for Both Safety and Process


needs.

2) Emergency Depressurization (EDP) System

Depressurization of any equipment must reduce its pressure to a


certain amount and at a given time. This differs with the type of
depressing: high rate or low rate depressurization.

2.3 Alarm systems

Alarm systems used in factories are part of the safety systems, the
alarm System consist of:

2.3.1 Alarm Control Panel

It is a digital control unit receives the signals from the detectors. It


converter this signal into an alarm, and sometimes an alarm and lights,
by using bells or horns with or without lights, such as Fire Alarm Main
Control Panel which is an electronic device that controls all devices
associated from receiving signals from all types of detectors to sounding

8
the necessary warning sirens and carrying out the tasks assigned to it.
Shown figure (2-1):

Figure 2-1: Alarm Control Panel

2.3.2 Detectors

They are detectors and sensors connected to the control panel, to


detect the fire and gas and send a signal to the control panel. There are
many types of sensors or detectors used in the alarm systems such as:

2.3.2.1 Gas Detectors

It is a device that detects the presence of gases in an area, often as


part of a safety system. It works when there is a dropout of gases in the
building, it detects is there any gases in the building, and therefore sends
a signal to the control panel, one of the common gas sensor detection is
MQ sensors.MQ gas sensors are a family of sensors which are used to
detect a wide variety of gases like alcohol, smoke, methane, LPG,
hydrogen, NH3, Benzene, Propane etc. These sensors are made up of
electrode which is coated with a sensing material, and it is heated to
make it more reactive and sensitive. We use in our project MQ-2, MQ-7
gas sensors. shown Table (2-1):

9
Table 2-1: Gas Sensors

Sensor Detects Heater Voltage

MQ-2 Methane, Butane, LPG, smoke 5V

MQ-3 Alcohol, Ethanol, smoke 5V

MQ-4 Methane, CNG Gas 5V

MQ-5 Natural gas, LPG 5V

MQ-6 LPG, butane gas 5V

Alternating 5V
MQ-7 Carbon Monoxide
and 1.4V

MQ-8 Hydrogen Gas 5V

Alternating 5V
MQ-9 Carbon Monoxide, flammable gasses.
and 1.4V

MQ131 Ozone 6V

Air Quality (Benzene, Alcohol,


MQ135 5V
smoke)

MQ136 Hydrogen Sulfide gas 5V

MQ137 Ammonia 5V

10
Sensor Detects Heater Voltage

Benzene, Toluene, Alcohol, Acetone,


MQ138 5V
Propane, Formaldehyde gas, Hydrogen

MQ214 Methane, Natural gas 6V

MQ216 Natural gas, Coal gas 5V

MQ303A Alcohol, Ethanol, smoke 0.9V

MQ306A LPG, butane gas 0.9V

Alternating 0.2V
MQ307A Carbon Monoxide
and 0.9V.

Alternating 0.2V
MQ309A Carbon Monoxide, flammable gasses
and 0.9V

MG811 Carbon Dioxide (CO2) 6V

AQ-104 Air quality

2.3.2.1.1Gas Sensor (MQ-2)

MQ-2 gas sensor is an electronic sensor used for sensing the


concentration of gases in the air such as LPG, propane, methane,
hydrogen, alcohol, smoke and carbon monoxide, it is also known as
Chemi-resistor. It contains a sensing material whose resistance changes
when it comes in contact with the gas. This change in the value of
resistance is used for the detection of gas[3]. Shown figure (2-2):

11
Figure 2-1: Gas Sensor (MQ-2)

2.3.2.1.2.Gas Sensor (MQ-7)

We use MQ-7 for sensing the carbon monoxide (CO)


concentrations in the air. The MQ-7 can detect CO-gas concentrations
anywhere from 10 to 500ppm It make detection by method of cycle high
and low temperature, and detect CO when low temperature (heated by
1.5V)[4]. Shown figure (2-3):

Figure 2-2: Gas Sensor (MQ-7)

12
2.3.2.2 Beam Detectors

They are used in the high places or the opening places such as:
places without roofs and the opening places for marketing. It consists of
a sender and receiver, the sender sends rays to the receiver, when there is
a fire the smoke cut this rays and the sensor will work. Shown figure (2-
4):

Figure 2-4: Beam Detectors

2.3.4 Alarm Unit

Used to make a sound to inform the workers in the faculty or


people in the building there is emergency situation, there are many
elements used in the alarm such as: Horns, Bells, Sirens and LED
indicator. Shown figure (2-5):

13
Figure 2-5: Alarm Unit

2.4.1 Fire Sprinklers System

It is an important part in the safety system in the fire protection, it


consist of a water supply and distribution system along the pipelines, it
has many types like wet pipe, wet pipe antifreeze, dry pipe. Shown
figure (2-6):

Figure 2-6: Fire Sprinklers System

14
2.4.2 Temperature Sensor

1. We use DHT11 (Temperature and humidity sensor) in our system


the sensor comes with a dedicated NTC to measure temperature
and an 8-bit microcontroller to output the values of temperature
and humidity as serial data. The sensor is also factory calibrated
and hence easy to interface with other microcontrollers. The
sensor can measure temperature from 0°C to 50°C and humidity
from 20% to 90% with an accuracy of ±1°C and ±1% , operating
voltage from 3.5V to 5.5V and operating current from 0.3mA
(measuring) to 60uA. Shown figure (2-7):

Figure 2-7: Temperature Sensor

2.4.3 Flame Sensor

This sensor uses the infrared flame flash method, which allows the
sensor to work through a coating of oil, dust, water vapor, otherwise ice.
The flame detection response can depend on its fitting. It is used in alarm
systems, natural gas lines and propane & a fire suppression system. The
response of these sensors is faster as well as more accurate compare with
a heat or smoke detector because of its mechanism while detecting the
flame. Shown figure (2-8):

15
Figure 2-8: Flame Sensor

2.4.4 Liquid Crystal Display (LCD)

Liquid Crystal Display is a type of flat panel display which uses


liquid crystals in its primary form of operation. LCDs allowed displays
to be much thinner than cathode ray tube (CRT) technology. LCDs
consume much less power than LED and gas-display displays because
they work on the principle of blocking light rather than emitting it.
Where an LED emits light, the liquid crystals in an LCD produce an
image using a backlight. Shown figure (2-9):

Figure 2-9: Liquid Crystal Display (LCD)

16
2.4.5 Wireless Module (SIM900)

SIM900 Modem is built with Dual Band GSM/GPRS based


SIM900 modem from SIMCOM. It operates from 3.4V to 4.5V supply
range. It works on frequencies 850/ 900/ 1800 MHz. SIM900 can search
these bands automatically. The frequency bands can also be set by AT
Commands. The baud rate is configurable from 19200 through AT
command. The GSM/GPRS Modem is having internal TCP/IP stack to
enable the user to connect with internet via GPRS. SIM900 is an ultra-
compact and reliable wireless module. Shown figure (2-10):

Figure 2-10: Wireless Module (SIM900)

2.4.6 Arduino Mega

The Arduino Mega 2560 is a microcontroller board based on the


ATmega2560. It has 54 digital input/output pins (of which 15 can be
used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial
ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an
ICSP header, and a reset button. Arduino mega was chosen because it is
easy to use and has 16 analog input pins because the sensors provide
analog data and the factory environment is analog, and because it has
more pins compared to Arduino UNO, and it is better at executing codes
used for connecting to the cloud. Shown figure (2-11):
17
Figure 2-11: Arduino Mega

2.4.7 WiFi Module (MODMCU ESP8266)

The NodeMCU (Node MicroController Unit) is open-source


software and hardware development environment built around an
inexpensive System-on-a-Chip (SoC) called the ESP8266. The
ESP8266, designed and manufactured by Espressif Systems, contains the
crucial elements of a computer: CPU, RAM, networking (WiFi), and
even a modern operating system and SDK .NODMCU has 4 ground pin
and 4 power pin one is Vin to supply the nodmcu directly and the other
three pins is output to feed external component , has two control pin
(enable and reset) has I2C pins ,GPOI pin ,UART pin ,PWM pin ,SPI
pin, ADC pin , and SIDO pin [5]. Shown figure (2-12):

Figure 2-12: WiFi Module (MODMCU ESP8266)

18
2.4.8 Relay

Relay works on the principle of an electromagnetic attraction.


When the circuit of the relay senses the fault current, it energizes the
electromagnetic field which produces the temporary magnetic field, this
magnetic field moves the relay armature for opening or closing the
connections, resulting in the control of the pump. Shown figures (2-13/2-
14):

Figure 2-13: Relay Diagram

Figure 2-14: Relay

2.4.8.1 Solid State Relay

Solid State Relays are semiconductor equivalents of the


electromechanical relay and can be used to control electrical loads
19
without the use of moving parts, but instead uses the electrical and
optical properties of solid state semiconductors to perform its input to
output isolation and switching functions. Solid state relays can be
designed to switch both AC and DC currents by using an SCR,
TRIAC[6]. Shown figure (2-15):

Figure 2-15: Solid State Relay

2.4.9 Solenoid Valve

Is an electrically controlled valve, the valve features a solenoid,


which is an electric coil with a movable ferromagnetic core (plunger) in
its center. In the rest position, the plunger closes off a small orifice. An
electric current through the coil creates a magnetic field. The magnetic
field exerts an upwards force on the plunger opening the orifice. It will
shut-down the gas valve when it receive command signal from the
Arduino[7]. Shown figure (2-16):

20
Figure 2-16: Solenoid Valve

2.4.10 Ventilation Fan

Purpose of the ventilation fan is to reduce the concentration of gas


when gas leak and smoke when a fire accident happened. Industrial fans
provide air and gas movement, replacing stale and contaminated air with
fresh air, they are essential in some factory settings where they reduce
high heat levels and prevent air stagnation when air conditioners are too
expensive or aren't an option. Industrial fans also help remove smoke
and help regulate gaseous fumes in chemical industries. Shown figure (2-
17):

21
Figure 2-17: Ventilation Fan

2.4.11 Buzzer

A buzzer or beeper is an audio signaling device; it is generally


used as sound alarms. It generates sound in a frequency range of 1 to 7
kHz as an audio indication. In this frequency range, the hearing threshold
is at maximum. Shown figure (2-18):

Figure 2-18: Buzzer

22
2.4.12 Three Phase AC Contactor

A three-phase contactor is an electronic device used to turn power


on or off at a three-phase load. These devices are used when the voltage
requirements of the load exceed the power-handling capability of a
mechanical relay, they do not use a physical switch for switching. A
contactor uses a low-voltage signal to control the high-voltage circuit[8].
Shown figures (2-19/2-20):

Figure 2-19: Three Phase AC Contactor Diagram

23
Figure 2-20: Three Phase AC Contactor
2.5 Internet of Things (IoT)

The Internet of things refers to a type of network to connect


anything with the Internet based on stipulated protocols through
information sensing equipment to conduct information exchange and
communications in order to achieve smart recognition, positioning,
tracing, monitoring, and administration. Internet of things (IoT) is a
global infrastructure for the information society, enabling advanced
services by interconnecting (physical and virtual) things based on
existing and evolving interoperable information and communication
technologies. The IoT improve the safety of the factory by monitoring
Possible Risks by analyzing data and using it to develop occupational
health and safety strategies for employees and increase understanding of
working environments with the help of connected sensors[9]. Shown
figure (2-21):

24
Figure 2-21: Internet of Things (IoT) System
2.6 The Cloud

"The cloud" refers to servers that are accessed over the


Internet, and the software and databases that run on those servers.
Cloud servers are located in data centers all over the world. By
using cloud computing, users and companies do not have to
manage physical servers themselves or run software applications
on their own machines[10]. Shown figure (2-22):

Figure 2-22: The Cloud

25
The cloud enables users to access the same files and applications
from almost any device, because the computing and storage takes place
on servers in a data center, instead of locally on the user device.

The Main Service Models of Cloud Computing:

Software-as-a-Service (SaaS): Instead of users installing an


application on their device, SaaS applications are hosted on cloud
servers, and users access them over the Internet. Examples of SaaS
applications include Sales-force, Mail-chimp, and Slack.

Platform-as-a-Service (PaaS): In this model, companies don't pay


for hosted applications; instead they pay for the things they need to build
their own applications. PaaS vendors offer everything necessary for
building an application, including development tools, infrastructure, and
operating systems, over the Internet. PaaS examples include Heroku and
Microsoft Azure.

Infrastructure-as-a-Service (IaaS): In this model, a company rents


the servers and storage they need from a cloud provider. They then use
that cloud infrastructure to build their applications. IaaS providers
include Digital-ocean, Google Compute Engine, and Open Stack.

In Recent Years a Fourth Model has Emerged:

Function-as-a-Service (FaaS):FaaS, also known as server less


computing , breaks cloud applications down into even smaller
components that only run when they are needed. Shown figure (2-23):

26
Figure 2-23: Models of Cloud

2.6.1 Things-board Cloud

Things-Board is an open-source IoT platform that enables rapid


development, management and scaling of IoT projects. It enables device
connectivity via industry standard IoT protocols - MQTT, CoAP and
HTTP and supports both cloud and on-premises deployments. Things-
Board combines scalability, fault-tolerance and performance so we will
never lose our data[11]. Shown figure (2-24):

Figure 2-24: Things-board Cloud

27
2.7 Related Work

Many similar projects already exist and they have their own
characteristics and functionality. They all have so many advantages as
well as disadvantages. We can see various descriptions of them below
here.[12]Manish Verma used Raspberry pi 3 model attached with
embedded system with required input and output gas level with the help
of gas sensors. This resulted in a more efficient in operation because it is
connected to a common web page specially built to notify or email the
responsible authority automatically so reduces the stress of constant
monitoring. The choice of using a real time gas leakage monitoring and
sensing the output levels of gas has been clearly observed by the help of
this system.

This project[12] implements a model which sends an email to the


user in case there is a leakage. The model detects the leakage of Liquid
Petroleum, Gas, & Benzene, this cost-effective project uses MQ-6 and
MQ-135 sensors for detecting the aforementioned gases using Arduino -
UNO, WIFI Module ESP8266 and Thing-speak cloud. The real-time
information of the above-mentioned gases are uploaded in the cloud and
displayed in the form of a graph to the user. The prototype of this model
generates an email to the concerned person using IFTTT web service.
An LED is also used as a visual alarm at the site of leakage.

The authors in[13] developed a system to monitor and control the


gas leakage concentration. MQ-6 gas sensor is used for sensing the level
of gas concentration in a closed volume. To monitor the consequences of
environmental changes an IoT platform hosted by “Things-speak”
platform has been introduced. Both robust and cloud-forwarded controls
have been applied to prevent uncontrolled leakage of those gases and

28
auto-ignition. This type of system can be directly applied to the engine
chamber/ fuel chamber of the modern marine vessels using dual fuel
power cycle with LPG/LNG as secondary fuel-flamer. The results from
the experiments clearly indicate satisfactory actuation speed and
accuracy. The trials performed by the authors showed about 99%
efficiency of signal transmission and actuation.

The authors of this paper[14] presented a project that deals with


monitoring LPG leakage along with administrative alert by giving buzzer
sound, switching on specified relay(s) and sending an alert message to
administrator(s) to decide about the precaution measures. For this
purpose, gas leakage concentration is sensed by gas sensor (MQ-6)
which sends the data (analog) to the controller (NodeMCU) where the
analog value is subjected to a sequential conversion to predict the
probable intensity of gas inside the control volume and on crossing a
reference threshold value (set by administrator/operator) the controller it
switches „ON‟ the relay(s) and buzzer(s) alerting to the
administrator/operator of the plant (Industry/Home) including an extra
control-option through manual control utilizing the IoT server to prevent
accidents from the leakage.

This gas detection and alert system[15] will not only alert us of the
leakage but will also mechanically turn off the knob of the gas cylinder
to seize any leakage of gas. Moreover, this system informs the concerned
person by emailing and dropping a message on their mobile. This gives a
larger degree of safety to any gas setup in any circumstances. The
project is determined by using a lighter to collect leaked gas around the
gas sensor after sensing procedure if sensor value is greater than the
threshold value then microcontroller will perform its programmed tasks:

29
1.Immediately turn off the regulator knob to stop further leakage

2.Within 2-4sec the relay will cut off the main power supply.

3.Buzzer starts beeping and a message is displayed on LCD to


alert the users and nearby people.

4.Wi-Fi module will send SMS/e-mail using the cloud to the users.

5.The exhaust fan will fan out all enclosed gas from the
environment. When reset button of MCU pressed the system will get
refreshed

As a control framework, the authors of this paper[16] use


Raspberry pi, MQ gas sensors, and an alert circuit. With the guide of
Things-speak cloud benefits, the yield of the data gathered by the sensors
is stored into the cloud utilizing the Distributed computing (IoT). The
technique for distinguishing conceivably unsafe gas spills by sensors and
directing the bot with the guide of catches is UMV Gas spill discovery.
Ordinarily, these gadgets utilize a hear-able bell to caution people that a
hurtful gas has been recognized. Utilizing the MQ sensors
interconnected to the Raspberry pi, this recognizable proof can be
cultivated. A voltage is delivered in it at whatever point the framework
recognizes gas and is provided as a contribution to the raspberry pi. At
the point when the gas has been discovered, the ringer sounds. This
information is saved in the cloud utilizing IoT. By means of prearranging
a python code and downloading the vital sensor libraries, the whole
activity of the gadget can be refined.

30
In this paper[17], we built an IoT (Internet of Things) based
framework that helps to prevent accident-related to LPG leakage. The
device is an intelligent piece of home computerization framework, as at
the point whenever gas spillage is detected it alarms the customer
through GSM signal phone call and SMS. All the while, it sounds the
buzzers to alert nearby people and it turns on the exhaust fan to transfer
the gas in an open space which will eventually dissolve into normal air
pressure very quickly. The device is capable of identifying the gas and
fire separately so that it can send accurate information directly to the
user via GSM module as quickly as possible. The algorithm is designed
to detect and produce results as quickly as accurately possible to prevent
any accident/blast from happening.

When a gas leakage occurs in an underwater structure[18], the


high-pressure gas jetted from the leak point will form bubbles in the
nearby waters, and the leak point will produce radiation noise with a
sound source level much higher than the environmental background and
certain characteristics. Active sonar detection technology uses image
sonar to detect whether there is a bubble group in the target area to
determine whether there is a leakage and the passive sonar detection
technology uses whether the radiation noise intensity is stronger than the
background noise to determine whether there is a leakage. Compared
with other detection methods, the sonar detection technology is an
external inspection method. It does not need to install the measuring
equipment on the measured object in advance, and only needs to deploy
the sonar array in the detection area, which has the advantages of easy
expansion and easy installation. In addition, compared to active sonar,
passive sonar does not generate acoustic signals to interfere with other

31
acoustic equipment used in the oil production, and passive sonar
systems have lower power consumption and longer lifespan.

This paper[19] presents the design and development of a wireless


gas leakage monitoring system by using Arduino and Zigbee. In this
project, the monitoring system is developed by using LabVIEW GUI. It
is used to display the level of gas concentration in a place through
another remote PC, and via internet server. Hence, it provides benefit to
monitor the condition of a room in a safe distance. Traditionally, the gas
pipeline leakage monitoring system is realized by communication cable
system, therefore the cost of installation and maintenance are very
expensive and difficult as mentioned by jDing . In order to overcome
these restrictions, wireless sensor network is chosen as the best choice in
the situation above. Some papers proposed different types of wireless
sensor network such as radio frequency (RF) transceiver router and
coordinator, general packet radio service (GPRS) network and Zigbee
Nowadays, Zigbee is widely used in the gas leakage monitoring
application field for the real-time monitoring of the potential risk areas.
For the autonomous control system is as a preventive way to stop the
situation becoming worst by shutting down the process automatically. A.
Shrivastava has proposed the system by using stepper motor to turn off
the main power and the gas supply. Whereas in this model, the relay
switch is used to turn off the main power, and the electronic gas valve is
used to turn off the gas supply. At the end, when the gas leakage is
successfully stopped then the whole system will return to initial stage
with the help of reset button.

32
CHAPTER THREE

METHODOLOGY

In this chapter we will discuss the problem solution and the


system components and discuss about each component and its use in the
system.

3.1 Overview

The design of the system consist of three parts, first part is to


sense the gas concentration, fire and temperature measurement. The
second part is to monitor the factory environment using an application,
the third part is to control the system through Arduino mega and relays
for the run-on and run-off of the panel and water pump and automatic
valve.

The proposed system working method start by receiving signals


from the sensors and in the case of a gas leak or fire accident the
Arduino determines the situation based on the sensors data, if there was
gas leak the system will turn off the gas valve using solenoid valve and
turn on the ventilation fans to reduce the gas concentration by using a
mechanical relay and send a SMS to the managers informing them ,
when contacting the gas and an alarm will start to notify people in the
factory, the alarming part consist of a buzzer and LCD that inform the
worker there is gas leak. And in the case of fire detection the system will
turn off the gas valve and turn on the fire-fighting system and ventilation
fans to reduce the smoke and call the managers to inform them there is a
fire and the factory power will shut-down and the alarm system will be
activated. All the sensors data that received by Arduino will be saved on

33
the cloud or database and used to monitor the system through the
application that act like human machine interface (HMI),we can save this
data in the cloud by connecting Arduino to the internet by using
ESP8266. And we use SIM900 to send SMS or make a call to inform the
manager the emergency situation. The system block diagram is shown
in figure (3-1):

Figure 3-3: System Block Diagram


3.2 Simulation

The following figure (3-2) illustrates the system circuit for IoT gas
and fire detection which has been designed using the Proteus program ,
We Considering that the factory is divided into two part each part has
LPG gas sensor (MQ-2), CO gas sensor (MQ-7), flame sensor and

34
temperature sensor ,so when the system detect any gas or fire in any part
in the factory it will decide the right action using the actuators.

Figure 3-2: Simulation System


3.3 System Interfacing

3.3.1 Interfacing Gas Sensor (MQ-2, MQ-7) with Arduino

The gas sensors are connected to the Arduino Mega which is


supplied by 5 DC voltage from the regulator by wiring VCC and GND
pins of gas sensors to VCC and GND pins of Arduino and then the signal
pin of gas sensors are connected to the analog pin in the Arduino (53) for
the first MQ-2 and pin (52) for the second MQ-2 and pin (51) for the
first MQ-7 and pin (50) for the second MQ-7.

3.3.2 Interfacing Flame and Temperature Sensors with Arduino

The Arduino Mega is supplied by 5 DC voltage from the


regulator, then the gas sensors are connected to the Arduino by wiring
VCC and GND pins of gas sensors to VCC and GND pins of Arduino
and then the signal pin of gas sensors are connected to the analog pin in
the Arduino (13) for flame one and pin (11) for flame two and pin (12)
for temperature one and pin (10) for temperature two.

35
3.3.3 Interfacing the First Relay Circuit with Arduino

This circuit controls the gas valve, the circuit construction from
relay RL1, it has five pins. Two are connected to the Arduino pin (6) and
ground (control pins), the third pin is connected to the gas valve negative
point and the fourth pin is connected to the power supply which feed the
gas valve positive point by 5 DC voltage and the fifth pin configuring the
mode relay if it is close or open.

3.3.4 Interfacing the Second Relay Circuit with Arduino

The second relay is used to control the LED which is used in the
simulation to represent the electricity panel, the circuit construction from
relay RL2, it has five pins. Two are connected to the Arduino pin (8) and
ground (control pins), the third pin is connected to the LED negative
point and the fourth pin is connected to the power supply which feed the
LED positive point by 5 DC voltage and the fifth pin configuring the
mode relay if It is close or open.

3.3.5 Interfacing the Third Relay Circuit with Arduino

This circuit controls the motor which represent the fire-fighting


system, which is controlled by the relay RL3, it has five pins. Two are
connected to the Arduino pin (7) and ground (control pins), the third pin
is connected to the motor negative point and the fourth pin is connected
to the power supply which feed the motor positive point by 5 DC voltage
and the fifth pin configuring the mode relay if it close or open.

3.3.6 Interfacing the Liquid Crystal Display (LCD) with Arduino

The VSS pin of the LCD is connected to the ground, while the
VDD pin is fed by 5 DC voltage, the VEE pin is connected to the
monitor with variable screen-lighting control resistance, the RW pin is

36
connected to the ground, the RS pin is connected to the seventh digital
pin of Arduino, the E (enable) is connected to sixth digital pin of
Arduino, the data legs (D4-D7) are connected with pins (25 -22) of
Arduino.

3.3.7 Interfacing the Ventilation Fan with Arduino

The ventilation fan positive input is connected to the Arduino pin


(2) and the negative pin is connected to the ground, it will be active
when it receives a signal from Arduino to reduce the gas concentration
or smoke.

3.3.8 Interfacing the Buzzer with Arduino

It is connected to the Arduino pin (5) and the other side is


connected to the ground, it will be active when it receives a signal from
Arduino to alarm the people in the factory.

3.3.9 Interfacing the Light Emitting Diode (LED) (Red, Green)


with Arduino

It is connected with a 450 ohm resistance and the resistance is


connected with Arduino pin (4) for the red LED and Arduino pin (3) for
the green LED, the other side of LED is connected with the ground when
the red LED receive a signal from the Arduino that mean the system is in
the emergency mode and when the green LED is active that mean the
system in the safe mode.

3.3.10 Interfacing the Wireless Module (GSM900) with Arduino

The GSM900 TX pin is connected to the Arduino through RX pin


and its RX pin is connected to the TX pin in Arduino, a virtual terminal

37
RX and TX are connected to the TX and RX pins of the GSM900
respectively to display the messages from the GSM.

3.4 System Operation

First of all, all the hardware unit of the system was tested and it
was ensured that they were in a good working condition. Then all units,
gas valve, electrical panel, fire-fighting system, buzzer, ventilation fan,
gas sensors, flame sensors, temperature sensors, LCD and LEDs, were
connected to each other on the board with the Arduino Mega using
wires, the sensors were connected to 5v from the Arduino, the actuators
were connected to a 12v external power supply and the AC contractor is
connected to a 24v external power supply, the system response is divided
into two parts: normal mode “no gas or fire detected” and emergency
mode “gas or fire detected”. In the normal situation the green LED light
up, and the LCD screen displays the phrase „safe‟ the gas valve relay and
electricity panel relay are normal close, the fire-fighting system relay is
normal open and the ventilation fan is close. In the emergency mode if
one of the gas sensors is sensing (LPG or CO) gas the sensor sends the
signal by analog signal pin to the Arduino, then the Arduino receives and
read the signal and compare it with the threshold value, if it is higher
than threshold value the Arduino send a high digital signal that will
change the gas valve relay from normal close to open to turn off the
valve, and send a high digital signal to the ventilation fan, buzzer and red
LED to be active. and if one of the flame sensors is active then the
sensor sends the signal by digital signal pin to the Arduino, then the
Arduino receive and read the signal if it is equal to zero the Arduino
send a high digital signal that will change the fire-fighting system relay
from normal open to close, and change the gas valve relay from normal
close to open to turn off the valve, and send a high digital signal to the

38
ventilation fan, buzzer and red LED to be active then send a high digital
signal that will change the solid state relay from normal close to open to
turn off the AC contactor to shut-down the factory power. Second part is
the software, the code used to program the system, after importing the
required libraries and declaring the variables, the values from the sensors
are read using specific functions like DigitalRead and AnalogRead, and
then stored in the variables, next the sensor value is tested using an IF
statement and if value is above the predefined value then the Arduino
will send controlling signal to the actuators accordingly, if a gas leakage
is detected a SMS is sent using sendSMS function, and in the case of fire
a call is made using callfunction function.

39
3.5 System Work Flow

Figure 3-3: System Work Flow

40
CHAPTER FOUR

SYSTEM RESULT

4.1 System Operating Condition

4.1.1 Fire is Detected

If both of the flame sensor or one of them detected a fire ,the


sensor will send signal to the Arduino so the Arduino sends a signal to:
the first relay to operate the fire-fighting system, to the second relay to
close the gas valve, to the fan to reduce the smoke, to the alarming part
(buzzer and LED),to the LCD to display the case, to the GSM to make a
warning call to the manager, and to the electrical panel to shut-down the
factory power. The Fire Detection is shown in figure (4-1):

Figure 4-1: Fire Detection

41
4.1.2 Gas is Detected

We have 4 gas sensors two of them are MQ-2 and the other two
are MQ7- when these sensors detect gas then it will send signal to the
Arduino and therefore the Arduino sends a signal to: the second relay to
close the gas valve, to the fire-fighting system to reduce the
concentration of the gas, to the alarming part (buzzer and LED), to the
LCD to display the case, and to the GSM to send a warning message to
the manager. The Gas Detection is shown in figure (4-2):

Figure 4-2: Gas Detection

4.1.3 Fire and Gas is Detected

Any one of the flame senor with any one of the gas sensor are
active then the sensor will send signal to the Arduino then the Arduino
sends a signal to: the first relay to operate the fire-fighting system, to the
second relay to close the gas valve, to the ventilation fan to reduce the
concentration of the gas, to the alarming part (buzzer and LED), to the

42
LCD to display the case, and to the GSM to send a warning message and
call the manager. The Fire andGas Detection is shown in figure (4-3):

Figure 4-3: Fire and Gas Detection

4.1.4 No Detection

The system is in the normal mode the sensor voltage is less than
the threshold so the electricity panel and gas valve are active and the fan,
water pump and alarming unit are off. The Normal Mode is shown in
figure (4-4):

43
Figure 4-4: No Detection
4.2 Results

4.2.1 Case One

In this case any one of gas sensor is higher than the threshold the
sim900 will send a message to the manager phone and the LCD will
display which gas sensor is detect the gas. Shown figures (4-5/4-6):

44
Figure 4-5: SMS Gas Alarm

Figure 4-6: Liquid Crystal Display (LCD) Gas Alarm

4.2.2 Case Two

In this case one or both of flame sensors are higher than the
threshold the sim900 will make a call to the manager number and the
LCD will display which flame sensor is detect the fire. Shown figures (4-
7/4-8):

45
Figure 4-7: GSM Call Alarm

Figure 4-8: Liquid Crystal Display (LCD) Fire Alarm

4.2.3 Case Three

In this case any one or two or three or all of gas sensor with the
flame sensor is higher than the threshold the sim900 will send a message
and make a call to manager phone and the LCD will display which flame
and gas sensor is detect the fire and the gas. Shown figure (4-9):

Figure 4-9: Fire and Gas Alarm

4.2.4 Case Four

In case the factory temperature is high than the normal the sensor
will send signal to Arduino to activate the cooling fan. Shown figure (4-
10):

46
Figure 4-10: Cool Temperature

47
CHAPETER FIVE

CONCLUSION AND RECOMMENDATION

5.1 Conclusion

In this thesis, the aim is to design a gas and fire alarm and control
system with a Low cost with effective usage and make it more users
friendly and easy to operate. So gas, temperature and flame sensors and
Arduino are used to save lives and reduce percentage of any accident.
The program embedded in the Arduino Mega works according to the
need A step by step approach in designing Arduino based system for gas
and temperature measurement has been followed. According to the study
and analysis of various parts of the system a design has been carried out
the results obtained from the measurement has shown that the system
performs well under all conditions and the attempt has been done

5.2 Recommendation

From the outcomes of the research, the following


recommendations can be made:

1. Predicting the occurrence of a gas leak or fire based on AI which


learning form data we storage in our cloud

2. In case the system breakdown , by using NODEMCU WI-FI module


and GSM we can send a message to the manager that the system
breakdown and the sensors have no read.

48
REFERENCES

[1] E. History, “search menu keyb keyb Bhopal disaster zoom _ in,” pp. 3–5, 1984.

[2] S. Executive and U. Kingdom, “Safety-critical system,” pp. 1–7.

[3] P. Ideas, “MQ2 Gas Sensor Working and Its Applica,” pp. 1–7, 2021.

[4] H. H. Electronics, “Mq-7 carbon monoxide datasheet,” pp. 2–4, 2018, [Online].
Available: https://www.pololu.com/file/0J313/mq7.pdf%0A%0A.

[5] “Insight Into ESP8266 NodeMCU Features & Using It With Arduino IDE Voltera V-
One PCB Printer - Concept to creation in minutes ESP-12E,” p. 8266.

[6] O. Principle, “Solid-state Relays,” pp. 1–5.

[7] Tameson, “Solenoid Valve - How They Work,” pp. 1–9, 2021, [Online]. Available:
https://tameson.com/solenoid-valve-types.html.

[8] P. M. How and T. Contactor, “How to Wire a Three-Phase Contactor,” pp. 4–8.

[9] K. K. Patel, S. M. Patel, and P. G. Scholar, “Internet of Things-IOT: Definition,


Characteristics, Architecture, Enabling Technologies, Application & Future
Challenges,” Int. J. Eng. Sci. Comput., vol. 6, no. 5, pp. 1–10, 2016, doi:
10.4010/2016.1482.

[10] M. M. Alani, “What is the cloud?,” SpringerBriefs Comput. Sci., vol. 0, no.
9783319414102, pp. 1–14, 2016, doi: 10.1007/978-3-319-41411-9_1.

[11] The ThingsBoard Authors, “What is ThingsBoard?,” pp. 6–7, 2021, [Online].
Available: https://thingsboard.io/docs/getting-started-guides/what-is-thingsboard/.

[12] R. C. Pandey, M. Verma, and L. K. Sahu, “Internet of Things (IOT) Based Gas
Leakage Monitoring and Alerting System with MQ-2 Sensor,” Int. J. Eng. Dev. Res.,
vol. 5, no. 2, pp. 2321–9939, 2017.

[13] A. Mallik, S. Ahmed, G. M. M. Hossain, and M. R. Rahman, “IoT Utilized Gas-


Leakage Monitoring System with Adaptive Controls Applicable to Dual Fuel
Powered Naval Vessels/Ships: Development & Implementation,” Cybern. Inf.
Technol., vol. 20, no. 1, pp. 138–155, 2020, doi: 10.2478/cait-2020-0010.

[14] M. Shahadat, A. Mallik, and M. Islam, “Development of an automated gas-leakage

49
monitoring system with feedback and feedforward control by utilizing IoT,” Facta
Univ. - Ser. Electron. Energ., vol. 32, no. 4, pp. 615–631, 2019, doi:
10.2298/fuee1904615s.

[15] M. Sharma, D. Tripathi, N. P. Yadav, and P. Rastogi, “Gas Leakage Detection and
Prevention Kit Provision with IoT,” Int. Res. J. Eng. Technol., vol. 5, no. 2, pp.
2227–2230, 2018, [Online]. Available: www.irjet.net.

[16] P. M. P. Gajre, N. Muley, D. Borse, and V. Naraje, “Unmanned Vehicle for Gas
Leakage Detection Using Raspberry PI,” Int. J. Adv. Res. Sci. Commun. Technol.,
vol. 5, no. 2, pp. 135–142, 2021, doi: 10.48175/ijarsct-1187.

[17] P. Kumar Pateriya, A. A. Munna, A. saha, H. Biswas, A. Ahammed, and A. Shah,


“IoT-based LPG Gas Leakage Detection and Prevention System,” SSRN Electron. J.,
2021, doi: 10.2139/ssrn.3884477.

[18] J. Na, L. Yue, R. Zhuang, and C. Yang, “Experimental Study on a Target Direction
Finding Algorithm for Gas Leakage Detection in Underwater Structures,” IOP Conf.
Ser. Earth Environ. Sci., vol. 651, no. 4, 2021, doi: 10.1088/1755-
1315/651/4/042015.

[19] H. H. Yan and Y. Rahayu, “Design and development of gas leakage monitoring
system,” Int. Conf. Electr. Eng. Comput. Sci. Informatics, vol. 1, no. August, pp.
207–212, 2014, doi: 10.11591/eecsi.1.404.

50
APPENDIX

#include<SoftwareSerial.h> //allow serial communication

#include <Wire.h>

#include <LiquidCrystal.h> // Liquid Crystal display

SoftwareSerial SIM900(34, 35); // Configure software serial port

char msg;

char call;

const int rs = 27, en = 26, d4 = 25, d5 = 24, d6 = 23, d7 = 22;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

#include "dht.h"

dht DHT;

#include <MQ2.h>

#define dht2 DHT;

void setup() {

SIM900.begin(19200);

Serial.begin(9600);

delay(1000);

lcd.begin(16, 2);

lcd.print("Safe");

void loop() {

DHT.read11(dht_apin);

float TEMP1=DHT.temperature; // read temperature from first sensor

A
DHT.read11(dht_apin2);

float TEMP2=DHT.temperature; // read temperature from second sensor

// display the data in the serial monitor

Serial.println("( LAB 1 )");

Serial.print("TEMP in LAB 1 = ");

Serial.print(TEMP1);

Serial.println("C ");

Serial.print("MQ2 Gas Value in LAB 1: ");

Serial.println(GAS_Value1);

Serial.print("MQ7 Gas Value in LAB 1: ");

Serial.println(GAS7_Value1);

Serial.print("Fire Sensor 1 state: ");

Serial.println(digitalRead(40));

Serial.println("( LAB 2 )");

Serial.print("TEMP in LAB 12 = ");

Serial.print(TEMP2);

Serial.println("C ");

Serial.print("MQ2 Gas Value in LAB 2: ");

Serial.println(GAS_Value2);

Serial.print("MQ7 Gas Value in LAB 12: ");

Serial.println(GAS7_Value2);

Serial.print("Fire Sensor 1 state: ");

Serial.println(digitalRead(41));

B
if(GAS_Value1 >= 400){ // if the gas value exceeds the threshold value perform the
following actions

lcd.setCursor(0,0);

lcd.print("GAS1 DETECTED");

lcd.setCursor(0,1);

lcd.print("IN LAB 1");

Serial.println(" ");

Serial.println("MQ2 GAS in LAB 1");

Serial.println(GAS_Value1);

Serial.println(" ");

digitalWrite(ALARM,HIGH);

digitalWrite(relay,LOW);

digitalWrite(motor1pin1, HIGH);

digitalWrite(motor1pin2, LOW);

sendSMS();

delay(1000);

if(GAS7_Value1 >= 300){

lcd.setCursor(0,0);

lcd.print("GAS7 DETECTED");

lcd.setCursor(0,1);

lcd.print("IN LAB 1");

Serial.println(" ");

Serial.println("MQ7 GAS in LAB 1");

C
Serial.println(GAS_Value1);

Serial.println(" ");

digitalWrite(ALARM,HIGH);

digitalWrite(relay,LOW);

digitalWrite(motor1pin1, HIGH);

digitalWrite(motor1pin2, LOW);

sendSMS();

delay(1000);

if(FLAME_LAB_1 == LOW){

lcd.setCursor(0,0);

lcd.print("FIRE DETECTED");

lcd.setCursor(0,1);

lcd.print("IN LAB 1");

Serial.println(" ");

Serial.println("MQ7 GAS in LAB 1");

Serial.println(GAS_Value1);

Serial.println(" ");

digitalWrite(ALARM,HIGH);

digitalWrite(relay,LOW);

digitalWrite(motor1pin1, HIGH);

digitalWrite(motor1pin2, LOW);

digitalWrite(motor2pin1, HIGH);

digitalWrite(motor2pin2, LOW);

D
callfunction();

delay(1000);

else{

digitalWrite(ALARM,LOW);

digitalWrite(motor1pin1,LOW);

digitalWrite(motor1pin2, LOW);

digitalWrite(motor2pin1,LOW);

digitalWrite(motor2pin2, LOW);

digitalWrite(relay,HIGH);

delay(5000);

delay(3000);

// SMS function

void sendSMS() {

SIM900.print("AT+CMGF=1\r");

delay(100);

SIM900.println("AT+CMGS=\"+249117763141\"");

delay(100);

SIM900.println("GAS DETECTED.");

delay(100);

SIM900.println((char)26);

delay(100);

E
SIM900.println();

delay(5000);

// Calling function

void callfunction() {

SIM900.println("ATD + +249909598273;");

delay(100);

SIM900.println();

delay(20000);

SIM900.println("ATH"); // AT command to hang up

You might also like