AIM: a. To interface MQ-2 Gas sensor to Arduino board
APPARATUS: 1. Arduino Uno Board – 1 No.
2. LED - 1No.
3. Resistor-100 Ohm -1 No.
4. Bread Board – 1 No.
5. Connecting Wires
6. USB Cable.
7. MQ-2 Gas Sensor -1No.
THEORY:
The MQ series of gas sensors use a small heater inside with an electro-chemical sensor. They are sensitive for a range of gasses and are used indoors at room temperature. The output is an analog signal and can be read with an analog input of the Arduino.
The MQ-2 Gas Sensor module is useful for gas leakage detecting in home and industry. It can detect LPG, i-butane, propane, methane ,alcohol, hydrogen and smoke.
Some modules have a built-in variable resistor to adjust the sensitivity of the sensor.
Note: The sensor becomes very hot after a while, don't touch it!
In this tutorial we will use the serial monitor of Codebender (or Arduino IDE) to see how the sensor acts in variable gasses.
The connections are pretty easy:
• Vcc to Arduino 5V pin
• GNG to Arduino GND pin
• Output to Arduino Analog A0 pin
Note: The sensor becomes very hot after a while, don't touch it!
So, let's get started!
PROGRAM:
const int gasPin = A0; //GAS sensor output pin to Arduino analog A0 pin
void setup()
{
Serial.begin(9600); //Initialize serial port - 9600 bps
}
void loop()
{
Serial.println(analogRead(gasPin));
delay(1000); // Print value every 1 sec.
}