Gas Detecting System with LCD Display & Buzzer  
                                 Using Arduino

Group Members:
Faisa Majeed        402650
Sultan javaid         402914
Imtinan Ahmad      402788

Submitted To:
        Rana Murawat Hussain





Introduction:
In this Project we will use a gas sensor to detect harmful and dangerous gasses like LPG, Butane etc. In this project we will use MQ2 gas sensor to detect smoke and gasses. Whenever sensor detect gas or smoke it will turn on red led as warning and start alarming and show a evacuate message on display screen. For this project we need following things:
v  MQ2 Gas Sensor
v  Resistor and LED
v  Arduino
v  Breadboard
v  Piezo
v  LCD
Background:
Gas spill identifiers use sensors to distinguish possibly hazardous substances that you can't see or smell. Today, there are a large number of sensor innovations accessible for business utilize that can undoubtedly and rapidly distinguish hurtful gases noticeable all around, however this wasn't generally the situation. The historical backdrop of gas spill discovery is loaded with intriguing tales about the various ways individuals used to find whether a region was loaded up with poisonous gas or different substances. 

Prior to Grove - MQ2 gas sensor, Grove - Multichannel Gas Sensor V2 was utilized to distinguish gasses. Forest - Multichannel Gas Sensor V2 has 4 estimating units, every one of them is delicate to different sorts of gases, which implies you can get four arrangements of information simultaneously. What's more, various kinds of gases can likewise be decided by these four arrangements of information. The gas sensor utilized in this module depends on MEMS innovation and has the upside of being in a little size with impressive estimation dependability and is more reasonable for subjective than quantitative estimation.
Features:
·         Four fully independent sensor elements on one package.
·         The ability to detect a variety of gases, besides Carbon monoxide (CO), Nitrogen dioxide (NO2), Ethyl alcohol(C2H5CH), Volatile Organic Compounds (VOC) and etc.
·         Qualitative detecting, rather than quantitative.
·         Compact size for easy deployment.
But in this project I am using Grove - MQ2 gas sensor, which is an electronic sensor used for sensing the concentration of gases in the air such as LPG, propane, methane, hydrogen, alcohol, smoke and carbon monoxide. MQ2 gas sensor is also known as chemiresistor. It contains a sensing material whose resistance changes when it comes in contact with the gas. This change in the value of resistance is used for the detection of gas. MQ2 is a metal oxide semiconductor type gas sensor. Concentrations of gas in the gas is measured using a voltage divider network present in the sensor. This sensor works on 5V DC voltage. It can detect gases in the concentration of range 200 to 10000ppm.Module version of this sensor can be used without interfacing to any microcontroller and is useful when detecting only one particular gas. This can only detect the gas. But if ppm has to be calculated then the sensor should be used without module. This sensor is also used for Air quality monitoring, Gas leak alarm and for maintaining environmental standards in hospitals. In industries, these are used to detect the leakage of harmful gases. Some of the alternatives of the MQ2 gas sensor are MQ-6, M-306A, AQ-3 sensors.
Methodology: 

Peepgrams.com
LiquidCrystal Library:
This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. The library works with in either 4- or 8-bit mode

We connect positive pin of the buzzer with pin4 of the Arduino and the negative pin is grounded. Anode of the red led connected with pin2 of the Arduino and green led with pin3. When machine is in working state it will show a green signal as a safety sign. And shows as a safety message on the LCD display. Which are connected with Arduino as four bit communication.D4, D5, D6, D7 pins of the LCD which are connected with pins 8, 9, 10, 11 of the Arduino.
LCD fist pin (VSS) which is connected as ground, and second pin of the LCD (VDD) is using for 5v current. Last two pin of LCD are Backlight Anode and Backlight Cathode. And pin D0 to D3 are not use in this circuit. So when a sensor detect gas it will send signal to the Arduino which turn of the green led and red led will turn on and send a signal to LCD which display the evacuation message on LCD display. And Piezo start buzzing to warn as about the dangerous situation.
peepgrams.com

Link:

Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(5,6,8,9,10,11);
 
int redled = 2;
int greenled = 3;
int buzzer = 4;
int sensor = A0;
int sensorThresh = 400;

void setup()
{
pinMode(redled, OUTPUT);
pinMode(greenled,OUTPUT);
pinMode(buzzer,OUTPUT);
pinMode(sensor,INPUT);
Serial.begin(9600);
lcd.begin(16,2);
}

void loop()
{
  int analogValue = analogRead(sensor);
  Serial.print(analogValue);
  if(analogValue>sensorThresh)
  {
    digitalWrite(redled,HIGH);
    digitalWrite(greenled,LOW);
    tone(buzzer,1000,10000);
    lcd.clear();
    lcd.setCursor(0,1);
    lcd.print("ALERT");
    delay(1000);
    lcd.clear();
    lcd.setCursor(0,1);
    lcd.print("EVACUATE");
    delay(1000);
  }
  else
  {
    digitalWrite(greenled,HIGH);
    digitalWrite(redled,LOW);
    noTone(buzzer);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("SAFE");
    delay(1000);
    lcd.clear();
    lcd.setCursor(0,1);
    lcd.print("ALL CLEAR");
    delay(1000);
  }    
}

Post a Comment

Previous Post Next Post