Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use MQ-2 Gas Sensor Module: Examples, Pinouts, and Specs

Image of MQ-2 Gas Sensor Module
Cirkit Designer LogoDesign with MQ-2 Gas Sensor Module in Cirkit Designer

Introduction

The MQ-2 Gas Sensor Module, manufactured by Winsen or available as a generic component, is a versatile gas detection device designed to sense gases such as LPG, propane, methane, hydrogen, and smoke. It is widely used in safety systems, home automation, and industrial applications to detect gas leaks or monitor air quality. The sensor operates by measuring changes in resistance of its sensitive element when exposed to target gases, providing both analog and digital outputs for easy integration with microcontrollers.

Explore Projects Built with MQ-2 Gas Sensor Module

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Battery-Powered MQ-2 Gas Sensor with Alert Buzzer
Image of gas detect: A project utilizing MQ-2 Gas Sensor Module in a practical application
This is a simple gas detection alarm system that uses an MQ-2 sensor to detect gas presence and sound a buzzer when gas is detected. It is powered by a rechargeable 18650 battery, with a TP4056 module for battery management and charging. A rocker switch is used to control the power to the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Gas Detection Alarm with MQ2 Sensor and Buzzer
Image of smoke detection: A project utilizing MQ-2 Gas Sensor Module in a practical application
This circuit is a gas detection alarm system that uses an MQ2 gas sensor to detect gas levels. When gas is detected, the sensor outputs a signal that triggers a buzzer to sound an alarm. The circuit is powered by a 2 x AA battery mount.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wi-Fi Enabled Gas Detection System using ESP8266 and MQ2 Sensor
Image of SHP: A project utilizing MQ-2 Gas Sensor Module in a practical application
This circuit consists of an ESP8266 NodeMCU microcontroller connected to an MQ2 gas sensor. The ESP8266 provides power to the MQ2 sensor and reads the analog output from the sensor to monitor gas levels.
Cirkit Designer LogoOpen Project in Cirkit Designer
Multi-Gas Detection System with Arduino and MQ Sensors
Image of Centrala calitate aer: A project utilizing MQ-2 Gas Sensor Module in a practical application
This circuit is designed to monitor various gases using a series of MQ gas sensors (MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9, and MQ-135), each providing digital outputs to an Arduino UNO microcontroller. The Arduino is also connected to a piezo speaker for audible alerts and multiple LEDs with resistors, likely for visual status indicators. An Adafruit TCA9548A I2C multiplexer is included, suggesting the potential for I2C sensor expansion or managing multiple I2C devices.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MQ-2 Gas Sensor Module

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of gas detect: A project utilizing MQ-2 Gas Sensor Module in a practical application
Battery-Powered MQ-2 Gas Sensor with Alert Buzzer
This is a simple gas detection alarm system that uses an MQ-2 sensor to detect gas presence and sound a buzzer when gas is detected. It is powered by a rechargeable 18650 battery, with a TP4056 module for battery management and charging. A rocker switch is used to control the power to the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of smoke detection: A project utilizing MQ-2 Gas Sensor Module in a practical application
Battery-Powered Gas Detection Alarm with MQ2 Sensor and Buzzer
This circuit is a gas detection alarm system that uses an MQ2 gas sensor to detect gas levels. When gas is detected, the sensor outputs a signal that triggers a buzzer to sound an alarm. The circuit is powered by a 2 x AA battery mount.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SHP: A project utilizing MQ-2 Gas Sensor Module in a practical application
Wi-Fi Enabled Gas Detection System using ESP8266 and MQ2 Sensor
This circuit consists of an ESP8266 NodeMCU microcontroller connected to an MQ2 gas sensor. The ESP8266 provides power to the MQ2 sensor and reads the analog output from the sensor to monitor gas levels.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Centrala calitate aer: A project utilizing MQ-2 Gas Sensor Module in a practical application
Multi-Gas Detection System with Arduino and MQ Sensors
This circuit is designed to monitor various gases using a series of MQ gas sensors (MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9, and MQ-135), each providing digital outputs to an Arduino UNO microcontroller. The Arduino is also connected to a piezo speaker for audible alerts and multiple LEDs with resistors, likely for visual status indicators. An Adafruit TCA9548A I2C multiplexer is included, suggesting the potential for I2C sensor expansion or managing multiple I2C devices.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Gas leak detection systems (e.g., LPG, methane)
  • Smoke detection in fire alarm systems
  • Air quality monitoring
  • Industrial safety systems
  • Home automation projects

Technical Specifications

Key Specifications

Parameter Value
Operating Voltage 5V DC
Operating Current ~150 mA
Detection Range 200 ppm to 10,000 ppm
Preheat Time 20 seconds
Output Types Analog (AO) and Digital (DO)
Sensitivity Adjustable via onboard potentiometer
Dimensions ~32mm x 20mm x 22mm
Operating Temperature -20°C to 50°C
Manufacturer Part ID MQ-2

Pin Configuration

The MQ-2 Gas Sensor Module typically has four pins. The table below describes each pin:

Pin Name Description
VCC Power supply input (5V DC)
GND Ground connection
AO Analog output (proportional to gas concentration)
DO Digital output (HIGH/LOW based on threshold)

Usage Instructions

How to Use the MQ-2 Gas Sensor in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
  2. Connect Outputs:
    • Use the AO pin to read analog values corresponding to gas concentration.
    • Use the DO pin for digital HIGH/LOW output, which is triggered based on the threshold set by the onboard potentiometer.
  3. Preheat the Sensor: Allow the sensor to preheat for at least 20 seconds after powering it on to ensure accurate readings.
  4. Read Data:
    • For analog readings, connect the AO pin to an analog input pin of a microcontroller (e.g., Arduino).
    • For digital readings, connect the DO pin to a digital input pin of the microcontroller.

Important Considerations

  • Preheat Time: Always allow the sensor to preheat before taking measurements.
  • Ventilation: Ensure proper ventilation around the sensor for accurate gas detection.
  • Calibration: For precise applications, calibrate the sensor using known gas concentrations.
  • Power Supply: Use a stable 5V DC power source to avoid fluctuations in readings.
  • Avoid Contamination: Keep the sensor away from water, dust, and corrosive gases to maintain its sensitivity.

Example: Using MQ-2 with Arduino UNO

Below is an example of how to connect and use the MQ-2 Gas Sensor Module with an Arduino UNO to read analog values:

// MQ-2 Gas Sensor Example with Arduino UNO
// Connect AO to A0, DO to D2, VCC to 5V, and GND to GND

const int analogPin = A0;  // Analog pin connected to AO
const int digitalPin = 2;  // Digital pin connected to DO
int analogValue = 0;       // Variable to store analog reading
int digitalValue = 0;      // Variable to store digital reading

void setup() {
  Serial.begin(9600);      // Initialize serial communication
  pinMode(digitalPin, INPUT); // Set digital pin as input
}

void loop() {
  // Read analog value from AO pin
  analogValue = analogRead(analogPin);
  
  // Read digital value from DO pin
  digitalValue = digitalRead(digitalPin);
  
  // Print readings to Serial Monitor
  Serial.print("Analog Value: ");
  Serial.print(analogValue);
  Serial.print(" | Digital Value: ");
  Serial.println(digitalValue);
  
  delay(1000); // Wait 1 second before next reading
}

Notes:

  • The analog value (analogValue) represents the gas concentration, with higher values indicating higher concentrations.
  • The digital value (digitalValue) will be HIGH (1) if the gas concentration exceeds the threshold set by the potentiometer.

Troubleshooting and FAQs

Common Issues and Solutions

Issue Possible Cause Solution
No output from the sensor Incorrect wiring or loose connections Verify all connections and wiring.
Analog readings are unstable Insufficient preheat time Allow the sensor to preheat for 20 seconds.
Digital output always HIGH or LOW Threshold not set correctly Adjust the potentiometer to set the threshold.
Sensor not detecting gas Sensor contamination or damage Clean the sensor or replace if damaged.
Fluctuating readings Power supply instability Use a stable 5V DC power source.

FAQs

  1. Can the MQ-2 detect multiple gases simultaneously?

    • Yes, the MQ-2 can detect multiple gases, but it cannot differentiate between them. It provides a combined reading for all detectable gases.
  2. How do I calibrate the MQ-2 sensor?

    • Calibration involves exposing the sensor to a known concentration of gas and adjusting the potentiometer or interpreting the analog output accordingly.
  3. What is the lifespan of the MQ-2 sensor?

    • The typical lifespan of the MQ-2 sensor is around 2-3 years, depending on usage and environmental conditions.
  4. Can I use the MQ-2 with a 3.3V microcontroller?

    • The MQ-2 is designed for 5V operation. If using a 3.3V microcontroller, a level shifter or voltage regulator may be required.

By following this documentation, users can effectively integrate the MQ-2 Gas Sensor Module into their projects for reliable gas detection and monitoring.