Received: 18 October 2021 Revised: 20 February 2022 Accepted: 22 February 2022
DOI: 10.37917/ijeee.18.1.8 Vol. 18| Issue 1| June 2022
Open Access
Iraqi Journal for Electrical and Electronic Engineering
Original Article
IoT Based Gas Leakage Detection and Alarming
System using Blynk platforms
Noor Kareem Jumaa*, Younus Mohammed Abdulkhaleq, Muntadher Asaad Nadhim, Tariq Aziz Abbas
Al-Mansour University College, Computer Technology Eng. Dept., Baghdad, Iraq
Correspondence
*Noor Kareem Jumaa
Al-Mansour University College,
Computer Technology Eng. Dept., Baghdad, Iraq
Email: [email protected]
Abstract
Gas or liquefied petroleum gas (LPG) is a chemical substance resultant from petroleum and could be dangerous in industrial
places or those that deal with this substance. Gas leakage causes many health issues. So, to prevent such catastrophes and in
order to maintain a clean air environment, the workspace atmosphere should be frequently monitored and controlled. The
proposed monitoring gas leakage detector system is based on Internet of Things (IoT) technology. NodeMCU ESP8266 Wi-Fi
is used to be the microcontroller for the whole system. The combustible gas sensor (MQ2) is used in order to detect the presence
of methane (CH4) and carbon monoxide gas (CO). MQ2 sensor will detect the concentration of the gas according to the voltage
output of the sensor and the ESP8266 will send the data reading from the gas sensor to Blynk IoT platform over an IOS phone;
data visualization is done using Thingspeak IoT Platform. Besides, a fan will immediately work upon the leakage occurs along
with an alarming buzzer.
KEYWORDS: IoT, Gas leakage, Blynk platform, Thingspeak, LPG, Alarm system.
I. INTRODUCTION LPG consists of a mixture of propane and butane which
is a highly flammable chemical. It is an odorless gas due to
One of the very important things in human life is safety.
which Ethanethoil is added as a powerful odorant, so that
Safety refers to the awareness of risks and potential dangers
leakage can be easily detected. LPG Gas leaks have
in and around human locations, which may cause bodily
increased from 0.72% to 10.74% of all kitchen accidents.
harm or even death. There are several kinds of risks and
The small LPG cylinder of weight 5kg in which the burner is
potential dangers which threaten the safety of many houses
located immediately over the cylinder without using a rubber
and lives. One of the risks and potential dangers is the gas
tube is seen to be safer than the one which uses a rubber pipe
leak that may affect serious damage in the place where the
as this subway has the hazards of getting cracked which in
person is. [1]
turn can make way to leakage [3].
Liquefied Petroleum Gas (LPG) was first discovered in
In this research, a computer program running online was
1910 by the scientist Dr. Walter Snelling which is a mixture
created to detect leakage locations and act as an automatic
of commercial gases such as propane and butane with
supervisor in remote areas; simple gas leak detector is a
saturated and unsaturated hydrocarbons Due to the
simple device that is used to detect the leakage of gas and if
usefulness of LPG, it is widely employed for many purposes
the gas leak occurs, an equivalent message is conveyed by
such as industrial and domestic fuel, auto gas, heating,
the means of a buzzer and powered by Wi-Fi, it is capable to
lighting, etc. The wide demand for LPG leakage is growing
broadcast messages to the stakeholders about the LPG leak
day by day. However, when LPG is leaked, it may cause
through the Blynk application which is based on the IoT
serious fire accidents. Also, the number of casualties due to
technology; where -IoT is defined as a system that permits
such incidents is also on the rise in recent years. Therefore,
the devices for communicating with each other directly
there is the purpose for a system to find and also prevent the
without human intervention [4]-. The proposed system will
leakage of LPG. Before the invention of electronic gas
continuously monitor the environment for any leakage. Just
detectors for households in the 1980s, they were detected by
in case of any leakage detection, it'll alert the user via a
a chemical dipped paper that changed its color in the
buzzer and by using the ESP2866 wifi microcontroller and
presence of those gases. But then, many inventions were
an IOS IoT application; it'll alert the user about the
discovered to find, monitor, and alert the spillage of
environmental conditions to the gas level of that location of
dangerous gases [2].
This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and
reproduction in any medium, provided the original work is properly cited.
© 2022 The Authors. Published by Iraqi Journal for Electrical and Electronic Engineering by College of Engineering, University of Basrah.
https://doi.org/10.37917/ijeee.18.1.8 https://www.ijeee.edu.iq 64
Jumaa, Abd.ulkhaleq, Nadhim, & Abbas | 65
installation using Blynk (as mentioned previously)
notification. Thingspeak IoT platform is used for data
visualization to illustrate the gas level variety which
performs the gas sensor readings.
II. LITERATURE SURVEY
In [1], a gas leakage detection system was developed to
warn the human from the gas toxic; the warning is a Short
Message Service (SMS) goes to the corresponding person’s
cellphone using Arduino UNO and SIM900 GSM/GPRS
gateway.
In [2], the researcher designed a gas detection leakage
they proposed that if any leakage is sensed through the gas
sensor, a SMS will be sent automatically to the
corresponding persons or family member using GSM. Their
system has an added function to measure the weight of the
LPG cylinder and displayed on the LCD display. If the
quantity of the gas cylinder is less or equal to10kg, it will
automatically book the LPG cylinder by sending an SMS to Fig. 1: Robot-based gas leakage detector.
the dealer. Also when the weight of the LPG cylinder comes
down to 0.5 Kg, it alerts the persons in the house by SMS to b) GSM-based gas leakage detector: an LPG gas
change the cylinder. sensor is used for sensing the leakage and produce
In [5], the author had developed a system capable of the result in Short Message Service (SMS) with
measuring the amount of gases in ppm and percentage to help of Arduino Uno to alert humans. The sensor
save the human body from the various toxic gases and has excellent sensitivity combined with a quick
hazardous elements or chemicals or compound consisting in requital time and also sense iso-butane, propane,
the atmosphere. In his proposed system, he used Arduino Fig. (2) shows the prototype of GSM based gas
Uno R3, nRF24L01Plus Wireless Transceiver Module, and leaks detector.
the MQ2 gas sensor and the results was monitoring at the
receiver side using Arduino IDE serial monitoring.
In [6], the author proposed an IoT based gas detection
Gas LCD
prototype using Proteus design suite. He depends the Blink
IoT platform for data visualization. He concludes the system Sensor
said that the proposed technique wirelessly transfers alert Arduino Buzzer
notification to the user and therefore the user can easily Uno
connect the devices through a Smartphone from any location.
Flame Fan
III. GAS LEAKAGE DETECTION TECHNIQUES [7, 8] Sensor
Valve
There are several different techniques to design a gas leakage
detector, the most popular techniques are as follows: GPS/GS
a) Robots-based gas leakage detector: it is an M
automatic gas detection and indication robot. The Module
prototype depicts a mini mobile robot that is Fig. 2: Robot-based gas leakage detector.
capable to detect gas leakage in hazardous places.
Whenever a gas leakage occurs in a particular place, c) IoT-based gas leakage detector: in this type of gas
the robot directly reads the data and sends it to the leak detection, ESP2866 nodeMCU is usually used
android mobile via a wireless connection such as as a microcontroller and a wifi module.
Bluetooth. An android application for Android- This system records the value of the LPG leak level
based smartphones could be used, which can on an IoT platform –which could be a cloud
receive data from robots directly through Bluetooth. platform of application platform- and the awareness
The application warns with an indication whenever message is sent to the smartphone through the wifi
there is an occurrence of gas leakage. Fig. (1) on an IoT application such as Blynk IoT
illustrates this prototype. application. Fig. (3) illustrates this prototype.
66 | Jumaa, Abd.ulkhaleq, Nadhim, & Abbas
V. METHODOLOGY
When a gas leak occurs, which is detected by a gas
sensor MQ-2, it will send data to the controller (ESP8266)
via the controller analog port (A0) as illustrated in Fig. (4).
Then the controller (ESP8266) will send a warning text
message alerting the occurrence of a gas leak via (Wi-Fi)
technology in conjunction with Blynk Application which
works on Android and IOS operating systems, the proposed
system used IOS Blynk App. At the same time, the buzzer
will be on for an alarming, by connecting it to the
Fig. 3: IoT-based gas leakage detector. microcontroller digital port (D5), and the fan will be
working to change the air of the place and get rid of leaking
IV. PROPOSED SYSTEM COMPONENTS gas. A transistor works in the form of a switch that turning
In this research, the hardware components (Gas Sensor on and off low loads, when the circuit is closed -while the
MQ-2, Wi-Fi Node MCU ESP8266, Fan, Power Supply 9V, red LED is on- the relay is turning on and off the high loads,
Buzzer, Relay, Buttery 3.3v to 5v, red LED and green LED, where the high load performs the fan. The flowchart of the
Transistor B514, Breadboard, 200 ohms resistors) were used proposed system is shown in Fig. (5).
along with Blynk Application.
The following subsections describe the details of the VI. WORKING PRINCIPLES
proposed system. Table (1) below review the components, Following subsections describe the working principles of
their quantity, and price in IQD. the proposed system’s parts.
a) Blynk Platform
TABLE 1 The Internet of Things (IoT) connects devices and
List of required hardware opponents, quantity and price in tools to the internet network to be controlled remotely
IQD. through websites and smartphone applications, as well
Component Quantity Price as to control tools and instruments by means of codes
ESP8266 nodemcu 1 13000 and algorithms structures for artificial intelligence
MQ2 gas sensor 1 5000 issues. IoT is used for smart home controlling to operate
T09D060-2D1 power supply 1 8000 lamps or other home-use devices, it can also be used as
92*92*25mm fan 1 3000 a security system or as an industrial-use system. For
Buzzer 1 1000 example, to open or close the main building gate, to
Normally-open relay 1 2000 operate a fully automatic industrial machine, or even to
9 volts battery 1 3000 control internet and communication ports. More ideas
Bread board 1 3000 can be done using IoT technology. Huge industrial
LEDs 2 1000 facilities or governmental institutions have many lamps.
Transistor 1 2000 Employees sometimes forget to turn them off at the end
Resistor 1 250 of the day. Energy could be saved by letting the security
Wires 16 3000 control lighting of the building with IoT clouds or
applications.
Fig. 4: Circuit Diagram of the Proposed System.
Jumaa, Abd.ulkhaleq, Nadhim, & Abbas | 67
Blynk is an IoT platform that supports both IOS and 3) The Blynk libraries, which consist of various widgets
Android while being compatible with a plethora of to perform different control, display, and time
microcontrollers such as Node MCU (ESP), STM32, management operations.
Arduino and Raspberry Pi over the Internet. The
architecture of Blynk consists of three major b) Proposed System Operations
components: [9]
1) The Blynk application, which controls an embedded This system contains two power sources. The first
system and displays sensing data on widgets. source is a power Supply T09D060-2D1, which is a
transformer that converts high voltage 220v to low
voltage 9v and feeds the fan. The second source is a
Start battery rechargeable (3.3v-5v) that feeds the controller
(Wi-Fi Node MCU ESP8266) as well as the rest of the
circuit elements.
The controller ports must be connected to the sensor as
follows:
Initialization (Vcc → 3.3v , GND → GND , A0 → A0) also (D5 →
+buzzer , D6 → + green LED , D7 → +red LED)
The relay is also connected to the transistor and the fan,
as shown in Fig. (6) below:
MQ-2 Gas
sensor
No Ye
Is gas s
level >=
140 ?
Fig. 6: Relay Connections.
ESP8266 ESP8266
Node MCU Node MCU VII. REAL TIME PROTOTYPE
As mentioned in previous sections, this system is built
based on the controller (ESP8266) with the gas sensor (MQ-
Send the 2), as shown in the real pictures illustrated in Fig. (7). In the
Turn on red
Gas level to LED & event of gas leakage, the sensor will send a signal to the
the Blynk Buzzer & controller, through Wi-Fi technology, the controller will
APP. Fan send a warning text message of the presence of gas leakage
using the Blynk application available on the mobile phone
system. In this system, an IoS mobile phone is used. The fan
and the red light will also work.
Turn on Send
green LED message to
the Blynk
APP.
END
Fig. 5: The Flowchart of the Proposed System.
2) The Blynk server, which allows all cloud-based
communications between smartphones and embedded
systems. Fig. 7: Real-Time Prototype of the Proposed System.
68 | Jumaa, Abd.ulkhaleq, Nadhim, & Abbas
VIII. BLYNK’S IOT PLATFORM RESULTS
When a gas leak occurs, a message warning of the
presence of leaked gas will be sent to the mobile phone
interface as shown in Fig. (8) below which clarifies the Blynk
app. notification.
Fig. 8: Blynk app notification. Fig. 9: Blynk app notification for gas leakage case.
Fig. (9) illustrates a Blynk warning message of gas leakage
case, the amount of gas which is the gas sensor reading can
be seen. For example, the gas level was (192), which
exceeded the threshold limit (140). While Fig. (10) illustrates
the value of the data sensor reading (75) which does not
exceed the threshold limit (140), so it represents the normal
condition of the system in terms of no gas leakage.
It should be mentioned that the system status is based on
the following table.
TABLE 2
Threshold of Gas Detection.
MQ2 Sensor Reading Status
< 140 No gas leakage
≥ 140 Gas leakage detected
IoT Thingspeak platform is used to record the readings of
the MQ2 gas sensor. Fig. (11) views the readings that
performs the LPG intensity in the gas leakage location.
Fig. (12) shows the details of ‘Field1’ from 8 fields
available in the Thingspeak’s channel. The starting of the
leakage is also illustrated in the figure.
From Fig. (12), starting of the gas leakage is clear in the
details of the Thingspeak’s field1 where the gas sensor
reading was 141 which presents the gas intensity in the
atmosphere with 14.1%.
Fig. 10: Blynk app notification for no gas leakage case.
Jumaa, Abd.ulkhaleq, Nadhim, & Abbas | 69
Fig. 11: Thingspeak IoT platform visualization for gas sensor readings.
NodeMCU microcontroller also makes the system cheaper.
Quick access and control makes the system very useful.
In addition, this paper presents a gas leakage detection
system using two IoT platforms; Blynk IoT application to
alarm the regarding person and the Thingspeak IoT cloud for
data recording and visualization.
CONFLICT OF INTEREST
The authors have no conflict of relevant interest to this
article.
Fig. 12: Thingspeak’s channel1/field1 visualization for gas REFERENCES
sensor readings. [1] Marchel Thimoty Tombeng, “Prototype of Gas Leak
Detector System Using Microcontroller and SMS
IX. CONCLUSIONS Gateway”, Cogito Smart Journal, Vol. 3, No. 1, 2017.
In this research, an IoT approach for gas leakage detection [2] T. Alex Stanley Raja, R. Senthil Kumar, A.
system at a low concentration is described. The leakage is Nandhakumar, and K. V. Santhosh Kumar, “LPG Leakage
detected using the MQ-2 gas sensor. The sensor sends a Detection and Autorefilling Using Arduino”, International
signal to ESP2866 NodeMCU microcontroller. In the next Journal of Engineering and Advanced Technology, Vol. 8,
step, microcontroller sends an active signal to other Issue 2S, 2018.
externally connected device which performs a cellphone. [3] Vasudev Yadav, Akhilesh Shukla, Sofiya Bandra,
The efficiency of the NodeMCU is proven through Vipin Kumar, Ubais Ansari, and Suraj Khanna, “A Review
sending multiple messages to the Blynk application that on Microcontroller based LPG Gas Leakage Detector”,
could be a message per second, which is faster than other IoT Journal of VLSI Design and Signal Processing, Vol. 2,
platforms, for example, the Thingspeak IoT platform sends Issue 3, 2016.
message each 15 seconds which is used for recording the [4] Noor Kareem Jumaa, “Survey: Internet of Thing Using
readings of the gas sensor. The number of warning messages FPGA”, Iraqi Journal for Electrical and Electronic
sent could be set by changing the programming of the Engineering, Vol. 13, Issue 1, 2017.
NodeMCU. This easy control over the devices like exhaust [5] Mobasshir Mahbub, “Toxic and hazardous gas
fan makes the environment less accident- prone. Using the detection, measurement and monitoring system for safety
assurance in home and industrial application of wireless
70 | Jumaa, Abd.ulkhaleq, Nadhim, & Abbas
sensor node”, Engineering and Technology Research, Vol.
1, No. 3, 2019.
[6] Guru rama gayathri and Yoga ananth, “IoT BASED
GAS MONITORING SYSTEM USING ARDUINO”,
International Research Journal of Engineering and
Technology, Vol. 7, Issue 4, 2020.
[7] Prof. Parag Naik, Pranay Dhopte, Rajat Wanode,
Roheet Kantode, and Saurabh Nagre, “Gas Sensor Using
Arduino UNO & MQ2 Sensor”, International Journal of
Advanced Research in Computer and Communication
Engineering, Vol. 7, Issue 3, 2018.
[8] Syeda Bushra Shahewaz and Ch. Rajendra Prasad,
“Gas leakage detection and alerting system using Arduino
Uno”, Global Journal of Engineering and Technology
Advances, Vol. 05, No. 03, 2020.
[9] http://www.blynk.cc/