Smart LPG Gas Level Detection and Safety System using IoT

Download Full-Text PDF Cite this Publication

Text Only Version

Smart LPG Gas Level Detection and Safety System using IoT

Rohith Naidu V

Department of Electronics and Communication Engineering

NIE Institute of Technology, Mysuru-570018


Asst. Prof, Department of Electronics and Communication Engineering

NIE Institute of Technology, Mysuru-570018

Rakshith S Gowda

Department of Electronics and Communication Engineering

NIE Institute of Technology, Mysuru-570018

Ashwini D S

Department of Electronics and Communication Engineering

NIE Institute of Technology, Mysuru-570018

AbstractLiquefied Petroleum Gas (LPG) is widely used in households, but the consumer is unaware of the daily rate of consumption and the time frame when he/she needs to book a refill. Gas leakages results a serious problem in household and other areas where household gas is used. So in this project, we present an Internet of Things (IoT) based system which monitors different aspects related to LPG cylinder, and thereby keeps the consumer updated via a mobile application.

This project has two parts, one part deals with the percentage of gas remaining in the cylinder which is found using a sensor called load cell and the percentage of gas remaining in the cylinder is updated continuously to the app that is being used by the user and when the gas level is less than the threshold value then an alert will be given to the user through the buzzer and notified in the mobile app.

Another part is the safety feature that is inherent part of this home automation system, as when gas leakage is detected it alerts the user via mobile application and also through buzzer. Simultaneously, it turns off the gas regulator knob to prevent further leakages from the source. We can also turn on and off the gas valve using our mobile application The system is designed such that it can be used as an LPG cylinder stand.

Keywords IOT, LPG gas, MQ2 gas sensor, load cell, firebase, MIT app Inventor, NodeMCU.


    In our day to day life, LPG cylinder plays a major role. LPG is an odourless gas which is a mixture of propane and butane. It contains both saturated and unsaturated hydrocarbons. Ethyl Mercaptan is the stanching agent which is used to impart odour to the odourless LPG. LPG is liquefied under moderate pressure and has replaced many conventional fuel systems in household and commercial sectors. Though it is one of the most commonly used fuels, it has an explosive range of 1.8%9.5% volume of gas in air.The main application of the LPG is that it is used in the place of chlorofluro carbon which cause great damage to the ozone layer. LPG is packed into 3 categories according to the weight of the LPG in the cylinder: Household, Commercial and Industrial. The Household category of LPG cylinder contains 14.2 kg LPG in the cylinder. Similarly, the Commercial and Industrial categories of LPG cylinders contain 19 and 35 kg of LPG respectively. [1]

    The LPG is filled only up to 85% in these cylinders above which will be vapours. This is due to the expansion property of the LPG and consequently, contributes as a safety

    precaution to avoid any hazards. For every 1 rise in temperature, the pressure of LPG inside the cylinder will increase by 15 kg/cm3. This makes LPG a very hazardous and extremely inflammable gas. At present we are having an Advanced system for LPG cylinder booking through IVRS, SMS or online. With the rising demand for LPG, users have to pre book their LPG cylinder. Most of the times, users find it difficult to figure out how much of LPG is left within the cylinder and this causes a lot of trouble to them. In such a situation, an efficient method to monitor the level of LPG in the cylinder is required, so that the users are aware of the LPG level within the cylinder. They can take necessary steps in booking a new cylinder.

    So this project deals with finding the level of gas in the cylinder and sending this information for booking of the new LPG cylinder when the gas level is low and this project also deals with the detection of gas leakage and automatically turning off the gas valve if there is leakage of gas. When there is gas leakage and the gas level in the cylinder goes below the threshold level then the output of the sensor is sent to the microcontroller and the buzzer is turned on and also it will be displayed in the users phone. We can also turn on and turn off the gas valve through our mobile phones.


    This project uses NODEMCU ESP8266 microcontroller board which is the main block of the system. We are using sensors like load cell,gas sensor,fire sensor and buzzer which are all connected to the esp8266 board. The data from the esp8266 is sent to the firebase cloud and finally the data or the is received by an app in the phone which is built using mitapp inventor.


    1. NodeMCU ESP8266 board

    2. MQ2 gas sensor

    3. Load cell with HX711 amplifier

    4. Servo Motor

    5. Piezoelectric Buzzer

    6. Power supply 3.3-5 V


    1. Arduino IDE

    2. Google Firebase

    3. MIT App Inventor

    Fig.1 Block diagram of the system.

    NodeMCU is an open-source IoT platform. It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems and hardware which is based on the ESP-12 module. The term NodeMCU by default refers to the firmware rather than the development kits. The firmware uses the Lua scripting language, it is based on the eLua project and built on the Espressif Non-OS SDK for ESP8266. The NodeMCU is analogous to the Arduino micro-controller combined with the ESP8266 module which has inbuilt wifi module shown in fig.2.

    A load cell is a transducer that measures force, and outputs this force as an electrical signal.[2] The load cells are used since it provides the accurate weight. Strain gauge is used in most of the load cells for the accurate measurement. In this project it is used to measure the weight of the cylinder. The accuracy rate is less than 0.1% of the full scale. The load cell requires high resolution ADC converter board to convert the electrical signals to digital output , So the HX711 board is interfaced between load cell and esp8266. The HX711 module has 6 input pins and 4 output pins they are Ground, Vcc, SCK, DT and among 6 input pins we use 4 pins they are E+, E-, O+, O-.

    Fig.2 NodeMCU

    MQ2 gas sensor is a module used on the micro-controller to detect gas in the air. There are several types of gas and gas sensors that can be identied by the module also vary. MQ2 gas sensor can detect Methane, Butane, LPG, Smoke, Carbon Monoxide etc. The way the gas sensor works is by using an electronic circuit that is sensitive to the gas content in the air, thus greater the gas concentration in the air, the higher is the output voltage, while lesser gas concentration results in low output voltage.

    A servo motor is used as a gas valve, when there is gas leakage the servo motor rotates 90 degree which means the gas valve is turned off and when there is no gas leakage the servo motor comes back to initial position. Buzzer acts as an alerting device when there is gas leakage.


    The Arduino IDE is used in this project to write the program, in arduino programming we have two parts that is void setup and void loop. The IDE also provides serial monitor to see our output. The sensor data is collected by the microcontroller and through esp8266 wifi model this data is sent to the Firebase cloud server, to do this action we should connected ur board to wifi by using wifi_ssid and wifi_password and then firebase host URL and AUTH key are used to make connection between our board and firebase, and then our data will be stored in the firebase database. The link of firebase database will be given to the mobile app which is built using Mitapp inventor and then the data will be displayed in the app. Fig. 4.3 shows the firebase console and fig. 4.4 shows the blocks part in Mit App Inventor.

    1. The Arduino IDE is a cross-platform application (for Windows, macOS, Linux) that is written in the programming language Java, C, C++. It is used to write and upload programs to Arduino compatible boards, but also, with the help of 3rd party cores, other vendor development boards. It also supports the languages C and C++ using special rules of code structuring.

      The Arduino IDE contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions and a series of menus. Programs written using Arduino Software are called sketches.

      The Arduino IDE supplies a software library from the wiring project, which provides many common input and output procedures. User-written code only requires two basic functions, for starting the sketch and the main program loop, that are compiled and linked with a program stub main() into an executable cyclic executive program with the GNU toolchain, also included with the IDE distribution.

    2. Firebase is a mobile and web app development platform that provides developers with a plethora of tools and services to help them develop high quality apps. The Firebase Realtime Database is a cloud-hosted NoSQL database that lets to store and sync between users in realtime. The Realtime Database is really just one big JSON(JavaScript Object Notation) object that the developers can manage in realtime. With just a single API, the Firebase database provides our app with both the current value of the data and any updates to that data.

      Fig.3 Firebase Console

    3. Mit app inventor is an intuitive, visual programming environment that allows everyone to build fully functional apps for smartphones and tablets. The MIT App Inventor is divided into two parts,Designer and Blocks The designer part consists of all the components for the app UI. Where we can add buttons, textboxes, Sliders etc. The blocks part is where we drag and drop the blocks rather than to write a code for our designed components.

    Fig.4 Mit app inventor blocks console.


    Step2: Measure the weight of gas.

    Step3: If the weight of gas is less than 0.5kg then buzzer is turned on and also notified in the app.

    Step4: Else the weight of gas is updated to the user through app continuously.

    Step5: Check for the leakage of gas.

    Step6: If there is leakage of gas then the gas valve is turned off automatically, buzzer is turned on and also notified to the user.

    Step7: End.


    When there is gas leakage it is detected and the gas valve is turned off automatically and an alert is given to the user and also the buzzer is turned on. When the gas level in the cylinder goes down below the threshold level ie 5% then an alert is given to the user and also the buzzer is turned on. The gas valve of the cylinder can be turned on and off using the mobile app. The mobile app screenshots are shown in fig 5 and 6.

    Fig.5 Mobile app showing gas leakage alert.

    Fig.6 Mobile app showing gas low alert.


    In this project, the idea proposed would be another step towards home automation. This system would considerably reduce human intervention in the booking or monitoring of the LPG cylinder and hence will save much time or the hastiness in booking the LPG cylinder. Additionally, it will also ensure human safety by preventing accidents due to gas leakage by turning off the gas valve when there is gas leakage. With appropriate configuration this system can also be scaled for its use in industries where heavy pipelines and cylinders are used. The proposed system when successfully implemented can also be used in mines where gas sensors will detect leakage of toxic gases and can send a signal for the emergency evacuation of workers.


  1. Metta Santiputri, Muhammad tio IOT based Gas leak detection device IEEE 2018.

  2. Shruthi Unnikrishnan,1 Mohammed Razil, Joshua Benny, Shelvin Varghese and C.V. Hari LPG Monitoring and Leakage Detection System IEEE WiSPNET 2017 conference.

  3. R.Naresh Naik 1, P.Siva Nagendra Reddy 2,S.Nanda Kishore3, K.Tharun Kumar Reddy4 Arduino Based LPG gas Monitoring & Automatic Cylinder booking with Alert System IOSR Journal of Electronics and Communication Engineering (IOSR-JECE) e-ISSN: 2278-2834,p- ISSN: 2278-8735.Volume 11, Issue 4, Ver. I (Jul.-Aug

    .2016), PP 06-12

  4. [4] Tamizharasan.V,Sandeep.R, Ravichandran.T, Saravanavel.K , Sowndariya.M GAS LEVEL DETECTION AND AUTOMATIC BOOKING USING IOT 5th International Conference on Advanced Computing & Communication Systems (ICACCS) .

Leave a Reply

Your email address will not be published. Required fields are marked *