Professional Documents
Culture Documents
AUGUST 2022
JAMHRURIYA UNIVERSITY OF SCIENCE AND TECHNOLOGY
(JUST)
Original Literary Work Declaration
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.
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
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
iv
Table of Contents
Dedication .............................................................................................................................. II
Abstract .................................................................................................................................III
Acknowledgments ..……………………………………………………………...….….......IV
v
2.2 Weight Monitoring ..........................................................................................................10
vi
3.0 Introduction .....................................................................................................................26
vii
4.3 The Need for This Work .................................................................................................35
4.4 Requirements...................................................................................................................36
viii
5.3.1.1 Signup Form ......................................................................................................42
References .............................................................................................................................50
Appendix A ...........................................................................................................................55
ix
List of Figures
Figure 2.1 MQ135 gas sensor ............................................................................................... 20
x
Figure 5. 4 LCD Display .......................................................................................................45
xi
List of Tables
xii
Abbreviations
TTL Time-to-live
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
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
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
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
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
(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
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
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.
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
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
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
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
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
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
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
7
1.8 Organization of the study
study, Problem statement, Research objectives, Research question, the significance of the
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
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
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
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
et al., 2018).
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
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
(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
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.
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
13
2.4.2 Transportation Fuels
When evaluating different transportation fuels, it's important to include not only combustion-
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
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).
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).
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).
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
recognized as output voltage. This voltage value can be used to calculate the gas's type and
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
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
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).
development has yet to be finished. Ionization energy is carried by photons, which are
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
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
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 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
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
On the other hand, existing RTIL-based electrochemical gas sensors do not match the
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
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
the sensor because we are monitoring combustible gases, it ensures that the heater element
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
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
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
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).
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
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
a gas emission source through a wireless actuator. The flammable gas concentration in the
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
(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
cylinder's weight.
24
(Alshammari, 2020) Proposed a low-level early warning signal that activates a high-pitched
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
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
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
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
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
• 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.
The development environment refers to the set of procedures and programming tools that are
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
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
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
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.
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.
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
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.
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
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
31
3.5.1.6 16x2 LCD
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
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
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.
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
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.
▪ Arduino IDE
▪ Flutter as Frontend
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
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
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
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
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.
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
➢ The user views the information on the cooking gas cylinder level through a mobile
phone or LCD.
➢ 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
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.
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.
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.
System design is the process of determining system aspects for a system based on needs, such
developing, and creating systems to fulfill the specific objectives and requirements of a firm
or organization.
37
4.6.1 UML diagram
38
4.7 Hardware 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.
39
4.10 Data Dictionary
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
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.
In the following snapshots, we will discuss the most important parts of our system and the
41
5.3.1 Application Snapshots
5.3.1.1 Signup Form
42
5.3.1.2 Login Form
43
5.3.1.3 Dashboard
44
5.4 Hardware Snapshots
5.4.1 LCD
This LCD is used to display the result of the level of the cylinder weight.
45
Figure 5.5 MQ135 Gas Sensor
46
5.4.3 Load-cell
Figure 5. 6 Load-Cell
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
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
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
Alshammari, B. F., & Chughtai, M. T. (2020). IoT Gas Leakage Detector and Warning
6146. https://doi.org/10.48084/etasr.3712
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
https://doi.org/10.1109/EDCT.2018.8405094
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
https://doi.org/10.1016/j.egypro.2016.11.235
50
Davenport, J. N., & Adlard, E. R. (1984). Photoionization detectors for gas
https://doi.org/10.1016/S0021-9673(01)93557-5
frameworks with high capacity and selectivity for harmful gases. Proceedings of the
https://doi.org/10.1073/pnas.0804900105
Dossi, N., Toniolo, R., Pizzariello, A., Carrilho, E., Piccin, E., Battiston, S., & Bontempelli,
https://doi.org/10.1039/C1LC20663J
Fatkiyah, E., Persada, D., & Andayati, D. (2019). Early Detection of Leaks on Gas
Folorunso, C. O., Raheem, W. A., Akinyemi, L. A., & Raji, A. A. (2019). Development of
Hamad Yusuf Mo’allim Adan, M. M. A. H. Y. M. (2021). An SMS Based Fire Alarm &
Ho, T. G., Ha, T. D., Pham, Q. N., Giang, H. T., Thu Do, T. A., & Nguyen, N. T. (2011).
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
https://doi.org/10.3390/ecsa-7-08278
Kodali, R. K., Devi B., T., & Rajanarayanan, S. C. (2019). IoT Based Automatic LPG Gas
https://doi.org/10.1109/ICoAC48765.2019.246863
Kurzekar, R., Arora, H., & Shrestha, R. (2017). Embedded Hardware Prototype for Gas
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.-
Leghrib, R., Llobet Valero, E., Universitat Rovira i Virgili, & Departament d’Enginyeria
http://hdl.handle.net/10803/8481
Lokesh Chandak, A. K. (2020). IoT Based LPG Cylinder Monitoring System. International
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
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
Technology.
Nandi, C., Debnath, R., & Debroy, P. (2019). Intelligent Control Systems for Carbon
Publishing. https://doi.org/10.1007/978-3-030-04173-1_7
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
Ryskamp, R., & Nourigat, C. (2017). Emissions and Performance of Liquefied Petroleum
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
Swetha. (2021). Detection of Gas Level, Leakage, and Booking using IoT.
Vishnu, K. (2021). Detecting LPG Leakage and Automatic Turn off using Arduino
012043. https://doi.org/10.1088/1742-6596/1717/1/012043
Zhu, H., Nidetz, R., Zhou, M., Lee, J., Buggaveeti, S., Kurabayashi, K., & Fan, X. (2015).
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>
WiFiClient client;
#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();
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to ");
Serial.print(WIFI_SSID);
Serial.print(".");
delay(500);
Serial.println();
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
56
//Weight Calculate function
void weight_scale_sensor() {
current_weight = scale.get_units(5);
if (Avg_weight <= 0) {
Serial.println();
Serial.print("Weight: ");
Serial.print(0);
Serial.print("%");
Serial.println();
lcd.clear();
lcd.setCursor(0, 1);
57
// Sending Data to Firebase
Firebase.setFloat("/ESP8266/gasData/gasLevel", 0);
// handle error
if (Firebase.failed()) {
Serial.println(Firebase.error());
return;
delay(1000);
Serial.println();
Serial.print("Weight: ");
Serial.print(Avg_weight);
Serial.print("% G");
Serial.println();
lcd.clear();
lcd.setCursor(1, 0);
58
lcd.print("Gaska wuu ");
lcd.setCursor(0, 1);
lcd.print("Dhamaan Rawaa");
Firebase.setFloat("/ESP8266/gasData/gasLevel", Avg_weight);
// handle error
if (Firebase.failed()) {
Serial.println(Firebase.error());
return;
delay(1000);
Serial.println();
Serial.print("Weight: ");
Serial.print(Avg_weight);
Serial.println("%");
Serial.println();
59
Serial.println(" G");
lcd.setCursor(0, 1);
lcd.print(Avg_weight);
lcd.print("% G");
Firebase.setFloat("/ESP8266/gasData/gasLevel", Avg_weight);
// handle error
if (Firebase.failed()) {
Serial.println(Firebase.error());
return;
delay(1000);
Serial.println();
60
Serial.println(Avg_weight);
lcd.clear();
lcd.setCursor(4, 0);
lcd.print("Above Normal");
lcd.setCursor(4, 1);
lcd.print("Weight");
Firebase.setFloat("/ESP8266/gasData/gasLevel", Avg_weight);
// handle error
if (Firebase.failed()) {
Serial.println(Firebase.error());
return;
delay(1000);
61
void Gas_sensor() {
Serial.println(sensorValue);
Serial.println();
Serial.print(sensorValue);
lcd.clear();
lcd.setCursor(0, 0);
lcd.setCursor(13, 0);
lcd.print(sensorValue);
Firebase.setFloat("/ESP8266/gasData/gasLeakage", sensorValue);
// handle error
if (Firebase.failed()) {
62
Serial.println(Firebase.error());
return;
delay(1000);
else {
Serial.println();
Serial.print(sensorValue);
lcd.clear();
lcd.setCursor(0, 0);
lcd.setCursor(13, 0);
lcd.print(sensorValue);
lcd.setCursor(0, 1);
Firebase.setFloat("/ESP8266/gasData/gasLeakage", sensorValue);
63
// handle error
if (Firebase.failed()) {
Serial.println(Firebase.error());
return;
delay(1000);
void loop() {
Gas_sensor();
weight_scale_sensor();
64