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
- VCC: Power supply (3.3V or 5V)
- GND: Ground
- DO: Digital output
- 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
- Connect VCC to the Arduino’s 5V pin.
- Connect GND to the Arduino’s GND pin.
- Connect AO (Analog Output) to an analog input pin (e.g., A0).
- (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
- Allow the sensor to preheat for at least 24 hours before precise calibration.
- Adjust the potentiometer on the module to set the desired digital threshold.
- 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.
Reviews
There are no reviews yet.