MQ-4 sensor is a gas detecting sensor. This sensor is mainly
use to detect Methane, and CNG Gas. This sensor also sensing other flammable gases like Butane and
propane. Good sensitivity to Combustible gas in wide range. High sensitivity to
Natural gas / CNG. Low sensitivity to smoke, flame. Long life and low cost.
Simple drive circuit.
There are different MQ series sensor which is used for
detecting different gases.
List of different MQ
series sensor are given below.
MQ-2 Methane,
Butane, LPG, Smoke.
MQ-3 Alcohol,
Ethanol, Smoke
MQ-4 Methane, CNG
Gas
MQ-5 Natural gas,
LPG
MQ-6 LPG, butane
MQ-7 Carbon
Monoxide
MQ-8 Hydrogen Gas
MQ-9 Carbon
Monoxide, flammable gasses
MQ131 Ozone
MQ135 Air Quality
MQ136 Hydrogen Sulphide gas
MQ137 Ammonia
MQ138 Benzene,
Toluene, Alcohol, Propane, Formaldehyde gas, Hydrogen
MQ214 Methane,
Natural Gas
MQ216 Natural
gas, Coal Gas
MQ303A Alcohol,
Ethanol, smoke
MQ306A LPG, butane
MQ307A Carbon Monoxide
MQ309A Carbon
Monoxide, flammable gas
The connections of
MQ4 Gas Sensor Module.
VCC to 5V DC
GND to GND
AO to AnalogO
DO to DigitalO
MQ-4 Sesnsor with simple electronic circuit:
Components :
1: MQ- 4 Gas Sensor.
2: LED
3: Buzzer
4: Resistors 1.5 Ohm,
270 Ohm.
5: Bread board
6: Some jumper wires.
7: DC Power source 5v.
Circuit:
MQ-4 Sensor with Arduino:
Using with arduino is very simple I am sharing both circuit
and Code for arduino.
Code:
/* MQ-4 Methane Sensor Circuit with Arduino */
const int AOUTpin=1; //the AOUT pin of the MQ-4 sensor goes into analog pin A1 of the arduino.
const int DOUTpin=7; //the DOUT pin of the MQ-4 sensor goes into digital pin D7 of the arduino.
const int ledPin=13; //the anode of the LED connects to digital pin D13 of the arduino Same for buzzer.
int limit;
int value;
void setup() {
Serial.begin(115200); //sets the baud rate.
pinMode(DOUTpin, INPUT); //sets the pin as an input to the arduino.
pinMode(ledPin, OUTPUT); //sets the pin as an output of the arduino.
}
void loop()
{
value= analogRead(AOUTpin); //reads the analaog value from the MQ-4 sensor's AOUT pin.
limit= digitalRead(DOUTpin); //reads the digital value from the MQ-4 sensor's DOUT pin.
Serial.print("Butane value: ");
Serial.println(value); //prints the Butane value.
Serial.print("Limit: ");
Serial.print(limit); //prints the limit reached as either LOW or HIGH.
delay(100);
if (limit == HIGH){
digitalWrite(ledPin, LOW); //if limit has been reached,Both LED and Buzzer turns on as status indicator.
}
else{
digitalWrite(ledPin, HIGH); //if threshold not reached, LED remains off.
}
}
CIRCUIT:
Post a Comment