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

How to Use MQ-2 SENSOR: Examples, Pinouts, and Specs

Image of MQ-2 SENSOR
Cirkit Designer LogoDesign with MQ-2 SENSOR in Cirkit Designer

Introduction

The MQ-2 sensor module is a versatile gas detection device capable of identifying various combustible gases, particularly methane, butane, propane, and LPG (liquefied petroleum gas). It is widely used in safety applications such as gas leak detection in household and industrial settings, as well as in air quality monitoring systems. The sensor's high sensitivity and fast response time make it an essential component in preventing potential hazards related to gas leaks.

Explore Projects Built with MQ-2 SENSOR

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 SENSOR 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 SENSOR 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
MQ-2 Gas Detection Circuit with Audio-Visual Alert
Image of Smoke detector: A project utilizing MQ-2 SENSOR in a practical application
This circuit is designed to detect gases using an MQ-2 sensor and provide alerts through a buzzer and a bulb. The buzzer is triggered by the sensor's digital output, while the bulb, in series with a resistor, may serve as a status indicator or additional alert. The entire circuit is powered by a 9V battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Gas Detection and Monitoring System with Battery Power
Image of Smart bot: A project utilizing MQ-2 SENSOR in a practical application
This circuit is a sensor-based monitoring system using an Arduino UNO, which reads data from multiple gas sensors (MQ-2 and MQ-4) and a temperature sensor (mlx90614). The system includes an SD card module for data logging, multiple LEDs for visual indicators, and a buzzer for audible alerts, all powered by a battery pack.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MQ-2 SENSOR

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 SENSOR 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 SENSOR 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 Smoke detector: A project utilizing MQ-2 SENSOR in a practical application
MQ-2 Gas Detection Circuit with Audio-Visual Alert
This circuit is designed to detect gases using an MQ-2 sensor and provide alerts through a buzzer and a bulb. The buzzer is triggered by the sensor's digital output, while the bulb, in series with a resistor, may serve as a status indicator or additional alert. The entire circuit is powered by a 9V battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Smart bot: A project utilizing MQ-2 SENSOR in a practical application
Arduino UNO-Based Gas Detection and Monitoring System with Battery Power
This circuit is a sensor-based monitoring system using an Arduino UNO, which reads data from multiple gas sensors (MQ-2 and MQ-4) and a temperature sensor (mlx90614). The system includes an SD card module for data logging, multiple LEDs for visual indicators, and a buzzer for audible alerts, all powered by a battery pack.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Technical Details

  • Sensor Type: Semiconductor
  • Detection Gases: Methane, Butane, LPG, Smoke
  • Concentration Range: 300 to 10000 ppm (parts per million)
  • Supply Voltage: 5V DC
  • Output Voltage: 0.1 to 0.3V (relative to gas concentration)
  • Preheat Duration: 20 seconds
  • Operating Temperature: -10 to 50°C
  • Load Resistance: Adjustable via onboard potentiometer

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 VCC Power supply input (5V DC)
2 GND Ground
3 DOUT Digital output (0V or 5V)
4 AOUT Analog output (0.1V to 0.3V)

Usage Instructions

Integration with a Circuit

To use the MQ-2 sensor module in a circuit:

  1. Connect the VCC pin to a 5V power supply.
  2. Attach the GND pin to the ground of the power supply.
  3. The AOUT pin provides an analog voltage output that is proportional to the concentration of gases. Connect this to an analog input on your microcontroller.
  4. The DOUT pin provides a digital output which can be set to high or low based on a threshold value. This can be connected to a digital input on your microcontroller.

Important Considerations and Best Practices

  • Calibration: The MQ-2 sensor requires calibration to ensure accurate readings. Expose the sensor to clean air and adjust the onboard potentiometer until the desired threshold is reached.
  • Ventilation: Ensure proper ventilation when testing the sensor to avoid harmful gas accumulation.
  • Safety: Always follow safety protocols when working with combustible gases.
  • Temperature and Humidity: Be aware that the sensor's readings can be affected by temperature and humidity.

Example Code for Arduino UNO

// MQ-2 Sensor Example Code
const int AOUTpin = A0; // Analog output from the sensor
const int DOUTpin = 2;  // Digital output from the sensor

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

void loop() {
  int analogValue = analogRead(AOUTpin);
  int digitalValue = digitalRead(DOUTpin);

  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V)
  float voltage = analogValue * (5.0 / 1023.0);

  Serial.print("Analog Value: ");
  Serial.print(analogValue);
  Serial.print(" - Voltage: ");
  Serial.print(voltage);
  Serial.print("V - Digital Value: ");
  Serial.println(digitalValue);

  // Wait a bit before reading again
  delay(1000);
}

Troubleshooting and FAQs

Common Issues

  • Inconsistent Readings: If the sensor provides inconsistent readings, ensure that it has been properly calibrated and that there are no drastic changes in temperature or humidity.
  • No Response to Gas: Verify that the sensor is correctly powered and that the gas concentration is within the detectable range.
  • Sensor Not Heating Up: Check the power supply and connections to the VCC and GND pins.

Solutions and Tips

  • Calibration: Perform calibration in an environment with a known gas concentration or clean air for more accurate readings.
  • Sensor Burn-In: It is recommended to operate the sensor for 24 hours before taking critical measurements to stabilize its output.
  • Avoid Contaminants: Keep the sensor away from organic solvents, paints, and other contaminants that may affect its sensitivity.

FAQs

Q: How long does the MQ-2 sensor last? A: The lifespan of the MQ-2 sensor is typically around 5 years, depending on usage and environmental conditions.

Q: Can the MQ-2 sensor detect carbon monoxide? A: The MQ-2 is primarily designed for detecting flammable gases and may not be as sensitive to carbon monoxide. For CO detection, a dedicated CO sensor is recommended.

Q: Is the MQ-2 sensor sensitive to alcohol? A: Yes, the MQ-2 sensor can respond to alcohol vapors, but it is not specifically calibrated for measuring alcohol concentration.