Pressure measurement algorithm of LPG leakage using MQ6 sensor and GSM SIM900 for smart home

Liquid Petroleum Gas (LPG) has a drawback in its use that it is very prone to cause fires because it is a hydrocarbon in the form of propane and butane. LPG storage must also use a strong cylinder and has no leakage. If the gas storage cylinder leaks, it will easily cause fire and explode when it is used. LPG must meet several particular criteria in terms of safety, so it does not damage the equipment used and can be efficient in its use. A gas leak detection system is required to reduce the risk of material and life loss due to gas cylinder leaks, which can later be used as a safety system or warning of gas leaks. The users can quickly response to gas leaks around them. The warning given can be a short message or an alarm as a reminder to the users. The purpose of this research is, first, to create an LPG gas leak pressure measurement algorithm using the MQ6 sensor and GSM SIM 900A for a Smart home. The second is to design an Arduino-based gas leak notification through an SMS Gateway. The method used in this study is experimental. This is a method that is generally used in laboratory research. The second is the prototype method, in which the device changes are carried out many times until the goal of the device to be developed is achieved. The research results are the first to produce an algorithm for measuring LPG gas leakage pressure using the MQ6 sensor, which can be installed in Smart home, testing this algorithm using a board on the Arduino microcontroller, which is connected directly to the MQ6 sensor as an input medium. After the algorithm is embedded to measure the gas leak pressure on the MQ6 sensor, it works as a sensor that only detects LPG, propane, butane and its types explicitly. In the results of trials that have been carried out by going through 4 stages of testing this detector, it will be more optimal to detect gas leaks at a distance of 5 cm. The second is to generate Arduino-based gas leak notification information using an SMS Gateway. This tool is also equipped with a GSM SIM 900A module that functions as an SMS gateway so that if a gas leak occurs, the GSM SIM 900A can be a communicator among the user's mobile devices to provide information via SMS. The better the quality of the available network, the faster the notification will be sent.


Introduction
The Indonesian people are one of the world's communities that are highly dependent on fuel oil. It is used for household, transportation or industrial purposes. According to Widyanto and Deni Erlansyah, since the government implemented the conversion from kerosene to gas in 2005, people who used to utilize kerosene have started to use gas. Still, in its implementation, there have been many issues. Starting from the leaking gas cylinders cases, the recent fires and accidents caused by the explosion of leaking gas are daunting to the gas users [1].
Regulation of the President of the Republic of Indonesia Number 104 of 2007 concerning the supply, distribution, and pricing of 3 (three) kilograms LPG cylinders and Regulation of the Minister of Energy and Mineral Resources No. 21 of 2007 concerning the provision and distribution of 3 Kg LPG cylinders, became the legal basis for the government's policy on the conversion of kerosene to LPG. One of these conversion policies was triggered by several series of kerosene scarcity in various regions, both in big cities and rural areas. The policy regarding this conversion is appropriate. This is because the gas reserves in Indonesia are far more than oil, although most of them have been concessioner to foreign parties.
Liquid Petroleum Gas (LPG) has a drawback in its use that it is very prone to cause fires because it is a hydrocarbon in the form of propane and butane. LPG storage must also use a strong cylinder and has no leakage. If the gas storage cylinder leaks, it will easily cause fire and explode when it is used. According to the Forensic Laboratory Center (Puslabfor) (2010), the National Police Headquarters stated that the case of explosions caused by 3 kg LPG gas in various regions in Indonesia was purely due to human error. Ito Sumardi explained that apart from the human error factor, there were also reports that the gas cylinder leak had corroded. Another cause is an attempt to make copying that causes damage to accessories such as pipes and regulators on the gas cylinder.
One of the risks generated by LPG is an explosion and fire if there is a leakage in the gas installation or LPG cylinder packaging. Based on data from the Center for Public Policy Studies (Puskepi), from 2008 to 2010 in

Research Article
Open Access (CC-BY-SA)

Abstract
Liquid Petroleum Gas (LPG) has a drawback in its use that it is very prone to cause fires because it is a hydrocarbon in the form of propane and butane. LPG storage must also use a strong cylinder and has no leakage. If the gas storage cylinder leaks, it will easily cause fire and explode when it is used. LPG must meet several particular criteria in terms of safety, so it does not damage the equipment used and can be efficient in its use. A gas leak detection system is required to reduce the risk of material and life loss due to gas cylinder leaks, which can later be used as a safety system or warning of gas leaks. The users can quickly response to gas leaks around them. The warning given can be a short message or an alarm as a reminder to the users. The purpose of this research is, first, to create an LPG gas leak pressure measurement algorithm using the MQ6 sensor and GSM SIM 900A for a Smart home. The second is to design an Arduino-based gas leak notification through an SMS Gateway. The method used in this study is experimental. This is a method that is generally used in laboratory research. The second is the prototype method, in which the device changes are carried out many times until the goal of the device to be developed is achieved. The research results are the first to produce an algorithm for measuring LPG gas leakage pressure using the MQ6 sensor, which can be installed in Smart home, testing this algorithm using a board on the Arduino microcontroller, which is connected directly to the MQ6 sensor as an input medium. After the algorithm is embedded to measure the gas leak pressure on the MQ6 sensor, it works as a sensor that only detects LPG, propane, butane and its types explicitly. In the results of trials that have been carried out by going through 4 stages of testing this detector, it will be more optimal to detect gas leaks at a distance of 5 cm. The second is to generate Arduino-based gas leak notification information using an SMS Gateway. This tool is also equipped with a GSM SIM 900A module that functions as an SMS gateway so that if a gas leak occurs, the GSM SIM 900A can be a communicator among the user's mobile devices to provide information via SMS. The better the quality of the available network, the faster the notification will be sent.
Indonesia, there were 189 cases of explosions in the use of household gas cylinders. In 2008, there were 61 cases; in 2009, it fell to 50 cases, then it increased in 2010 as many as 78 explosion cases. There are always cases of explosions every year, and in 2014 there was an explosion of gas cylinders which claimed 12 severe burns.
To reduce the risk of material loss and loss of life due to gas cylinder leaks, a gas leak detection system is needed, which can be used as a safety system or warning against gas leaks with the expectation that users can respond quickly to the gas leakage around them. By the implementation of this algorithm on the gas cylinder leak detector, then will provide notification by text message. So, when the gas is detected, the system will be processed to send early warning information through a notification via text message to the landlord informs that a gas leakage has been detected. So, the landlord will immediately provide countermeasures as actions to prevent fires.

Method
The type of research used is experimental research, which is a study with at least one variable found to be manipulated to study cause-and-effect relationships. Therefore, experimental research is closely related to testing a hypothesis to find the effect, relationship, or difference in changes in the group subjected to treatment. The process of the research flow carried out is as shown in Figure 1.

Figure 1. Research Flow Process
This system will notify users via text message and use the MQ6 sensor as a gas leak detector and also use Arduino Mega as the center of the system by programming the microcontroller as a work order. The following is the algorithm for measuring gas leak pressure.
LPG gas leakage pressure measurement algorithm. #include <softwareserial.h> // added GSM Sensor serial communication library #include <liquidcrystal_I2C.h> // add a library to enable scripts for lcd Softwareserial myserial(9, 10); // declare pins 9 and 10 for GSM serial communication char msg; // declare variable msg with data type char char call; // declare a variable call with data type char LiquidCrystal_I2C lcd(0x3F ,2,1,0,4,5,6,7,3, POSITIVE); // activate the lcd address and pin used const int sensorValue = 0; // declare a value for sensor value with 0, with data type const int int piezopin = 13; // declare piezopine on pin 13 int ppmgas; // declare variable ppm gas int gaspercent; // declare a variable gas percent int gas=analogread(sensorvalue); // declare gas as analog data reading from sensor value int a = 1; // declares the value of a as 1, the value of a is used when reading sensor data mq5 void setup() { myserial.begin(9600); // setting the baud rate of gsm module with 9600 serial.begin(9600); // setting baudrate of serial data with 9600 lcd.begin (16,2); // start lcd command lcd.setcursor(0,0); // setting the position of the text to be displayed on the lcd lcd.print("Detection system"); // display detection system writing on lcd lcd.setcursor(0,2); // setting the position of the text to be displayed on the lcd lcd.print("Gas leaking"); // display detection system writing on lcd delay (2000) lcd.setCursor(0,0); // setting the position of the text to be displayed on the lcd lcd.print("Gas Level:"); // display gas level writing on lcd lcd.setCursor(0,2); // setting the position of the text to be displayed on the lcd lcd.print(String(GasPercent)+("% ")+String(ppmGas)+("ppm")+(" ")); // display text on lcd GasPercent = map(analogRead(sensorValue),0,1023,0,100); // mapping program for analog data is converted to percent, i.e. values from 0 to 1023 are mapped to 0-100 : ppmGas = map(analogRead(sensorValue),0,1023,0,1000); // mapping program for analog data is converted to percent, i.e. values from 0 to 1023 are mapped to 0-100 : if(ppmGas > 200 && a < 2){ // to indicate if the gas is leaking then the gas ppm value will be above 200, where the value above 200 must pass 2 readings to be able to send messages SendMessage(); // perform an order to send a message a = a + 1; // calculation algorithm to be able to send messages } if(ppmGas > 200){ // if the value of ppm is above the value of 200 then lcd.setCursor(0,0); // setting the position of the text to be displayed on the lcd lcd.print("Danger!! "); // display danger writing on lcd tone(piezoPin, 2000, 800); }else{ // if not a = 1; // the value of a returns to 1 } Serial.println(ppmGas); // displaying the ppm value of the serial gas monitor delay(1000); } void SendMessage() // displaying the ppm value of the serial gas monitor { Serial.println("send"); mySerial.println("AT+CMGF=1"); // set the modem as sms text mode delay(1000); // Delay of 1000 milli seconds or 1 second mySerial.println("AT+CMGS=\"+6285343804326\"\r"); // setting sms text mode by sending to a phone number delay(1000); mySerial.println("Danger Warning!!! There has been a gas leak in your home.");// send text message delay(100); mySerial.println((char)26);// send ascii data to mark end of text delay(1000); } The gas pressure measurement algorithm is carried out by testing the MQ6 sensor against the point of leakage to get a very good system response speed in providing early warning of gas leaks that occur. This test was carried out 4 times with various distances. Then the test results are recorded in the test table, starting from the test distance to the amount of LPG leaking in ppm units. These tests were conducted in 4 conditions; by measuring the distance between the gas source that comes out and the placement of the detector, as shown in the Table 1. The working mechanism of this tool is that when the sensor detects the smell of gas leakage, the Arduino will process the buzzer and the GSM SIM 900A module to send a warning message to the landlord. All these tools are connected to the Arduino to get data on the gas level contained in the room. Then, Arduino will provide information to the landlord via the GSM SIM 900A module in the form of an SMS warning. The hardware circuit, as shown in Figure 2 is the MQ6 sensor which functions to detect LPG gas. Furthermore, after the MQ6 sensor detects gas leakage, the character of LCD displays alphanumeric characters with 16 columns and 2 lines of characters directly. Also, GSM SIM 900A Module as a medium for sending SMS notifications to a predetermined mobile phone number will send a warning message.

B. Software Design
After the hardware circuit process is complete, the next step is to create a software design, including writing a program listing that will be stored or installed in the microcontroller using an Arduino software, where the program commands will be executed by the hardware or system created with arduino uno software.
In designing this software, an Arduino program will be used to write program listings and save them with a file with the extension pde. Then, the Arduino Uno bootloader is used as the medium to upload the program into the microcontroller to work as instructed.

C. Hardware Testing
Hardware testing is done by checking and measuring the circuit path and testing its supporting components as a whole, such as the power supply, Arduino port. This test is carried out to determine the existing equipment on the hardware created (the quality condition of the tool and its performance).

D. Whole System Testing
Overall system testing is carried out to find out whether the leak monitoring system that has been made has worked well or not.

Results and Discussion
The author designs a prototype, which is a security system that can be applied to homes. A home security system is necessary for many people. A design of an Arduino-based LPG Gas leak detector using SMS notifications can provide a sense of safety. In the design of this tool, it will be placed in the kitchen section of the house. The design is also equipped with components such as an MQ6 sensor, Arduino Uno, 16x2 LCD, Buzzer and GSM SIM 900A module, which are assembled into one. The materials used in the design of the framework are plastic fiber. The Arduino-based LPG gas leak detection device with SMS is in accordance with Figure 3 This is a security system tool that can detect gas leakage if it occurs either in the pipe or on the regulator in the LPG gas cylinder. The sensor used in this detector is the MQ6 sensor which specifically detects LPG gas. If this sensor detects a gas leak in the LPG, the Arduino as a microcontroller will continue on the GSM SIM 900A module to provide a warning in the form of a direct SMS to the landlord stating that a gas leak has been detected and through the sound in the buzzer of this tool.

A. MQ6 sensor testing
The MQ-6 sensor testing in Figure 4 aims to determine the sensor's ability to detect the presence of gas concentrations around. The MQ6 sensor is perfect for detecting LPG, iso-butane, propane, & LNG. It can avoid disruption from alcohol, cooking smoke and cigarette smoke. Based on the results of tests that have been carried out on the MQ6 sensor, it can be concluded that the MQ6 sensor can be used to detect gas leakage. The gas leakage is measured from a miniature of an increase in gas with a value from the previous 15% with levels of 153 ppm to 33% with levels of 335 ppm.

B. The testing of SIM 900A
The testing of GSM SIM 900A for Arduino can be used to send/receive text messages and make/receive calls like a regular cell phone using a SIM card from a cellular network provider. It is carried out by connecting the GSM module to the Arduino board and inserting the SIM card from the operator that provides GPRS coverage, as shown in Figure 5. The purpose of this test is to determine whether the microcontroller can send SMS to registered numbers or not. Based on the results of the GSM SIM 900A test in Figure 6, it can be concluded that the GSM SIM 900A can send an SMS to the landlord in the form of a danger warning when a gas leakage occurs.

C. Overall Test
Overall product testing is carried out to determine whether all components have appropriately worked in accordance with the respective programs given. Figure 7 below is a display of when researchers conduct trials on the tools they have created. This overall testing of the tool is carried out by simulating using the prototype that has been made. Tests are carried out based on actual conditions. These tests were conducted in 4 conditions, by measuring the distance between the gas source that comes out and the placement of the detector.  The test has been carried out with a distance of 5 cm from the gas source and was detected with a level of 268ppm. With a limit of 200, the landlord will receive a warning notification in the form of a text message, as shown in Figure 9. The test has been conducted with a distance of 10 cm from the gas source and detected at 232ppm levels. With a limit of 200, then the landlord will receive a warning notification in the form of text message, as shown in Figures 10 and Figure 11. The test has been conducted at a distance of 15 cm from the gas source and detected at 174ppm as shown in Figure 12. Test has been carried out at a distance of 20 cm from the gas source and detected with levels of 172 ppm as shown in Figure 13.