You are on page 1of 78

MONITORING AND DETECTING COOKING GAS

LEVEL AND LEAKAGE USING IOT

ABDULAHI MOHAMED HASSAN


FADUMO ALI JAMA
SHUAYB DA’UD AHMED
MOHAMED ABDULAHI ABDIKADIR

SUBMISSION OF GRADUATION PROJECT


FOR PARTIAL FULFILLMENT OF THE
DEGREE OF BACHELOR OF COMPUTER
APPLICATIONS

JAMHURIYA UNIVERSITY OF SCIENCE AND


TECHNOLOGY (JUST)

FACULTY OF COMPUTER & INFORMATION


TECHNOLOGY

AUGUST 2022
JAMHRURIYA UNIVERSITY OF SCIENCE AND TECHNOLOGY
(JUST)
Original Literary Work Declaration

Name of Candidate 1: Abdullahi Mohamed Hassan ID No: C118305

Name of Candidate 2: Faduma Ali Jama ID No: C118313

Name of Candidate 3: Shuab Daud Ahmed ID No: C118246

Name of Candidate 4: Mohamed Abdullahi Abdulkadir ID No: C118290

Name of Degree: Bachelor of Computer Application

Title of Project Paper/Research Report/Dissertation/Thesis (“this Work”):


Monitoring and Detecting Cooking Gas Level and Leakage Using IOT
Field of Study: Computer Applications
We the undersigned, do solemnly and sincerely declare that:
(1) We are the authors/writers of this Work;
(2) This Work is original;
(3) Any use of any work in which copyright exists was done by way of fair dealing and
for permitted purposes and any excerpt or extract from, or reference to or
reproduction of any copyright work has been disclosed expressly and sufficiently and
the title of the Work and its authorship have been acknowledged in this Work;
(4) We do not have any actual knowledge nor do I ought reasonably to know that the
making of this work constitutes an infringement of any copyright work;
(5) We hereby assign all and every right in the copyright to this Work to Jamhuriya
University of Science and technology (“JUST”), who henceforth shall be owner of
the copyright in this Work and that any reproduction or use in any form or by any
means whatsoever is prohibited without the written consent of JUST having been
first had and obtained;
(6) We are fully aware that if in the course of making this Work, we have infringed any
copyright whether intentionally or otherwise, we may be subject to legal action or
any other action as may be determined by JUST.
Candidate 1’s Signature: Candidate 2’Signature:

Candidate 3’s Signature: Candidate 4’s Signature:

Subscribed and solemnly declared before,

Supervisor’s Name: Supervisor’s Signature:

Date:

i
Dedication
We dedicate our dissertation work to our family and many friends. A special feeling of

gratitude to our loving parents, whose words of encouragement and push for tenacity ring in

our ears.

ii
Abstract
LPG is widely used for cooking in many countries for economic reasons, for convenience,

or because it is the preferred fuel source. This study focuses on the use of the Internet of

Things to measure and display the gasoline content of household LPG cylinders, which

helps with automatic know the remaining LPG cylinder and if there is a leak detection.

Since the LPG capacity in a cylinder is typically unknown, we will show the LPG level

instead. A load sensor is used to measure the LPG level. The output of the sensor is

connected with Nodemcu. By use of Mobile Application, the information is sent to user

by Alert. Then the gas leakage is detected by gas sensor (MQ-135) by using this, we can

detect the current LPG level and it is continuously displayed on the LCD. We can know

the validity of LPG usage from the date of initialization. By use of IOT the user is alerted

by giving the message to their mobile phone when the LPG level is critically low (below

15%). Then by detecting the gas leakage we can prevent the LPG gas burst accidents in

the home.

Keywords: IOT, Gas Leakage, Cylinder Weight

iii
Acknowledgments

First of all, I would like to thank Allah for have been given us strength and guidance, in

our research work in good health, Secondly, we would like to express our deepest gratitude

to our supervisor Eng Abdirizak Warsame Abdulle Teacher faculty of computer & IT

at Jamhurriya University for his inspiration, idea, and guidance for completion of the

thesis. Thirdly We are very grateful to our research coordinator Eng. Sharmake Ali

Kahie helps us with guidance and encouragement in our project.

finally, we all thank our, deep and sincere gratitude to our family for their continuous and

unparalleled love, help, and support we are grateful to our parents for always being there

for us as friends. We are forever indebted to our parents for giving us the opportunities

and experiences that have made us who we are. They selflessly encouraged us to explore

new directions in life and seek our own destinies. This journey would not have been

possible if not for them, and we dedicate this milestone to them

iv
Table of Contents

Original Literary Work Declaration ........................................................................................ I

Dedication .............................................................................................................................. II

Abstract .................................................................................................................................III

Acknowledgments ..……………………………………………………………...….….......IV

List of Figures ........................................................................................................................ X

List of Tables....................................................................................................................... XII

Abbreviations ..................................................................................................................... XIII

CHAPTER I: INTRODUCTION ............................................................................................1

1.0 Introduction ..................................................................................................................... 1

1.1 Background of the study ................................................................................................. 2

1.2 Problem statement ........................................................................................................... 5

1.3 Research objectives ......................................................................................................... 6

1.4 Research Questions ......................................................................................................... 6

1.5 Scope of the study ........................................................................................................... 6

1.6 Significance ..................................................................................................................... 7

1.7 Motivation of the study ................................................................................................... 7

1.8 Organization of the study ................................................................................................ 8

CHAPTER II: LITERATURE REVIEW................................................................................9

2.0 Introduction ..................................................................................................................... 9

2.1 History of gas .................................................................................................................. 9

v
2.2 Weight Monitoring ..........................................................................................................10

2.3 Harmful Gases .................................................................................................................11

2.4 History of Fuels ...............................................................................................................13

2.4.1 History of LPG as a Transportation Fuel .................................................................13

2.4.2 Transportation Fuels .................................................................................................14

2.4.2.1 Production and Refining of Transportation Fuels..............................................14

2.4.2.2 Crude oil ............................................................................................................15

2.4.2.3 Natural gas .........................................................................................................15

2.5. LPG Pollution ................................................................................................................15

2.6 Types of Gas Sensors ......................................................................................................16

2.6.1 Modern Gas Sensor ..................................................................................................16

2.6.1.1 Catalytic Bead Gas Sensor .................................................................................16

2.6.1.2 Photoionization Detector ...................................................................................17

2.6.1.3 Electrochemical Gas Sensor ..............................................................................19

2.6.2 Traditional Gas Sensors ............................................................................................20

2.6.2.1 MQ135 ...............................................................................................................20

2.6.2.2 MQ3 ...................................................................................................................20

2.6.2.3 MQ5 ...................................................................................................................21

2.6.2.4 MQ6 ...................................................................................................................22

2.7 Related Work ..................................................................................................................23

CHAPTER III: RESEARCH METHODOLOGY ................................................................ 26

vi
3.0 Introduction .....................................................................................................................26

3.1 System Description .........................................................................................................26

3.2 System Overview ............................................................................................................26

3.3 System Features ..............................................................................................................28

3.4 Development Environment .............................................................................................28

3.4.1 Programming Language ...........................................................................................28

3.4.2 Arduino IDE .............................................................................................................28

3.4.3 Flutter .......................................................................................................................29

3.4.4 Firebase ....................................................................................................................29

3.5 System Requirement Specification .................................................................................29

3.5.1 Hardware Specification ............................................................................................29

3.5.1.1 Arduino Uno ......................................................................................................29

3.5.1.4 WEIGHT SENSOR MODULE .........................................................................31

3.5.1.6 16x2 LCD ..........................................................................................................32

3.5.1.7 Active Buzzer Module .......................................................................................32

3.5.1.8 Breadboard .........................................................................................................33

3.5.1.9 IIC Adapter ........................................................................................................33

3.5.1.10 AC-DC Converter ............................................................................................34

Chapter IV: System Analysis and Design .............................................................................35

4.1 Introduction .....................................................................................................................35

4.2 Current System ................................................................................................................35

vii
4.3 The Need for This Work .................................................................................................35

4.4 Requirements...................................................................................................................36

4.4.1 Functional Requirements ..........................................................................................36

4.4.2 Non-Functional Requirements..................................................................................36

4.5 Feasibility Study..............................................................................................................37

4.5.1 Schedule Feasibility..................................................................................................37

4.5.2 Operational Feasibility .............................................................................................37

4.5.3 Technical Feasibility ................................................................................................ 37

4.5.4 Economic Feasibility ................................................................................................ 37

4.6 System Design.................................................................................................................37

4.6.1 UML diagram ...........................................................................................................38

4.7 Hardware Design. ............................................................................................................39

4.8 Database Design ..............................................................................................................39

4.9 Database Diagrams..........................................................................................................39

4.10 Data Dictionary .............................................................................................................40

4.12 Summary .......................................................................................................................40

CHAPTER V: IMPLEMENTATION AND TESTING .......................................................41

5.1 introduction .....................................................................................................................41

5.2 Overview of the implementation environment ............................................................... 41

5.3. Snapshots of the system .................................................................................................41

5.3.1 Application Snapshots ..............................................................................................42

viii
5.3.1.1 Signup Form ......................................................................................................42

5.4 Hardware Snapshots ...................................................................................................... 45

5.4.1 LCD ..........................................................................................................................45

CHAPTER VI: CONCLUSION AND FUTURE WORK ....................................................48

6.0 Introduction ................................................................................................................... 48

6.1 Conclusion .................................................................................................................... 48

6.2 Recommendations ......................................................................................................... 49

6.3 Future work ................................................................................................................... 49

References .............................................................................................................................50

Appendix A ...........................................................................................................................55

Declaring gas sensor and loadcell variables and programming ........................................55

ix
List of Figures
Figure 2.1 MQ135 gas sensor ............................................................................................... 20

Figure 2.2 MQ3 gas sensor ...................................................................................................21

Figure 2.3 MQ5 gas sensor ...................................................................................................22

Figure 2.4 MQ6 gas sensor ...................................................................................................23


Figure 2.5 Alarm & Scan Devices ........................................................................................23

Figure 2.6 LCD .....................................................................................................................24

Figure 2.7 Final Prototype of proposed system ....................................................................24

Figure 2.8 Display of Normal Concentration ........................................................................25

Figure 3.1 Arduino Uno ..................................................................................................................... 30

Figure 3.2 NodeMCU ( ESP8266 ) .................................................................................................... 30

Figure 3.3 MQ135 Gas Sensor........................................................................................................... 30

Figure 3.4 load cell............................................................................................................................. 31

Figure 3.5 HX711 Converter ............................................................................................................. 31

Figure 3.6 16x2 LCD ......................................................................................................................... 32

Figure 3.7 Active Buzzer Module ...................................................................................................... 32

Figure 3.8 Breadboard ....................................................................................................................... 33

Figure 3.9 IIC Adapter ....................................................................................................................... 33

Figure 3.10 AC-DC Converter ........................................................................................................... 34

Figure 4.1 System Diagram...................................................................................................38

Figure 4.2 Hardware Design .................................................................................................39

Figure 4.3 Database Design ..................................................................................................39

Figure 5.1 Signup Form ........................................................................................................42

Figure 5.2 Sign in Form ........................................................................................................43

Figure 5.3 Dashboard ............................................................................................................44

x
Figure 5. 4 LCD Display .......................................................................................................45

Figure 5.5 MQ135 Gas Sensor ..............................................................................................46

Figure 5. 6 Load-Cell ............................................................................................................47

xi
List of Tables

Table 4.1 Users .................................................................................................................................. 40

Table 4.2 Devices............................................................................................................................... 40

xii
Abbreviations

IoT Internet of thing.

LPG Liquefied Petroleum Gas.

SMS Short Message Service

PID Photoionization Detector

MOS Metal Oxide Semiconductor

LED Light-emitting diode

PPM Parts Per Million

GPRS General Packet Radio Service

IDE Integrated Development


Environment
ADC Analog-to-digital converter

TTL Time-to-live

IDE integrated development


environment
HX711
Converter connects loadcell and nodemcu
UI user interfac

xiii
CHAPTER I: INTRODUCTION

1.0 Introduction

Liquified Petroleum Gas (LPG) is composed of a combination of butane and propane which

has a high flaming rate. It does not have an odor, so Ethanoate oil is added to it to be a

powerful odorant, due to that gas leakage can be easily detected. Nowadays, LPG has become

the latest fuel used for cooking instead of using charcoal, however, the leakage of the gas can

cause an accident which impacts the economy as well as human health. In such a case, since

some people have low sensitivity and can or cannot respond to low concentrations of gas

leakage, we are proposing an essential system that protects the leakage accidents and

monitors the level of the gas in the cylinder.

The proposed system's goal is to continually measure the weight of the cylinder and send

notification alert to the users if there is any leakage allowing them to take appropriate action.

This device is also capable of detecting LPG gas leaks such as propane and butane. The main

goal of this project is to monitor liquid petroleum gas (LPG) levels and detect if there is a

gas leak to avert significant fire incidents, as well as to facilitate safety precautions.

The system uses a gas sensor to detect LPG leakage and sends a notification to the consumer

to notify them. We use a weight sensor to determine the weight of the cylinder and displays

the weight on the LPG display. The suggested method uses a gas sensor and load cell via

NodeMCU to send data to the server then alerting the users if there is a gas leakage and the

status of the cylinder level. When the system detects that the LPG concentration in the air

has reached the specified level, it sends a notification to the consumer's registered mobile

phone and activates the alarm using a buzzer as well as displays the same message on the

LCD to take the necessary action, such as turning on the exhaust fan or opening windows to

reduce the gas concentration in the air.


1
1.1 Background of the study

All around the world and in our country, gas is the most effective, efficient and

environment-friendly fossil fuel for the cooking of our homes, restaurants, and many other

institutions and they are known as natural gas and liquefied petroleum gas (LPG).

Every home in today's society has a separate LPG hookup for cooking. Human beings are

getting adopted day by day as technology advances. In today’s world, every home is

provided with a separate LPG cylinder for cooking. It improves efficiency and reduces the

amount of time spent on cooking. Even though it is considerably better when leakage

happens, certain crucial criteria must be considered. When using LPG hazards must be

considered and a dependable technique must be implemented in the kitchen. There are a

variety of systems for continuously monitoring and controlling gas leaks in residences.

(Vishnu, 2021).

In today's society where everything is digitized human safety has become a key issue.

Explosions and flames occur from time to time in both homes and restaurants. Flammable

gases such as LPG, Butane, and Methane are responsible for the majority of these

catastrophes. It is vital to use LPG in our domestic environments such as our homes, cars

and storage facilities, as well as in laboratories. So, to keep people safe, we need a system

that can continuously monitor LPG levels in these areas and provide an intuitive interface

for controlling them if a leak occurs (Kurzekar et al, 2017).

Technology is rapidly evolving nowadays making human life easier than it was previously.

In India, most people use LPG (Liquid Petroleum Gas) in a variety of places, including

homes, shops, and many industries. LPG is too small to assemble. However, uneducated

people find it difficult to comprehend, and many people in their society are preoccupied

2
with their jobs, so they are unaware of the status of the gas, and if the LPG booking is

delayed, the people will be inconvenienced. The researcher suggested The Leakage

Detection and Intelligent Gas Booking System solve that problem. When the LPG gas

reaches its minimum weight, GSM sends a memo to the owner, warning that the LPG gas

is running out, so that the owner can book the LPG ahead of time. The problem of gas

leakage affects a large number of people. To overcome this flaw, a gas sensor is used to

detect gas outflow and activate a buzzer, as well as transmit a message to the owner about

the gas outflow. The proposed system was advantageous to society (Murugam, 2020).

In metropolitan regions, technology has improved to the point that any task can be

completed quickly and easily. Manual gas booking is a time-consuming method in which

the exact amount of gas in the cylinder is unknown until the cylinder is empty. The cylinder

is then reserved, and the new cylinder may take up to a week to arrive. If the amount of gas

is known, the cylinder can be reserved before it runs out and a new cylinder is ordered. The

researcher provided a solution to the problem using IoT System. The result obtained by the

researcher was developing an IoT system that can monitor the level of the cylinder and

detect if there is a leakage of the gas, and book the gas. Many domestic accidents occur

because people are unaware that there is a gas leak. LPG gas is a highly combustible

mixture of propane, butane, and propylene. Butane has a permissible limit of 600 parts per

million (ppm), over which it is not safe. When gas leaks, it mixes with the air to generate

a flammable combination that explodes when it comes into touch with a spark. Because

safety is so crucial the project is also designed to eliminate mishaps caused by LPG gas

leaks (Kodali et al., 2019).

In South Asia, LPG cylinders are commonly used. The demand for LPG Cylinders is

steadily increasing. It was widely utilized in urban and suburban regions, but in the last 5-
3
10 years, it has gained popularity in rural areas. Similarly, LPG Cylinder demand has risen

in the industrial sector. Liquid petroleum gas is an extremely flammable substance. With

the increased use of LPG cylinders, there has been an upsurge in gas leakage accidents. The

risk of a structure fire, asphyxia, and explosion increases if this gas leaks. Many accidents

have occurred as a result of LPG cylinder explosions, some of which were caused by gas

leakage negligence. Gas leaks must be monitored constantly which necessitates arduous and

dedicated effort. To remedy the issue, the researchers proposed a system that meticulously

monitors gas leakages with remarkable precision and accuracy. Whenever there is a gas leak

the MQ-6 gas sensor detects it and activates the accompanying alarm circuits. The customer

will also receive an notification. Another big issue that LPG Cylinder users confront is the

premature exhaustion of gas cylinders (Chandak, 2020).

(Kannan, 2017) Proposed a system that detects if there are LPG leaks and sends an alert to

the consumers, as well as turning off the power supply and activating the alarm as an

emergency precaution. In most homes and businesses liquid petroleum gas is used. LPG is

primarily used for cooking in homes. Propane and butane, both extremely flammable

chemical molecules, make up the majority of this (LPG) energy source. LPG leaks can

occur in homes, restaurants, industries, or gas-powered vehicles, although they are

uncommon. The leakage of this gas is hazardous since it increases the likelihood of an

explosion. LPG contains an odorant such as ethanol which makes it easy for the majority

of people to spot leaks. this project seeks to build a system that detects gas leakage and

warns the subscriber via alarm, message on the user's mobile phone, and the primary safety

precaution of shutting off the gas supply valve. The technology functions more like a First

Aid kit, immediately shutting off the gas valve with a normally closed solenoid valve before

alerting anyone nearby with a visual display and auditory alarm. When a little amount of

4
LPG is leaked near the system, the system sensor identifies the leak and sends an alert to

housemates, as well as activating the alarm and stopping the flow of gas with a solenoid

valve.

Liquefied Petroleum Gas (LPG) is commonly utilized in residences but most consumers

are ignorant of their daily consumption rate or the time frame in which they must schedule

a refill. Gas leaks are a big concern in the home and other places that use residential gas.

As a result, the researcher suggested an Internet of Things (IoT)-based system that analyzes

several characteristics of an LPG cylinder and keeps the consumer informed via a mobile

application (Rohith, 2020).

Monitoring the level of gas in the cylinder or detecting if there is a gas leak in the world is

common in most countries and they solved that issue, but in our country, no one has solved

that problem so we decided to solve this problem in our country by using an IoT system to

monitor the level of gas cylinders and also detect if there is a gas leak.

1.2 Problem statement

Most families, restaurants, hotels, and colleges use Liquefied Petroleum Gas (LPG) in food

cooking, due to several facts such as its great efficiency in cooking food, its clean flame, and

its ease of storage and transportation, As the use of LPG grows so the problems caused by

LPG increased.

The main problem is that the contents of the cylinder may suddenly terminate causing a

disruption in the meal preparation and an unforeseen cost in the family budget because the

cylinders are opaque and not knowing how much gas is left in the cylinder during the

timeframe of use. As the use of LPG cylinders increased there has been an increase in gas

5
leakage-related accidents that increases the risk of a building fire, inhalation, and explosion

of gas cylinders.

Another issue is that manual gas booking is a time-consuming process in which the amount

of gas in the cylinder is not known exactly and is known only after the gas in the cylinder is

empty. Then a cylinder is booked and it may take time to get a new cylinder. If the amount

of gas is known, registered users may get notified before gas terminate, so they can order gas.

Therefore, the researchers will work on developing a device that will enable the users to

regularly monitor the weight of the LPG cylinder and LCD. They will also receive

information if there is gas leakage.

This device will help consumers be able to closely follow the level of the gas cylinder to

foresee when the gas will run out. It will also help the family to have it in their budget and

add it to their bills.

1.3 Research objectives

➢ To monitor cooking gas cylinder level using a smartphone.

➢ To detect if there is gas leakage and report it.

1.4 Research Questions

➢ How to monitor cooking gas cylinder level?

➢ How to detect if there is gas leakage?

1.5 Scope of the study

Checking and monitoring cooking gas cylinders are essential in our country, especially in

homes, restaurants, hotels, and colleges, so we will develop a system that monitors the level

of the cylinder and detects if there is a gas leakage. The geographical area of this project is

6
the Banadir region, especially in Mogadishu. The project started in December 2021 and will

end in July 2022.

1.6 Significance

Monitoring the level of the gas cylinder is important for the users because they can know the

remaining gas so that it does not suddenly terminate when it cannot be ordered or gas stations

are closed, also they can detect if the gas leaks to protect against the danger posed by gas that

causes an explosion and can harm people.

The researchers will concentrate on creating a device that will allow users to monitor the

weight of the LPG cylinder and the LCD regularly. If there is a gas leak, they will also be

notified through smartphones.

This technology will allow users to track the level of their gas cylinder to predict when it will

terminate. It will also assist the family in incorporating it into their budget and adding it to

their monthly payments.

1.7 Motivation of the study

Neglecting the cooking gas cylinder can lead to property or personal damage, as well as a

lack of awareness about when the household's gas supply will run out, so to avoid all of this,

we will build a system that solves the risks indicated above. This system might encourage

families that are reluctant about the use of gas who think it could endanger them, which is

why we decided to develop it.

7
1.8 Organization of the study

I. Chapter One: Introduction to study and consists of an introduction, background of the

study, Problem statement, Research objectives, Research question, the significance of the

study, Motivation of the study, and Organization of the study.

II. Chapter two: Literature review and the relevant concepts related to the topics of the

projects.

III. Chapter three: Methodology defines the procedures to design the project and may

include

IV. Chapter four: Design and analysis are going to be the results and analyses of the

projects.

V. Chapter Five: implementation and coding this chapter elaborate on the physical

implementation of the project. It also displays the important code which makes an essential

impact on the system functionality and some screenshots about the system interface.

IV. Chapter Six: Conclusion and Recommendation This chapter shows the conclusion

of the research by giving the output of the research and finally gives future works and

necessary Recommendations.

8
CHAPTER II: LITERATURE REVIEW

2.0 Introduction

In this chapter researchers will talk about deeply the history of gas, weight monitoring,

harmful gases, and the history of LPG as a transportation fuel. also, this chapter reviews how

the gas sensors detect the presence or awareness of gases in the atmosphere, the types of gas

sensors of this study will also be addressed, and lastly, will compare the modern and

traditional sensors of gas.

2.1 History of gas

Natural gas is a fossil fuel, which means it is made up of carbon atoms. Natural gas, like

other fossil fuels such as coal and oil, is derived from ancient plants, animals, and bacteria.

There are several theories on how fossil fuels are made. The most widely held belief is that

they form underground, in harsh environments. Plants, animals, and microorganisms are

gradually buried by layers of soil, sediment, and even rock as they decay. Organic stuff gets

squeezed over millions of years. As biological matter penetrates deeper into the Earth's crust,

it is exposed to increasing temperatures. The carbon bonds in organic materials break down

as a result of the combination of compression and high temperature. Thermogenic methane—

natural gas—is produced as a result of this molecular breakdown. Methane is carbon and

hydrogen-based organic molecule that is probably the most prevalent on the planet. Natural

gas deposits are frequently discovered near oil deposits. Natural gas reserves on Earth's

surface are frequently eclipsed by nearby oil deposits. Deeper deposits, which were formed

at higher temperatures and under greater pressure, contain more natural gas than oil. Pure

natural gas can be found in the deepest reservoirs. Natural gas, on the other hand, does not

have to be formed far underground. Methanogens, which are microscopic microbes, can also

produce it. Methanogens can be found in the intestines of animals (including humans) as well

9
as in low-oxygen environments near the Earth's surface. Methanogens break down

decomposing matter into a kind of methane called biogenic methane in landfills, for example.

Methanogenesis is the process through which methanogens produce natural gas (methane).

Even though the majority of biogenic methane is released into the atmosphere, new

technologies are being developed to trap and harvest this potential energy source. The natural

gas created deep beneath the Earth's surface thermogenic methane can also escape into the

atmosphere. Some of the gas can rise through permeable substances like porous rock and

eventually reach the surface. Most thermogenic methane rising to the surface, on the other

hand, runs into geological formations that are too impermeable for it to escape. Sedimentary

basins are the name given to these geological formations. Natural gas reservoirs are trapped

in sedimentary basins. A hole (also referred to as a well) must be bored through the rock to

allow the gas to escape and be harvested to obtain access to these natural gas reservoirs.

Natural gas-rich sedimentary basins can be found all over the world. Natural gas can be found

in Saudi Arabia's deserts, Venezuela's lush tropics, and the icy Arctic of the United

StatStateste of Alaska. Basins are typically found in the states surrounding the Gulf of

Mexico, such as Texas and Louisiana, outside of Alaska. In sedimentary basins, the northern

states of North Dakota, South Dakota, and Montana have recently constructed considerable

drilling infrastructure (Andrew, 2012).

2.2 Weight Monitoring

A load cell, an Arduino module, and an LCD screen are used. The system was installed at

the cylinder's base. The load cell measures the weight of the object that is placed on top of it.

The weight of the gas cylinder will be measured in this situation. It needs to be calibrated

before it can measure weight and start monitoring. It will continually measure the weight

placed over it after the calibration is completed. It generates an analog output. The load cell

10
has been calibrated, and the values will be shown on the LCD panel. The initial weight of the

cylinder is 20kg Now, if the cylinder's weight is less than 5kg, a notification appears on the

LCD indicating the cylinder's low weight and the need to refuel it or purchase a new one, and

also If the cylinder's weight is 0kg the LCD will display a message indicating that the cylinder

is empty. When a new cylinder is inserted into the load cell, it calibrates the new weight

before measuring it. For each cylinder placed on the load cell, the process will be repeated

(Lokesh, 2020).

The LoRa-based IoT platform was used to design the natural gas detection, prevention,

monitoring, and alerting system. It can be used for long-range radio transmission. It is

operated at the ISM frequency range of 433 MHz in Asia, 868 MHz in Europe, and 915 MHz

in the United States, with the help of IoT networks. Here Frequency Shifting Keying is a

technique for achieving efficient modulation with low power and a low scale error rate. It has

sufficient technical capabilities as a network platform in a communication context (Macker

et al., 2018).

2.3 Harmful Gases

The effect of pouring gas is releases fumes or gases that caused significant health problems,

such as leukemia. These gas vapors were benzene gas, which isn't the only combustion

product. Nitrogen dioxide (NO2), for example, is a prevalent gas in the atmosphere. At room

temperature, NO2 does not quickly react. Acid rain and ozone layer degradation result from

the mixing in the atmosphere. Inhaling poisonous gases can irritate the respiratory system

and lungs which can lead to pneumonia and influenza. Carbon monoxide (CO) is a waste

product of fuel combustion that when inhaled disrupts blood flow across the body causing

damage to vital organs such as the heart and brain (Leghrib et al., 2011).

11
The release of hazardous substances into our environment is becoming a serious issue.

Several industrial chemicals generated more than 1 million tons per year around the world

are also highly dangerous and quite easy to obtain. Effective collection of these compounds

is critical for environmental protection as well as the protection of persons who are in danger

of being exposed to them. Activated carbon loaded with copper, silver, zinc, and

molybdenum ions is commonly used in general-purpose filters. Although these filters are

successful in containing a variety of harmful gases, they are insufficient against all potential

hazards, Because of the very amorphous structure of their carbon network. The existing uses

of activated carbons as well as any essential improvements on its current performance are

mostly constrained by a lack of control over the measurements and functioning of the pores.

If materials are to be produced to handle any conceivable dangerous chemical such barriers

must be overcome. Metal-organic frameworks (MOFs) are a new type of crystalline porous

material with a structure made up of metal-oxide units connected by strong covalent

connections to organic linkers. (David et al., 2008).

Carbon monoxide is a poisonous gas. Incomplete combustion also produces CO as a waste

product. Carbon dioxide is a colorless, odorless gas that is extensively distributed. Because

CO is as thick as air, it is easily soluble in the air, making it toxic and earning the moniker

"silent killer." CO is used as a reducing agent in the manufacturing process, exposing the

workers. The sluggish 18 combustion of coal causes its existence in mines. It's also employed

in massive amounts as a low-cost chemical reducing agent, such as in steel production and

other metal refining and heat-treating operations, as well as in the creation of methanol by

hydrogen reaction (Nandi et al., 2019).

(Cheng & Wang-Li, 2019) According to their research, ammonia (NH3) is an alkaline gas

with a density of 0.59 when compared to that air. The maximum safe inhaling concentration
12
is 25ppm, after which the interaction with the gas becomes lethal. Acids and alkalinize react

to generate salts and gases in most cases. The reaction between ammonia and other gases,

such as halogens, aids in either diminishing or intensifying the lethal gas's detrimental

influence. At a concentration of 15%, ammonia gas is considered flammable and can be

utilized in explosives. Various applications include fertilizer, fibers, and manure. Ammonia

has an LEL of 15% and is flammable. Fertilizers, urea for resins, explosives, and nylon fibers

are all made from it in large numbers all over the world. It's also utilized as a refrigerant gas,

which is becoming more popular as CFCs become obsolete. Another application is to keep

water sources sterile after they've been treated with chlorine and Sulphur dioxide.

2.4 History of Fuels


2.4.1 History of LPG as a Transportation Fuel

Shortly after becoming popular as a cooking and lighting fuel in the early twentieth century,

LPG was employed as a fuel for internal combustion engines. Oil crises and rising petroleum

costs prompted a significant increase in LPG-powered vehicles in the 1970s. The majority of

these cars were originally designed to run on gasoline and were later converted to run on

LPG. As fueling systems and emissions control technology evolved, LPG conversion

systems for on-highway cars became more intricate and integrated with existing vehicle

hardware. Various original equipment manufacturers (OEMs) have offered dedicated LPG-

fueled autos since the beginning. Direct fuel injection technology, which can reduce

emissions while enhancing performance in contrast to gasoline, is the next great opportunity

for LPG converters and OEMs (Ryskamp, 2017).

13
2.4.2 Transportation Fuels

When evaluating different transportation fuels, it's important to include not only combustion-

related emissions, but also emissions from manufacturing, processing/refining,

shipping/delivery, and other sources of emissions across the supply chain.

2.4.2.1 Production and Refining of Transportation Fuels

The majority of LPG is produced from two sources: crude oil processing (about 40% of

global output) and natural gas production and processing (about 60% of global production).

Each kind of manufacturing has its own set of standards for pollutant and greenhouse gas

(GHG) emissions which might be the rather varied proportion of LPG produced from each

source that differs around the world and even within a single country or continent. LPG is

created from natural gas production and processing in the Marcellus Shale region of the

United States, while crude oil refining facilities in the Gulf of Mexico produce considerable

amounts of LPG.

The original feedstock and the equipment used to extract and process natural gas or crude oil

can also affect the emissions produced by these processes. In terms of the overall emissions

from the use of LPG as a transportation fuel, emissions from these operations are called

"upstream emissions." The emissions linked with the compression, transportation, and final

delivery of LPG are also included in the upstream emissions. The term "well-to-cylinder

(WTT) emissions" refers to the sum of all of these upstream emissions. Quantifying WTT

emissions is difficult due to differences in production processes, transportation methods, and

distance (Ryskamp,2017).

14
2.4.2.2 Crude oil

Petroleum, commonly known as crude oil, is a complex natural liquid combination made up

mostly of hydrocarbons but also includes oxygen, nitrogen, and sulfur compounds. After

WWII, large oil reserves in the Middle East became accessible at a low cost, and they soon

altered our way of life. Given the massive changes it has brought to humanity, the twentieth

century is best considered the oil century (National Energy Strategy, 1995).

2.4.2.3 Natural gas

The four main natural gases are methane, ethane, butane, and propane, which are the first

four alkanes. Natural gas, often known as methane gas or natural methane gas, is a colorless,

highly flammable gas that is mostly made up of methane and ethane. It's a type of petroleum

that's commonly found with crude oil. Natural gas is a fossil fuel used to produce electricity,

heat, cook, and power some vehicles. Plastics and a range of other chemical products, such

as fertilizers and dyes, are made with it as a chemical feedstock. In many circumstances, the

stress exerted on the subterranean oil resource provides the urge to force oil to the surface.

Associated gas is a form of natural gas that contains light liquids like propane and butane and

is usually assumed to represent the gaseous phase of crude oil. As a result, related gas is

frequently referred to as "wet gas." There is no oil in certain reservoirs, but there is gas. Non-

associated gas is the name given to this type of gas. Dry gas is non-associated gas that comes

from reservoirs that aren't connected to any known liquid petroleum source (John,2021).

2.5. LPG Pollution

Nearly three billion people utilize solid fuels for cooking and heating daily, including coal,

charcoal, biomass, and dung. Solid fuels are commonly used in open flames or primitive

stoves, resulting in fuel waste and harmful emissions from incomplete combustion.

Residential solid fuel combustion has been recognized as a primary source of air pollutants
15
that harm human health and the global climate such as carbon monoxide (CO). Propane,

propylene, butane, and butylene make up liquefied petroleum gas (LPG or LP-gas), with

propane accounting for the majority of the product used for home heating. This gas is

primarily obtained from gas wells and is kept as a liquid under modest pressures. The three

forms of LPG available as heating fuels are commercial-grade propane, engine fuel-grade

propane (also known as HD-5 propane), and commercial-grade butane (ORISE, 2020).

2.6 Types of Gas Sensors

A device that detects the presence or concentration of gases in the atmosphere is known as a

gas sensor. By changing the resistance of the material inside the sensor, the sensor produces

a corresponding potential difference dependent on the gas concentration, which may be

recognized as output voltage. This voltage value can be used to calculate the gas's type and

concentration (Khan, 2020).

2.6.1 Modern Gas Sensor


2.6.1.1 Catalytic Bead Gas Sensor

A catalytic gas sensor detects gases at concentrations as low as a few percent by volume and

can be utilized directly in harsh and high-temperature environments. The catalytic principle

is used to create this sensor. It asserts that a catalytic exothermic reaction between oxidation-

reduction gases and solid oxides releases heat proportional to the gas concentration at a

particular operating temperature. The sensor offers a lot of stability and reliability since it

contains gas-sensing qualities including linear dependence of response signal on gas

concentration. In addition, the sensor has a correction component that mitigates the impacts

of variations in the working environment's temperature and humidity (Ho et al., 2011).

16
Catalytic gas detectors work on the idea that when gas oxidizes it releases heat which the

sensor translates to a sensor signal proportionate to the gas concentration using a

conventional Wheatstone bridge-type circuit. A pair of heating coils make up the sensor's

components (reference and active). A catalyst contains the active ingredient. The reaction

occurs on the catalyst's surface with combustible gases interacting exothermically with

oxygen in the air to raise the temperature of the air. As a result, the resistance changes. There

is also a reference element that provides an inert reference signal by remaining non-

responsive to gas and therefore acting as a stable baseline signal to compensate for

environmental changes that would otherwise impact the temperature of the sensor

(Bharadwaj, 2013).

Commercially accessible catalytic combustion gas sensors are mostly utilized as methane

detectors in coal mine security. High gas responsiveness with little water vapor impact is

favorable, but the primary hurdles to overcome are high power consumption, a very low

internal resistance, high cost, and low reproducibility. The delayed reaction caused by the

low sensing surface-to-mass ratio should also be addressed. To detect combustible gases,

catalytic combustion sensors are heated to 500°C using Pt wire, and the electric power

utilized for heating ranges from 300 to 700 mW. As a result, low-power catalytic combustion

sensors are essential for long-term sensor battery operation (Lee et al., 2011).

2.6.1.2 Photoionization Detector

The photoionization detector (P.I.D.) is one of a set of ionization detectors whose

development has yet to be finished. Ionization energy is carried by photons, which are

produced by discharge in inert gases or hydrogen. In addition to measuring the ionization

current, the CN and S emission lines in the vacuum area of the UV spectrum were measured

as well. Existing PID structures all work on the idea of a direct link between the compartment
17
where photons are generated and the compartment where chemicals eluted from the

separating column are ionized.

A photoionization detector (PID) is well known for its high sensitivity, wide dynamic range,

and non-destructive vapor detection capabilities. Due to the PID's delayed reaction, which is

caused by the comparatively large ionization chamber and dead volume, its usage in gas

chromatography (GC) has been limited. We developed a rapid, flow-through, and highly

sensitive microfluidic PID that was microfabricated directly on a conductive silicon wafer.

The microfluidic PID's ionization chamber volume is only 1.3 L, which is more than 10 times

smaller than the state-of-the-art and more than 100 times smaller than commercial PIDs.

Furthermore, because of its flow-through architecture, it has essentially little dead volume.

As a result, the microfluidic PID's response time can be significantly reduced, finally being

restricted by its residence time (7.8 MS for 10 mL/min and 78 MS for 1 mL/min). The peak

full-width-at-half-maximum of the microfluidic PID was measured to be 0.25 s and 0.085 s

for a flow rate of 2.3 mL/min and 10 mL/min, respectively. The microfluidic PID could also

identify analytes down to the picogram level (at 3dB of noise) and had a six-order-of-

magnitude linear dynamic range, according to the study (Zhu et al, 2015).

The photoionization detector was first commercially available as a portable trace gas analyzer

for vinyl chloride, benzene, and ammonia. In 1978, a modified version was released as a GC

detector, claiming to offer superior sensitivity and selectivity for olefins and aromatics than

the flame ionization detector. Despite several studies explaining the detector and its

applications1-33, however, interest has been slow to grow; one reason for this is that the

photoionization detector must be calibrated for each component of interest. The

photoionization detector is selective in the sense that its response can be higher or less than

18
that of a flame ionization detector, and the selectivity can be changed by adjusting the photon

source (Davenport, 1984).

2.6.1.3 Electrochemical Gas Sensor

Traditional electrochemical sensors use an agas diffusion working electrode, which is

typically made up of a platinum or graphite/platinum catalyst spread on PTFE tape. This

electrode reacts with the target fuel, while the counter electrode undergoes a balancing

reaction. The electrodes are housed in an exterior shell that contains a liquid electrolyte like

sulfuric acid. The gas usually enters the housing through a controlled diffusion port which

regulates the 15 entrances of the goal gas into the cell. The gasoline reacts with the electrode

and affects the sensor's electrical output (Hamad, 2021).

On the other hand, existing RTIL-based electrochemical gas sensors do not match the

wearable/flexible requirements. Traditional architectures including probes, Clark cells, and

silicon substrates have been adopted in most RTIL-based electrochemical gas sensors.

Recently it was stated that a paper-based planar sensor could give versatility and inexpensive

cost. Paper-based substrates, on the other hand, are not long-lasting and are not resistant to

acidic gases. There have been no reports of reliable flexible RTIL-based gas sensors too far

(Mu et al., 2013).

Various metric experiments were carried out in both the RTIL solution and the gas phase.

Voltammetric experiments in solution were carried out using a standard three-electrode cell

(2 mL). It had three holes in its Teflon cover for inserting a platinum wire counter electrode

and Ag/AgCl reference electrode and a glassy carbon disk working electrode the surface of

which was mirror-polished with fine alumina powder before each set of tests (Dossi et al.,

2012).

19
2.6.2 Traditional Gas Sensors
2.6.2.1 MQ135

The MQ135 gas sensor is one of the most widely utilized in the MQ sensor series. It's a Metal

Oxide Semiconductor (MOS) type Gas Sensor, also known as a Chemoreceptor because it

detects gas by changing the resistance of the sensing material when the gas comes into contact

with it. A simple voltage divider network can be used to detect gas concentrations. The

MQ135 Gas Sensor uses roughly 800mW and works on 5V DC. LPG, Smoke, Alcohol,

Propane, Hydrogen, Methane, and Carbon Monoxide have detection ranges of 200 to

10000ppm. An Anti-explosion network is a two-layer fine stainless-steel mesh that surrounds

the sensor because we are monitoring combustible gases, it ensures that the heater element

inside the sensor does not trigger an explosion (Chincholkar, 2016).

Figure 2.1 MQ135 gas sensor

2.6.2.2 MQ3

The MQ3 analog gas sensor is designed to detect alcohol and can be used in a Breathalyzer.

It has a high alcohol sensitivity and a low benzene sensitivity. The potentiometer can be used

to modify the sensitivity. The sensitive material in the MQ-3 gas sensor is SnO2, which has

lower conductivity in clean air. When the target alcohol gas is present, the conductivity of

the sensor rises in lockstep with the concentration of the gas. Using a basic electrical circuit
20
converts the change in conductivity to a gas concentration output signal. The MQ-3 gas

sensor has a high sensitivity to alcohol and is resistant to fuel, smoke, and vapor interference.

The sensor could be used to detect various concentrations of alcohol it is low-cost and suited

for a variety of applications (Bhuta, 2015).

Figure 2.2 MQ3 gas sensor


2.6.2.3 MQ5

The MQ-5 gas sensor utilized in this study replaces the old MQ-2 sensor to provide better

and more efficient gas detection. This transmits a voltage signal which is proportionate to the

gas level and is sent to the Arduino Uno. The Arduino sends this signal to the external

peripherals. As a result, the buzzer sounds an alarm, and the led illuminates. Simultaneously

this change in output is transferred through a wi-fi network to the cloud, where an application

is developed that sends an internet-based notification to the mobile phone or laptop

(Subramanian et al, 2020).

The output of the MQ-5 Gas Sensor reduces as soon as it senses any gas leakage from the

storage. This is detected by the microcontroller, which activates the LED and buzzer. The

exhaust fan is also switched on after a few milliseconds to throw the gas out, and the

microcontroller continues transmitting messages as "GAS LEAKAGE" to a pre-defined

cellphone number via the GSM Module (Banik et al., 2018).


21
The MQ-5 gas sensor's sensitive substance is SnO2, which has a reduced conductivity in

clean air. When a flammable gas is present in the target. As the gas concentration rises, the

sensor conductivity rises as well. The MQ-5 gas sensor is highly sensitive to propane, butane,

and liquefied petroleum gas (LPG), as well as natural gas. The sensor could be used to detect

several flammable gases, including Methane; it is inexpensive and ideal for a variety of

applications. The MQ-5 can detect gas concentrations ranging from 200 to 10,000 parts per

million (ppm). The output of the sensor is an analog resistance (Nancy, 2019).

Figure 2.3 MQ5 gas sensor


2.6.2.4 MQ6

The MQ-6 sensor, which is a gas detector, is utilized in the hardware input process and

delivers data to the Arduino microcontroller in the form of analog data. Once the data is

available it is processed and entered into conditioning in the microcontroller that has been

programmed. In this process, the Arduino microcontroller acts as a processing device and

controls all output devices. A SIM800L module that functions as a message sending media

if a gas leak is detected in the room, an LED light that serves to indicate a leak in the gas

cylinder, a fan that functions as a device that sucks gas in the room, and the last is a SIM800L

module that functions as a device that sucks gas in the room. The SIM800L module contains

a flaw, specifically in the network search section, which is frequently unreadable in the

network process, and the SMS gateway, which was co-developed (Fatkiyah et al, 2019).
22
Figure 2.4 MQ6 gas sensor

2.7 Related Work

Gas cylinder level and leakage detection systems were proposed and designed by many

researchers:

(Wickramasinghe, 2013) presented a low-cost gas leak detecting device for residential and

industrial applications. The sensor node is made up of MQ-4 and MQ6 gas sensors. A

network coordinator with a GPRS/GSM Module is part of the system. The relay nodes, which

facilitate communication between the sensor node and the network coordinator, expand the

range of wireless transmission. When a hazardous gas is identified in the atmosphere, the

network coordinator sends an alert to an operator by GSM/GPRS or Ethernet and/or controls

a gas emission source through a wireless actuator. The flammable gas concentration in the

environment is monitored by the sensor node. It is programmed to detect a variety of gas

concentrations and to raise an alarm if necessary.

Figure 2.5 Alarm & Scan Devices

23
(Folorunso et al, 2019) presented a gas leakage detection system that detects leakage gas and

alerts the user by creating a sound, as well as displaying a programmed message while

immediately closing the gas supply valve as a safety feature.

Figure 2.6 LCD

(Abishek, 2019) suggested an Arduino-based system for automatic gas control that validates

the detection of leakage gas by shutting down the cylinder's main supply line, then the burner

is turned off automatically by a timer-controlled knob, and it continuously calculates the

cylinder's weight.

Figure 2.7 Final Prototype of proposed system

24
(Alshammari, 2020) Proposed a low-level early warning signal that activates a high-pitched

alert during LPG leaking and protects the consumer.

Figure 2.8 Display of Normal Concentration


Along with that, we came up with a solution to this problem after investigating the possible

impact of cooking gas on the human respiratory system and its economic impact on

customers. We offered to design a system that emphasizes the level of the cooking gas

cylinder while also detecting gas leaks. Furthermore, we are preparing people to utilize an

app that monitors the gas cylinder and sends out notifications if there are any gas leaks.

25
CHAPTER III: RESEARCH METHODOLOGY

3.0 Introduction

This chapter explains the development methodology and guidelines for designing and

constructing the project. This chapter discusses the research methodology adopted in

completing the study. This chapter consists of system description, system overview, system

features, and system development requirements.

3.1 System Description

Liquified Petroleum Gas (LPG) is composed of a combination of butane and propane which

has a high flaming rate. It does not have an odor, so Ethanoate oil is added to it to be a

powerful odorant, due to that gas leakage can be easily detected. Nowadays, LPG has become

the latest fuel used for cooking instead of using charcoal however the leakage of the gas can

cause an accident which can impact the economy of users as well as human health. In such a

case, since some people are not aware of gas leaks or do not react quickly so it needs to be

reminded that we are proposing an essential system that protects if there are gas leakage

accidents and monitors the level of the gas in the cylinder. The proposed system's goal is to

continually measure the weight of the cylinder and send a notification to the users if there is

any leakage allowing them to take appropriate action. This device can also detect LPG gas

leaks such as propane and butane.

3.2 System Overview

After doing some research and being successful through different articles, we started working

on a method that can assist to monitor the leakage of gas and the level of the gas cylinder in

our country. From our research, we discovered many ways that can be tried to solve the

problem. Monitoring and Detecting Cooking Gas Level and Leakage Using IOT – a system

that will be implemented using a cloud-based mobile application. The system will help the
26
users to know the level of the cylinder and also notify them if there is gas leakage. Our

proposed system will overcome all the obstacles and problems that are in the cooking gas

level.

According to (Swetha, 2021) LPG cylinders play an important role in our daily lives. LPG is

primarily used to replace chlorofluorocarbons, which are known to cause considerable ozone

layer harm. It is one of the most extensively used fuels, with a volatile range of 1.8 percent

to 9.5 percent volume of gas in the atmosphere. It's divided into three groups based on the

amount of LPG in the cylinder: social, business, and industrial. LPG cylinders are categorized

as social units. Meanwhile, LPG cylinders in the business and industrial classes hold 12 and

20 kg of LPG, respectively. Customers must pre-book the cylinder before it is delivered in

one month due to the rising demand for LPG.

LPG gas is a flammable gas if released, can cause significant harm to people and property.

As a result, it should be handled with caution, and extra precautions should be made to avoid

any accidental leaking. LPG's key characteristics are that it is heavier than air, therefore it

does not disperse quickly, and can cause suffocation when inhaled. When the spilled gases

ignite, they have the potential to produce an explosion. In recent years, the number of

individuals killed by gas cylinder explosions has increased. People nowadays have extremely

busy schedules, and they may forget or lack the time to reserve gas from a gas agency.

However, it would be a lot easier and more convenient if there was a feature that

automatically booked the gas. Sometimes consumers fail to turn off the gas cylinder, which

can lead to gas leaks or fire (Anandhakrishnan, 2017).

27
3.3 System Features

• Level Monitoring

To find out the level of the gas cylinder we use the load cell and after we get the exact

amount of gas in the cylinder, we will display LCD or we can also use it to display in

the mobile app.

• Leakage Detection

To find out if there is a gas leakage we use a gas sensor, if there is a gas leakage, we

will send a notification to the homeowners using mobile app or an alert using Buzzer.

3.4 Development Environment

The development environment refers to the set of procedures and programming tools that are

used to generate a program or software product. The goal of a development environment is

to provide a safe environment for a developer to test everything they desire.

3.4.1 Programming Language

The Arduino IDE will be chosen as the hardware programming language, and Google

Firebase will be used as the backend database in this project. The client-side work will be

done with Flutter.

3.4.2 Arduino IDE

The Arduino IDE is a free program that allows you to write and upload code to Arduino

boards. The IDE application is compatible with Windows, Mac OS X, and Linux operating

systems. The programming languages C and C++ have been supported. The Arduino

software includes a text editor for writing code, a message box, a text console, a toolbar with

buttons for basic activities, and a series of menus (IDE).

28
3.4.3 Flutter

Flutter is a Google-developed portable UI toolkit that lets you create native-looking apps for

mobile, web, and desktop from a single codebase. Flutter is open-source and free, and it

integrates with existing programs. Developers and organizations from all over the world use

it.

3.4.4 Firebase

Google Firebase is a Google-backed app development platform that allows developers to

create apps for iOS, Android, and the web. Firebase delivers analytics tracking, reporting,

and app issue fixes, as well as marketing and product experimentation capabilities.

3.5 System Requirement Specification

IoT systems require hardware and software, so below we will discuss the hardware we need

to build up our project which is monitoring and detecting cooking gas level and leakage

Using IoT.

3.5.1 Hardware Specification


3.5.1.1 Arduino Uno
The Arduino serves as the system's brain, processing data from the sensor. Arduino is an

open-source hardware platform that hobbyists and enthusiasts all over the world can use to

create projects. It has an ATMEGA microcontroller that processes data and assures the

effective operation of the IoT system. And the best part is that the Arduino can be

programmed an unlimited number of times, allowing you to create a variety of IoT projects

by simply altering a few lines of code. Arduino programming necessitates the usage of the

C++ programming language. For Arduino-based IoT projects, IDE software is also required.

29
Figure 3.1 Arduino Uno
3.5.1.2 NodeMCU (ESP8266 )

NodeMCU is an open-source platform based on the ESP8266 that enables the connection of

devices and the flow of data over the Wi-Fi protocol. Furthermore, by providing some of the

most important microcontroller functions such as GPIO, PWM, ADC, and so on, it may be

able to meet many of the project's requirements on its own.

Figure 3.2 NodeMCU ( ESP8266 )


3.5.1.3 MQ135 Gas Sensor

Flammable gas and smoke sensors can detect combustible gas and smoke concentrations in

the air. Its primary purpose is to detect gas in the air when its concentration exceeds a safe

limit.

Figure 3.3 MQ135 Gas Sensor

30
3.5.1.4 WEIGHT SENSOR MODULE

The load cell module will be utilized as the weight sensor. A load cell is a weight

measurement device required for electronic scales that display weights in digits, according

to online sources. The use of a load cell is an electronic scale that is not limited to weight

measuring. A load cell is an electrical sensor or passive transducer that converts applied force

into electrical impulses. "Load transducers" is another name for it.

Figure 3.4 load cell


3.5.1.5 HX711 Converter

The HX711 electronic scale module's basic principle is to transform detected changes in

resistance value changes into electrical output via a conversion circuit. TTL RS232 is used

to interact with the host computer.

Figure 3.5 HX711 Converter

31
3.5.1.6 16x2 LCD

An LCD screen, also known as an electronic display module, is used in a variety of

applications. A 16x2 LCD is a basic module that can be applied to a variety of devices and

circuits. It has a blue backlight and white writing, with 16 columns by 2 lines and the

HD44780 controller is used to interact with the Arduino. The goal is to provide the user

with quick information.

Figure 3.6 16x2 LCD


3.5.1.7 Active Buzzer Module

When the signal is high, the Active Buzzer Arduino module produces a single-tone sound.

Use the Passive Buzzer module to create a variety of tones. A piezoelectric buzzer with a

built-in oscillator makes up the Active Buzzer module. A sound of around 2.5 kHz is

produced when the transmission is strong.

Figure 3.7 Active Buzzer Module

32
3.5.1.8 Breadboard

Before finishing any circuit design, a Breadboard is used to quickly develop and test circuits.

Many holes on the Breadboard allow circuit components like ICs and resistors to be added.

Figure 3.8 Breadboard


3.5.1.9 IIC Adapter

The IIC/I2C serial interface converter module for 1602 and 2004 LCDs is a handy little

device that reduces the number of wires required to connect a 1602 LCD to an Arduino. This

is performed by converting serial input to parallel input, which is then passed through a few

cables to LCDs. The pins are especially well-suited to HDHD44780-based LCDs, allowing

you to solder them directly into the back of the LCD unit, much like an Arduino Shield, or

use a Breadboard for less-permanent installations during prototyping or sketching.

Figure 3.9 IIC Adapter

33
3.5.1.10 AC-DC Converter

Electrical circuits that convert alternating current (AC) input to direct current (DC) output

are called AC/DC converters. AC/DC Converters, also known as "rectifiers," convert the

input AC voltage to a variable DC value, which is then optimized using a filter to produce an

unregulated DC voltage.

Figure 3.10 AC-DC Converter


3.5.2 Software Specification

3.5.2.1 Developers Prospective

The following software will be required to develop the proposed system:

▪ Arduino IDE

▪ Flutter as Frontend

▪ Google Firebase as the Backend

3.5.2.2 Users Prospective

We will design users to connect the app to their cylinder to determine the level of gas flow

so that it does not suddenly terminate while using it. They also receive a warning message

when the gas is low.

34
Chapter IV: System Analysis and Design

4.1 Introduction

This chapter provides system Analysis and design for successful implementation of

Monitoring and Detecting Cooking Gas Levels and Leakage Using IoT. And it also will be

talked about in this part of the current System. And it also, a brief description of system

design, database design, data dictionary, system components, and requirements or terms that

the system needs to work.

4.2 Current System

Most current systems focus on detecting gas leaks, and often do not check the level of gas,

existing system displays data on LCD so that the user is not always able to monitor the system

and does not use smartphones to display information everywhere.

4.3 The Need for This Work

This project presents an idea to continually measure the weight of the cylinder and send an

alert to the users if there is any leakage allowing them to take appropriate action. This device

is also capable of detecting LPG gas leaks such as propane and butane. The main goal of this

project is to monitor liquid petroleum gas (LPG) levels and detect if there is a gas leak to

avert significant fire incidents, as well as to facilitate safety precautions.

You can calculate the liquid level or remaining capacity of a cylinder in a few minutes. The

gas cylinder level sensor will automatically sound an alarm when the propane cylinder is

almost empty. It can also provide information about the liquid level to the Internet as a result

of the simplicity with which LPG operators can operate their businesses, increasing user

loyalty.

35
In detection, the sensor has outstanding sensitivity combined with a fast response time, and

the system is very reliable, tamper-proof, and secure. In the long run, maintenance costs are

very low when compared to current systems, and instantaneous results with high precision

are feasible.

4.4 Requirements

In this section, we'll talk about utilizing IoT to monitor and detect cooking gas levels and

leaking systems, and we'll divide the needs into two categories: functional requirements and

non-functional requirements.

4.4.1 Functional Requirements

A functional requirement is a requirement that describes an operation or activity. The

following are the requirements that the proposed system should functionally are:

➢ If gas leaks the user can able to receive a warning message as quickly as possible

through mobile app or buzzer alert.

➢ The user views the information on the cooking gas cylinder level through a mobile

phone or LCD.

4.4.2 Non-Functional Requirements

The requirement for non-functionally include:

➢ Simple to Use: The system is simple to use and interesting.

➢ Privacy: Only the administrator and authorized users have access to the system.

➢ Reliable: improved by features that aid in the prevention, detection, and repair of

hardware failures.

36
4.5 Feasibility Study

4.5.1 Schedule Feasibility

We write the first three chapters in January, February, March, and April and the other three

chapters in May, June, and July, and finally, we defend our proposal in august month.

4.5.2 Operational Feasibility

We created this project as a four-person team, and we worked on it in the University's

Electrical Library, where we also tested it.

4.5.3 Technical Feasibility

The tools that we used to make this project include Jumper Wires, Arduino Uno, Gas sensors,

Load-cell, Breadboard, Arduino App Language Program with C++, Laptop, etc.

4.5.4 Economic Feasibility

The financial part of our project needed to have the equipment, and it wasn't in the

Country, so we needed to buy it outside of the country, also there are other tools we found

It is inside our country, also there is our transportation and internet. The total cost is $150.

4.6 System Design

System design is the process of determining system aspects for a system based on needs, such

as modules, architecture, components, interfaces, and data. It is the process of identifying,

developing, and creating systems to fulfill the specific objectives and requirements of a firm

or organization.

37
4.6.1 UML diagram

Figure 4.1 System Diagram

38
4.7 Hardware Design.

Figure 4.2 Hardware Design

4.8 Database Design

Database design is defined as a set of steps that assist in the development, implementation,

and maintenance of a company's data management systems. The primary goal of database

design is to create logical and physical models of the proposed database system.

4.9 Database Diagrams

Figure 4.3 Database Design

39
4.10 Data Dictionary

Table 4.1 Users

Column Name Data Type Constraints


Email varchar(30) PRIMARY KEY
Username Varchar(30)
Password varchar(30)

Table 4.2 Devices

Column Name Data Type Constraints

Email varchar(30) FOREIGN KEY

Device_weight Varchar(30)

Percentage double

Leakage int

4.12 Summary

We discovered in this chapter hardware design, database design, system design, and

database components (Tables and their relationship) how would be our project is going.

40
CHAPTER V: IMPLEMENTATION AND TESTING

5.1 introduction

The chapter discusses some significant topics, including an overview of the implementation

environment, system snapshots, forms of the system with explanations, and an explanation

of how they operate.

5.2 Overview of the implementation environment

The main goal of this project is to monitor liquid petroleum gas (LPG) levels and detect if

there is a gas leak to avert significant fire incidents, as well as to facilitate safety precautions

without human interaction in areas where security is a concern. Therefore, the system uses a

gas sensor to monitor the level of the LPG and also detect if there is a gas leakage, and sends

an SMS to the consumer to notify them of the leak and display the mobile app and LCD the

level of the cylinder and if there is a leakage. The technology uses a weight sensor to

determine the weight of the cylinder and displays the matching weight on the LPG display.

5.3. Snapshots of the system

In the following snapshots, we will discuss the most important parts of our system and the

various functions it performs.

41
5.3.1 Application Snapshots
5.3.1.1 Signup Form

Figure 5.1 Signup Form

42
5.3.1.2 Login Form

Figure 5.2 Sign in Form

43
5.3.1.3 Dashboard

Figure 5.3 Dashboard

44
5.4 Hardware Snapshots
5.4.1 LCD

Figure 5. 4 LCD Display

This LCD is used to display the result of the level of the cylinder weight.

5.4.2 MQ135 Gas Sensor

45
Figure 5.5 MQ135 Gas Sensor

This sensor is used to detect if there is a gas leak.

46
5.4.3 Load-cell

Figure 5. 6 Load-Cell

This sensor is used to calculate the weight of the cylinder.

47
CHAPTER VI: CONCLUSION AND FUTURE WORK

6.0 Introduction

This chapter covers important topics such as the research's conclusion, the accomplishment

of the research objectives that we already mentioned in chapter one of the research,

recommendations, and future work for those who wish to conduct similar research, and it

will also make it simpler to understand and learn more about this work.

6.1 Conclusion

In this thesis, we focus on developing a prototype for an IoT-based LPG cylinder level

monitoring and gas leak detection system. It continuously checks for gas leaks and displays

the weight and gas level on mobile devices and LCD screens. The user will be informed of

the LPG leak and, if the user is around the home at that time, he/she will be alerted

immediately. Users will receive a warning message on their phones from an IoT-based

system, making them more aware of the gas level and LPG leak.

This system solves the need of not monitoring the gas level and the gas leak to prevent the

gas from running out at an inopportune time. and the risk of an undetected gas leak causing

a fire or suffocation. in this project, we use a load cell to measure the weight of the cylinder.

We used a load cell to measure the level of the cylinder and the weight obtained from the

load cell is transferred to the NodeMCU which keeps it to the server and then displays it on

the flutter app and LCD screen. Also, we used the mq135 sensor to detect gas leaks or fires

by beeping the buzzer and turning on the red led.

48
6.2 Recommendations

The load cell and mq135 gas sensors we are using is not suitable for this project, we

recommend that to get a load cell with a larger kg to be able to measure the cylinder weight

in real and the gas sensor is not reliable.

6.3 Future work

The future work is to include a booking system so that when the gas runs out, users order

another cylinder from the company they used to buy the gas from.

49
References

Abishek, V., & Aierselvam, M. (2019). Automatic Gas Controller Unit. International

Journal of Engineering Research, 8(05), 3.

Alshammari, B. F., & Chughtai, M. T. (2020). IoT Gas Leakage Detector and Warning

Generator. Engineering, Technology & Applied Science Research, 10(4), 6142–

6146. https://doi.org/10.48084/etasr.3712

Anandhakrishnan, D. N. (2017). IoT Based Smart Gas Monitoring System.

Andrew Turgeon. (2012). Natural Gas.

https://www.nationalgeographic.org/encyclopedia/natural-gas/

Banik, A., Aich, B., & Ghosh, S. (2018). Microcontroller-based low-cost gas leakage

detector with SMS alert. 2018 Emerging Trends in Electronic Devices and

Computational Techniques (EDCT), 1–3.

https://doi.org/10.1109/EDCT.2018.8405094

Bhuta, P. (2015). Alcohol Detection and Vehicle Controlling. 2(2), 6.

Chandak, L. C. L. (2020). IoT Based LPG Cylinder Monitoring System. International

Journal of Innovative Research in Electronics and Communications, 7(2).

https://doi.org/10.20431/2349-4050.0702001

Cheng, B., & Wang-Li, L. (2019). Responses of Secondary Inorganic PM2.5 to Precursor

Gases in an Ammonia Abundant Area In North Carolina. Aerosol and Air Quality

Research, 19(5), 1126–1138. https://doi.org/10.4209/aaqr.2018.10.0384

Chincholkar, S. P., & Suryawanshi, J. G. (2016). Gasoline Direct Injection: An Efficient

Technology. Energy Procedia, 90, 666–672.

https://doi.org/10.1016/j.egypro.2016.11.235

50
Davenport, J. N., & Adlard, E. R. (1984). Photoionization detectors for gas

chromatography. Journal of Chromatography A, 290, 13–32.

https://doi.org/10.1016/S0021-9673(01)93557-5

David Britt, D. T., Tranchemontagne, D., & Yaghi, O. M. (2008). Metal-organic

frameworks with high capacity and selectivity for harmful gases. Proceedings of the

National Academy of Sciences, 105(33), 11623–11627.

https://doi.org/10.1073/pnas.0804900105

Dossi, N., Toniolo, R., Pizzariello, A., Carrilho, E., Piccin, E., Battiston, S., & Bontempelli,

G. (2012). An electrochemical gas sensor based on paper supported room

temperature ionic liquids. Lab Chip, 12(1), 153–158.

https://doi.org/10.1039/C1LC20663J

Fatkiyah, E., Persada, D., & Andayati, D. (2019). Early Detection of Leaks on Gas

Cylinders Using Arduino Based MQ-6 Sensors. Journal of Physics: Conference

Series, 1413, 012030. https://doi.org/10.1088/1742-6596/1413/1/012030

Folorunso, C. O., Raheem, W. A., Akinyemi, L. A., & Raji, A. A. (2019). Development of

a Liquified Petroleum Gas Leakage Detector, Level Indicator, and Automatic

Shutdown System. 17.

Hamad Yusuf Mo’allim Adan, M. M. A. H. Y. M. (2021). An SMS Based Fire Alarm &

GAS LEAKAGE DETECTOR USING ARDUINO AND GSM MODULE.

Ho, T. G., Ha, T. D., Pham, Q. N., Giang, H. T., Thu Do, T. A., & Nguyen, N. T. (2011).

Nanosized perovskite oxide NdFeO 3 as material for a carbon-monoxide catalytic gas

sensor. Advances in Natural Sciences: Nanoscience and Nanotechnology, 2(1),

015012. https://doi.org/10.1088/2043-6262/2/1/015012

51
Kannan, S. (2017). Smart Gas Level Monitoring, Booking & Gas Leakage Detector over

IoT. 2017 IEEE 7th International Advance Computing Conference (IACC), 330–

332. https://doi.org/10.1109/IACC.2017.0078

Khan, Dr. M. M. (2020). Sensor-Based Gas Leakage Detector System. Proceedings of 7th

International Electronic Conference on Sensors and Applications, 8278.

https://doi.org/10.3390/ecsa-7-08278

Kodali, R. K., Devi B., T., & Rajanarayanan, S. C. (2019). IoT Based Automatic LPG Gas

Booking and Leakage Detection System. 2019 11th International Conference on

Advanced Computing (ICAC), 338–341.

https://doi.org/10.1109/ICoAC48765.2019.246863

Kurzekar, R., Arora, H., & Shrestha, R. (2017). Embedded Hardware Prototype for Gas

Detection and Monitoring System in Android Mobile Platform. 2017 IEEE

International Symposium on Nanoelectronic and Information Systems (INIS), 6–10.

https://doi.org/10.1109/iNIS.2017.11

Lee, E.-B., Hwang, I.-S., Cha, J.-H., Lee, H.-J., Lee, W.-B., Pak, J. J., Lee, J.-H., & Ju, B.-

K. (2011). Micromachined catalytic combustible hydrogen gas sensor. Sensors and

Actuators B: Chemical, 153(2), 392–397. https://doi.org/10.1016/j.snb.2010.11.004

Leghrib, R., Llobet Valero, E., Universitat Rovira i Virgili, & Departament d’Enginyeria

Electr??nica, E. i A. (2011). Design, fabrication, and characterization of gas

sensors based on nanohybrid materials doctoral thesis. Universitat Rovira i Virgili.

http://hdl.handle.net/10803/8481

Lokesh Chandak, A. K. (2020). IoT Based LPG Cylinder Monitoring System. International

Journal of Innovative Research in Electronics and Communications, 7(2).

https://doi.org/10.20431/2349-4050.0702001

52
Macker, A., Shukla, A. K., Dey, S., & Agarwal, J. (2018). ARDUINO Based LPG gas

Monitoring & Automatic Cylinder booking with Alert System. IEEE Conference

Record, 4.

Murugam, K. (2020). Intelligent gas booking and leakage system using wireless sensor

networks. 3C Tecnología_Glosas de Innovación Aplicadas a La Pyme, 273–285.

https://doi.org/10.17993/3ctecno.2020.specialissue4.273-285

Mu, X., Wang, Z., Zeng, X., & Mason, A. J. (2013). A Robust Flexible Electrochemical

Gas Sensor Using Room Temperature Ionic Liquid. IEEE Sensors Journal, 13(10),

3976–3981. https://doi.org/10.1109/JSEN.2013.2262932

Nancy Shukla, S. M. (2019). IoT Based LPG Gas Leakage Detector. International Journal

of Scientific Research in Computer Science, Engineering and Information

Technology.

Nandi, C., Debnath, R., & Debroy, P. (2019). Intelligent Control Systems for Carbon

Monoxide Detection in IoT Environments. In Z. Mahmood (Ed.), Guide to Ambient

Intelligence in the IoT Environment (pp. 153–176). Springer International

Publishing. https://doi.org/10.1007/978-3-030-04173-1_7

National Energy Strategy. (1995). PETROLEUM.

Oak Ridge Institute for Science and Education (ORISE). (2020). PMC7362386.

Rohith Naidu V, R. S. G. (2020). Smart LPG Gas Level Detection and Safety System using

IoT. International Journal of Engineering Research, 8(13), 4.

Ryskamp, R., & Nourigat, C. (2017). Emissions and Performance of Liquefied Petroleum

Gas as a Transportation Fuel: A Review. 36.

S Bharadwaj Reddy. (2013). Catalytic Gas Detectors Principle.

https://instrumentationtools.com/catalytic-gas-detectors-principle/

53
Subramanian, M. A., Selvam, N., Rajkumar, S., Mahalakshmi, R., & Ramprabhakar, J.

(2020). Gas Leakage Detection System using IoT with integrated notifications using

Pushbullet-A Review. 2020 Fourth International Conference on Inventive Systems

and Control (ICISC), 359–362. https://doi.org/10.1109/ICISC47916.2020.9171093

Swetha. (2021). Detection of Gas Level, Leakage, and Booking using IoT.
Vishnu, K. (2021). Detecting LPG Leakage and Automatic Turn off using Arduino

Connected with PIR Sensor. Journal of Physics: Conference Series, 1717(1),

012043. https://doi.org/10.1088/1742-6596/1717/1/012043

Wickramasinghe, N. A. (2013). LP GAS LEKAGE ALARM.

Zhu, H., Nidetz, R., Zhou, M., Lee, J., Buggaveeti, S., Kurabayashi, K., & Fan, X. (2015).

Flow-through microfluidic photoionization detectors for rapid and highly sensitive

vapor detection. Lab on a Chip, 15(14), 3021–3029.

https://doi.org/10.1039/C5LC00328H

54
Appendix A
Declaring gas sensor and loadcell variables and programming
#include <ESP8266WiFi.h>

#include <HX711.h>

#include <FirebaseArduino.h>

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

#define FIREBASE_HOST "gas-level-and-leakage-default-rtdb.firebaseio.com"

#define FIREBASE_AUTH "woYwSrlttdX6eAIiD2SHSoJw6k6MECHQKkbi1Rpv"

#define WIFI_SSID "Waaberi"

#define WIFI_PASSWORD "11223344"

WiFiClient client;

HX711 scale(D5, D6);

#define SensorPin A0

float calibration_factor = -743.37; // for me this vlaue works just perfect 419640 or 780.30

float current_weight;

void setup() {

Serial.begin(9600);

lcd.backlight();

55
// lcd.init();

lcd.begin();

scale.set_scale();

scale.tare(); //Reset the scale to 0

long zero_factor = scale.read_average(); //Get a baseline reading

WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

Serial.print("Connecting to ");

Serial.print(WIFI_SSID);

while (WiFi.status() != WL_CONNECTED) {

Serial.print(".");

delay(500);

Serial.println();

Serial.print("Connected to ");

Serial.println(WIFI_SSID);

Serial.print("IP Address is : ");

Serial.println(WiFi.localIP());

Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);

56
//Weight Calculate function

void weight_scale_sensor() {

scale.set_scale(calibration_factor); //Adjust to this calibration factor

double total_weight = 345; //294

current_weight = scale.get_units(5);

int empty_cylinder_weight = 12;

int remaining_weight = current_weight - empty_cylinder_weight;

int Avg_weight = (remaining_weight / total_weight) * 100;

//meesha datada lagu qoraayo

if (Avg_weight <= 0) {

Serial.println();

Serial.print("Weight: ");

Serial.print(0);

Serial.print("%");

Serial.println();

lcd.clear();

lcd.setCursor(0, 1);

lcd.print("Gas Weight: 0 %");

57
// Sending Data to Firebase

Firebase.setFloat("/ESP8266/gasData/gasLevel", 0);

// handle error

if (Firebase.failed()) {

Serial.print("setting /number failed:");

Serial.println(Firebase.error());

return;

delay(1000);

} else if ((Avg_weight <= 20) && (Avg_weight >= 10)) {

Serial.println();

Serial.print("Weight: ");

Serial.print(Avg_weight);

Serial.print("% G");

Serial.println();

Serial.println("Gaska Wuu Dhamaan Rawaa");

// Displaying Data to LCD

lcd.clear();

lcd.setCursor(1, 0);

58
lcd.print("Gaska wuu ");

lcd.setCursor(0, 1);

lcd.print("Dhamaan Rawaa");

// Sending Data to Firebase

Firebase.setFloat("/ESP8266/gasData/gasLevel", Avg_weight);

// handle error

if (Firebase.failed()) {

Serial.print("setting /number failed:");

Serial.println(Firebase.error());

return;

delay(1000);

else if (Avg_weight <= 100) {

Serial.println();

Serial.print("Weight: ");

Serial.print(Avg_weight);

Serial.println("%");

Serial.println();

59
Serial.println(" G");

// Displaying Data to LCD

lcd.setCursor(0, 1);

lcd.print("Gas Weight: ");

lcd.print(Avg_weight);

lcd.print("% G");

// Sending Data to Firebase

Firebase.setFloat("/ESP8266/gasData/gasLevel", Avg_weight);

// handle error

if (Firebase.failed()) {

Serial.print("setting /number failed:");

Serial.println(Firebase.error());

return;

delay(1000);

else if (Avg_weight > 100) {

Serial.print("Above Normal Weight ");

Serial.println();

60
Serial.println(Avg_weight);

// Displaying Data to LCD

lcd.clear();

lcd.setCursor(4, 0);

lcd.print("Above Normal");

lcd.setCursor(4, 1);

lcd.print("Weight");

// Sending Data to Firebase

Firebase.setFloat("/ESP8266/gasData/gasLevel", Avg_weight);

// handle error

if (Firebase.failed()) {

Serial.print("setting /number failed:");

Serial.println(Firebase.error());

return;

delay(1000);

//gas sensor function

61
void Gas_sensor() {

float sensorValue = analogRead(SensorPin);

Serial.println(sensorValue);

// sensorValue = map(sensorValue, 0, 1024, 0, 100);

if (sensorValue <= 300) {

Serial.print("Gas value: Normal");

Serial.println();

Serial.print(sensorValue);

// Displaying Data to LCD

lcd.clear();

lcd.setCursor(0, 0);

lcd.print("Gas Value: ");

lcd.setCursor(13, 0);

lcd.print(sensorValue);

// Sending Data to Firebase

Firebase.setFloat("/ESP8266/gasData/gasLeakage", sensorValue);

// handle error

if (Firebase.failed()) {

Serial.print("setting /number failed:");

62
Serial.println(Firebase.error());

return;

delay(1000);

else {

Serial.print("Warning! Gas Danger Occur");

Serial.println();

Serial.print(sensorValue);

// Displaying Data to LCD

lcd.clear();

lcd.setCursor(0, 0);

lcd.print("Gas Value: ");

lcd.setCursor(13, 0);

lcd.print(sensorValue);

lcd.setCursor(0, 1);

lcd.print("Gas Leak Detect");

// Sending Data to Firebase

Firebase.setFloat("/ESP8266/gasData/gasLeakage", sensorValue);

63
// handle error

if (Firebase.failed()) {

Serial.print("setting /number failed:");

Serial.println(Firebase.error());

return;

delay(1000);

void loop() {

Gas_sensor();

weight_scale_sensor();

64

You might also like