MQ-4

Mq-4 Sensor
Working Principle:
This is a simple-to-use comprssed natural gas sensor, suitable for sensing natural gas (composed of mostly Methane [CH4]) concentrations in the air. The MQ-4 can detect natural gas concentrations anywhere from 200 to 10000ppm.The principal use of methane is as a fuel. The combustion of methane is highly exothermic, meaning reactions create the release of a great deal of energy. The energy released by the combustion of methane, in the form of natural gas, is used directly to heat homes and commercial buildings. It is also used in the generation of electric power. During the past decade, natural gas accounted for about 1/5 of the total energy consumption worldwide
Arduino Interfacing

Pin Configuration:
Vcc: 5v
GND: GND
A0: Analog pin of arduino
D0: Digital pin of arduino
Code
const int AOUTpin=0;
const int DOUTpin=8;
const int ledPin=13;
int limit;
int value;
void setup() {
Serial.begin(115200);
pinMode(DOUTpin, INPUT);
pinMode(ledPin, OUTPUT);
}void loop()
{
value= analogRead(AOUTpin);
limit= digitalRead(DOUTpin);
Serial.print(“Methane value: “);
Serial.println(value);
Serial.print(“Limit: “);
Serial.print(limit);
delay(100);
if (limit == HIGH){
digitalWrite(ledPin, HIGH);
}
else{
digitalWrite(ledPin, LOW);
}
}
Advantages:
- High sensitivity
- High response
- longer sustain
- Highly capable
Application:
- Domestic gas leakage detector
- Industrial Combus
- tible gas detector
- Portable gas detector
Reference:
http://www.geekstips.com/mq4-sensor-natural-gas-methane-arduino/
http://www.learningaboutelectronics.com/Articles/MQ-4-methane-sensor-circuit-with-arduino.php
https://www.hackster.io/andrew85/mq-4-natural-gas-sensor-experiment-based-on-arduino-f17bec