Shop/sensors/Mq2 Gas Sensor
SaleMq2 Gas Sensor
sensors1 in stock

Mq2 Gas Sensor

The MQ2 Gas Sensor is a versatile and widely used sensor for detecting flammable and combustible gases. It is capable of detecting gases like LPG, methane, propane, hydrogen, alcohol, smoke, and carbon monoxide, making it ideal for gas leakage detection systems and air quality monitoring.

GHS 45GHS 35

Description

The MQ2 Gas Sensor is a versatile and widely used sensor for detecting flammable and combustible gases. It is capable of detecting gases like LPG, methane, propane, hydrogen, alcohol, smoke, and carbon monoxide, making it ideal for gas leakage detection systems and air quality monitoring.

 


Key Features

  • Detects flammable and combustible gases.
  • Analog and digital output for easy interfacing.
  • Adjustable sensitivity via a built-in potentiometer.
  • Low cost and compact size.

Specifications

  • Operating Voltage: 3.3V–5V DC
  • Operating Current: ~150 mA
  • Detectable Gases: LPG, propane, methane, hydrogen, smoke, alcohol, and CO.
  • Output Types:
    • Analog Output (AO): Proportional to gas concentration.
    • Digital Output (DO): High/low signal based on the threshold set by the potentiometer.
  • Preheat Time: ~20 seconds for stable operation.
  • Sensitivity: Detects concentrations from 200 ppm to 10,000 ppm (parts per million).
  • Operating Temperature: -20°C to 50°C

Pinout

  1. VCC: Power supply (3.3V or 5V)
  2. GND: Ground
  3. DO: Digital output
  4. AO: Analog output

Working Principle

The MQ2 sensor uses a SnO₂ (tin dioxide) sensing layer. In clean air, the layer has low conductivity. When exposed to flammable gases, the conductivity increases, and this change is measured to determine the concentration of gas.


Interfacing with Arduino

Hardware Setup

  1. Connect VCC to the Arduino’s 5V pin.
  2. Connect GND to the Arduino’s GND pin.
  3. Connect AO (Analog Output) to an analog input pin (e.g., A0).
  4. (Optional) Connect DO (Digital Output) to a digital input pin for threshold-based detection.

Sample Code

const int analogPin = A0; // Analog output pin
const int digitalPin = 2; // Digital output pin
int analogValue = 0;

void setup() {
  Serial.begin(9600);
  pinMode(digitalPin, INPUT);
}

void loop() {
  // Read analog value
  analogValue = analogRead(analogPin);
  
  // Print analog value (gas concentration)
  Serial.print("Analog Value: ");
  Serial.println(analogValue);

  // Check digital output
  if (digitalRead(digitalPin) == HIGH) {
    Serial.println("Gas concentration exceeded threshold!");
  }
  
  delay(1000);
}

Calibrating the Sensor

  1. Allow the sensor to preheat for at least 24 hours before precise calibration.
  2. Adjust the potentiometer on the module to set the desired digital threshold.
  3. For analog output calibration, measure gas concentration in a controlled environment and create a mapping between the sensor’s output and known gas concentrations.

Applications

  • Gas leak detection in homes and industries.
  • Smoke detection systems.
  • Air quality monitoring.
  • Fire and safety alarms.
  • Smart IoT systems for environmental monitoring.