Tuesday, 11 November 2014

Protect your home with Arduino based LPG leakage detection module

MQ-6 LPG gas sensor project


          Hi, guys. It is been quite a long time I have not blogged. The Tecnoesis fever in National Institute of Technology, Silchar had been very high for these few weeks and I too can't separate myself from it. I too took part in it. There is an exhibition called "Evolution" which has been conducted for last three years in our college and this year I was able to take part in it. I, in a way represented the robotics club of our college in the exhibition and two of my projects were submitted in it. Thanks to Mr. Saurav Sen, the organiser of the exhibition, it was a grand success, with lot of enthusiastic participants and viewer. Even Doordarshan visited the college to cover up our technical festival and in a way the exhibition also came under focus. You might be wondering what exactly was this exhibition all about. Well, this exhibition " Evolution" is a platform to show cast the talent of the students in the field of product development, software designing and display of some of technical development in the world of science and innovation
          Well what I m gonna tell you here is that one of the display of my project in the event was the LPG gas leakage checking system. LPG leakage is a major concern in metropolis, especially the high rise buildings where the fire breaking can cause damage to property and also causes risks to life, as might have happened in many places. With this small product you can basically protect the house. This small stuff is called the LPG gas leakage alarm system and unlike most of the smoke detector based alarm system which is triggered by the advent of smoke due to some fire, this particular gas detector will help you before even there is a chance of catching the fire. Just because this small prototype I have designed can actually detect the rise of concentration of LPG in surrounding atmosphere. This particular gas sensor so called MQ-6 gas sensor which is just one of the gas sensor in the MQ series, is meant to detect propane and iso-butane, which are the chief constituents of the LPG gas cylinders. So the internally the MQ-6 is like it has a variable resistance inside it which becomes low in case we get to a high concentration of the aforesaid two gases. So the chang in the current can be used as a signal to trigger the alarm. But instead what I have done is used a microcontroller board, my favourite, Arduino duemilanove, to interface the MQ-6 gas sensor with arduino and a buzzer. So whenever I get a high concentration of LPG I get an alarm triggered till the concentration is not low.
         So what exactly you have to do is buy one MQ-6 gas sensor, and if possible the product comes embedded on a PCB which is easier to use. As you can see in the video the gas sensor I m using is already calibrated, all you got to do is use its four pins, AOUT, GND, VCC and DOUT to the required pins on board.  AOUT goes into some analog pin, Dout goes to the ground via a 10 k resistor. VCC as usual 5 V and GND to the ground. 
                                 
                                                                                                                
             But in case you don't have the board, you guys don't have to worry since the even with the sensor you guys can make a way out for it. Below is the picture of the gas sensor and the pin diagram.                    

         All you have to do is connect all the two A pins and two B pins and then, one ground pin is connected to ground, the A pins along with the VCC pin to the 5 volts and the H pin to ground via a 10 K resistor and one pin left to the analog pin on the arduino board. Now all that is left is to write the program in Arduino IDE. So here I share my first code on a project that can be practically implemented

        Below I have attached the videos. You can check them out too. 


int sensorInput;                         
int buzz = 8;

void setup()
{
  Serial.begin (9600);
  pinMode (buzz, OUTPUT);
}

void loop()
{
  noTone (buzz);                        
  sensorInput = analogRead (A0);            // reading the analog data from the sensor
  
  if (sensorInput >= 200)                   // If the data is above 200, it triggers the alarm
  {
    tone (buzz, 1000);
    delay (500);
    tone (buzz, 3000);
  }
  else
  {                                               // Else no alarm
      noTone(buzz); 
  }
 
  Serial.println (sensorInput);
  Serial.print ("  ");