
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.
The MQ-2, manufactured by Zanefac (Part ID: MQ-2), is a versatile gas sensor designed to detect a variety of gases, including LPG, propane, methane, and smoke. It operates on the principle of resistive change in the presence of target gases, producing an analog output proportional to the gas concentration. This sensor is widely used in applications such as gas leak detection, air quality monitoring, and safety systems.

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.

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.

This circuit is an automated safety system that detects smoke or gas using an MQ2 sensor and activates a solenoid lock and buzzer in response. It includes a voice recognition module, an ESP32 for additional functionalities, and is powered by a 12V battery and solar panel with a charge controller. The system is controlled by an Arduino Mega 2560, which also manages multiple relays to control exhaust fans and other components.

This circuit is designed for an automatic safety and alert system that detects smoke or gas using an MQ2 sensor, and in response, unlocks a solenoid lock and activates a buzzer. It features an Arduino Mega 2560 for control logic, a DFPlayer Mini for audio output, a voice recognition module for voice commands, and an ESP32 for additional functionalities. The system is powered by a 12V battery, supported by a solar panel through a charge controller, and uses relays to control exhaust fans.
The MQ-2 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 |
| Power Consumption | ≤ 800 mW |
| Detection Range | 200 ppm – 10,000 ppm |
| Preheat Time | ≥ 24 hours for best accuracy |
| Output Signal | Analog (0–5V) |
| Sensitivity | Detects LPG, propane, methane, smoke, etc. |
The MQ-2 sensor typically comes with four pins. Below is the pinout description:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (5V DC) |
| 2 | GND | Ground pin |
| 3 | AOUT | Analog output pin (proportional to gas levels) |
| 4 | DOUT | Digital output pin (threshold-based signal) |
The MQ-2 sensor is straightforward to use in a circuit. Follow the steps below to integrate 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 UNO) to read gas concentration levels.DOUT pin to a digital input pin of your microcontroller. Adjust the onboard potentiometer to set the gas concentration threshold for triggering the digital output.Below is an example of how to use the MQ-2 sensor with an Arduino UNO to read analog gas concentration levels:
// MQ-2 Gas Sensor Example Code
// Manufacturer: Zanefac
// Part ID: MQ-2
// This code reads the analog output of the MQ-2 sensor and prints the value
// to the Serial Monitor. Ensure the sensor is connected to the correct pins.
const int analogPin = A0; // Connect AOUT pin of MQ-2 to Arduino A0
int sensorValue = 0; // Variable to store the sensor reading
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Serial.println("MQ-2 Gas Sensor Test");
}
void loop() {
sensorValue = analogRead(analogPin); // Read the analog value from the sensor
Serial.print("Gas Concentration (Analog Value): ");
Serial.println(sensorValue); // Print the sensor value to the Serial Monitor
delay(1000); // Wait for 1 second before the next reading
}
DOUT pin if using the digital output.| Issue | Possible Cause | Solution |
|---|---|---|
| No output from the sensor | Incorrect wiring or power supply issue | Verify connections and ensure 5V power |
| Unstable or fluctuating readings | Insufficient preheat time | Allow the sensor to preheat for 24 hours |
| Low sensitivity to target gases | Calibration not performed | Calibrate the sensor in a known gas environment |
| Digital output not triggering | Threshold not set correctly | Adjust the potentiometer on the sensor |
Can the MQ-2 detect multiple gases simultaneously?
Yes, the MQ-2 can detect multiple gases, but it cannot differentiate between them. The output represents the combined concentration of all detectable gases.
How do I calibrate the MQ-2 sensor?
To calibrate, expose the sensor to a known concentration of gas and adjust the load resistance (RL) or use software calibration to map the analog output to the gas concentration.
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.
Can the MQ-2 be used outdoors?
While the MQ-2 can be used outdoors, it should be protected from extreme weather conditions and direct exposure to water.
By following this documentation, you can effectively integrate and use the MQ-2 gas sensor in your projects.