Make A LPG Leakage Detection System For Your Home


The new IoT board LinkIt ONE co-designed by Mediatek and Seed Studios is an open-source, high-performance board for prototyping Wearables and IoT devices. It is a small board based on SoC that comes with onboard Wi-Fi, GSM, and GPRS that makes it a powerful board for connected devices. The pin layout of the board is exactly similar to Arduino, making the development easy with many Arduino compatible shields and sensors. It comes at an affordable price of $ 59, you can get it from here.
For setting up the development environment and getting familiar with LinkIt one, I highly recommend you to go through the previous articles of the series.
In India, many accidents happen every year due to domestic gas leakage. LPG is a need of every household but it should be used carefully. Let us create a Gas Leakage detection system with LinkIt One and MQ5 Sensor. This system will help you to upgrade your safety standards and prevent accidents by detecting any gas leakage in your home. We will place a buzzer in the circuit if the system detects any gas leakage it will alert us by playing the buzzer or even you can go one step further by adding mobile notifications on detection. LinkIt One has onboard GSM which will help us in sending SMS too, that we will see in upcoming parts.
Figure 1: Equipment
  • LinkIt One board
  • Grove MQ5 sensor
  • Buzzer
  • Jumper cables
  • USB cable
The sensor I am using in this article is the MQ5 sensor from Seeed Studios. It has a Grove interfacing which means you need not to do breadboarding or any soldering as it is a complete module.
Grove MQ5 Sensor
The Grove Gas Sensor (MQ5) module is useful for gas leakage detection in homes and industries. This sensor is suitable for detecting a wide range of gases including H2, LPG, CH4, CO, Alcohol. It provides high sensitivity and fast response time and has a potentiometer to adjust the sensitivity. The output voltage from the Gas sensor increases when the concentration of gas increases.
Gas Sensor Board
Figure 2: Gas Sensor 
Gas Sensor
Figure 3: Gas Sensor Board
Features of Grove MQ5 Sensor
  • High sensitivity to LPG, natural gas, town gas
  • Small sensitivity to alcohol, smoke.
  • Fast response
  • Stable and long life
  • Simple drive circuit
  1. Connect LinkIt One to your computer using a USB A to micro B cable.
  2. Connect the MQ5 sensor into the A0 port of Grove Base Shield.
  3. In the Arduino IDE, go to the Tools pull-down menu at the top, select Board, and make sure “LinkIt One” is checked.
  4. Then pull down the Tools menu again, and select appropriate Serial Port.
  5. Connect the Buzzer to the D2 port of Grove Base Shield.
If you have multiple serial ports to choose from and aren’t sure which to choose, try unplugging the board from your computer and plugging the board back again to see which port gets added.
  1. int buzzer = 2;  
  2. int sensor = A0;  
  3. // The setup routine runs once when you press reset  
  4. void setup()  
  5. {  
  6.     pinMode(buzzer, OUTPUT); // Initialize the digital pin2 as buzzer output  
  7.     Serial.begin(9600); // Initialize serial communication at 9600 bits per second  
  8. }  
  9. // The loop routine runs over and over again forever  
  10. void loop()  
  11. {  
  12.     var sensorValue = analogRead(sensor); // Read the input on analog pin 0 ('sensor')  
  13.     Serial.println(sensorValue); // Print out the value on serial monitor  
  14.     if (sensorValue > 200)  
  15.     {  
  16.         // If sensorValue is greater than 200  
  17.         digitalWrite(buzzer, HIGH);  
  18.     }  
  19.     else  
  20.     {  
  21.         digitalWrite(buzzer, LOW);  
  22.     }  
  23. }  
Running the system
Running the system
Figure 4: Running the system
Click the Upload button on the tool bar. It may take a moment to compile and upload it to the board.
When it’s done, you’ll see the text “Done uploading” at the bottom.
Now with this system you will be able to detect any gas leakage in your home. Be careful while testing this system. You can place this system in a box with the sensor outside and near to the LPG source by using a longer jumper wire and install it in your Kitchen. Because of its low power consumption, this system can be used in other applications like smoke detection and various toxic gases by doing some modifications.
The best preheat time for the sensor is above 24 hours.