

The MQ-2 Gas Sensor, manufactured by Winsen Electronics (Part ID: MQ-2), is a versatile and widely used sensor designed to detect various gases, including LPG, propane, methane, hydrogen, alcohol, and smoke. It operates on the principle of resistive change in the presence of gas, providing an analog output proportional to the gas concentration. This sensor is ideal for applications such as gas leak detection, air quality monitoring, and safety systems in residential, industrial, and automotive environments.








The MQ-2 Gas Sensor is designed for ease of use and integration into various systems. Below are its key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 5V DC |
| Load Resistance (RL) | Adjustable (typically 10 kΩ) |
| Heater Voltage (VH) | 5V ± 0.2V |
| Heater Power Consumption | ≤ 800 mW |
| Detection Range | 200 ppm to 10,000 ppm |
| Preheat Time | ≥ 24 hours for best accuracy |
| Output Signal | Analog (0-5V) |
| Sensitivity | Detects LPG, propane, methane, hydrogen, alcohol, and smoke |
The MQ-2 sensor typically comes with four pins or six pins, depending on the module version. Below is the pin configuration for the 4-pin version:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (5V DC) |
| 2 | GND | Ground connection |
| 3 | AOUT | Analog output signal proportional to gas level |
| 4 | DOUT | Digital output (threshold-based, optional use) |
For the 6-pin version, the additional pins are typically duplicates of the above connections.
The MQ-2 Gas Sensor is straightforward to use in a circuit. Below are the steps and best practices for integrating it into your project:
VCC pin to a 5V DC power source and the GND pin to ground.AOUT pin to an analog input pin of your microcontroller (e.g., Arduino).DOUT pin, connect it to a digital input pin of your microcontroller. Adjust the onboard potentiometer to set the gas concentration threshold for the digital output.Below is an example of how to use the MQ-2 Gas Sensor with an Arduino UNO to read analog values:
// MQ-2 Gas Sensor Example Code for Arduino UNO
// This code reads the analog output of the MQ-2 sensor and prints the value
// to the Serial Monitor. Ensure the sensor is preheated for accurate readings.
const int MQ2_AOUT_PIN = A0; // Connect AOUT pin of MQ-2 to Arduino analog pin A0
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Serial.println("MQ-2 Gas Sensor Test");
delay(2000); // Allow time for the sensor to stabilize
}
void loop() {
int sensorValue = analogRead(MQ2_AOUT_PIN); // Read analog value from MQ-2
float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage (0-5V)
// Print the sensor value and voltage to the Serial Monitor
Serial.print("Sensor Value: ");
Serial.print(sensorValue);
Serial.print(" | Voltage: ");
Serial.print(voltage);
Serial.println(" V");
delay(1000); // Wait 1 second before the next reading
}
| Issue | Possible Cause | Solution |
|---|---|---|
| No output signal | Incorrect wiring or loose connections | Verify all connections and wiring. |
| Unstable or fluctuating readings | Insufficient preheating time | Allow the sensor to preheat for 24 hours. |
| Low sensitivity to gas | Dirty or obstructed sensor surface | Clean the sensor with a soft brush. |
| High power consumption | Faulty power supply or heater circuit | Check the power supply and heater voltage. |
How long does the sensor last?
Can the sensor detect multiple gases simultaneously?
Why is the sensor output noisy?
Is the sensor safe for continuous operation?
By following the above guidelines and best practices, you can effectively integrate the MQ-2 Gas Sensor into your projects for reliable gas detection and monitoring.