
The MQ-2 smoke sensor is a versatile and reliable module designed to detect a variety of gases, including methane, LPG, carbon monoxide, alcohol, propane, and hydrogen. Widely utilized in safety, security, and environmental monitoring projects, the MQ-2 is ideal for building smoke alarms, gas leak detectors, and air quality monitoring systems. Whether you’re a student, hobbyist, or professional, the MQ-2 sensor offers affordability, accuracy, and ease of use for your innovative projects.
The MQ-2 smoke sensor is a gas detection module that employs a semiconductor-based sensing element to identify the presence of harmful or flammable gases. It features:
Provides a continuous voltage signal proportional to gas concentration for precise monitoring.
Delivers a simple HIGH or LOW signal when the gas concentration exceeds a predefined threshold, perfect for triggering alarms
Capable of detecting gas concentrations from 300 ppm to 10,000 ppm.
Operating Voltage: 5V DC
Current Consumption: ≤150mA
Response Time: ≤10 seconds
Preheating Time: ~20 seconds
Detection Range: 300 ppm to 10,000 ppm
VCC: Connects to the 5V power supply.
GND: Ground connection.
DO (Digital Output): Outputs HIGH/LOW signals based on gas concentration.
AO (Analog Output): Provides variable voltage proportional to gas concentration.

The MQ-2 operates via a gas-sensitive resistor that changes resistance when exposed to gas molecules. This resistance variation is converted into an electrical signal, enabling accurate gas concentration monitoring
MQ-2 smoke sensor module
Arduino Uno board
Jumper wires
Breadboard
LED (optional for visual indication)
Wiring Instructions:
Connect VCC to the Arduino’s 5V pin.
Connect GND to the Arduino’s GND pin.
Connect AO to an analog input pin (e.g., A0) for analog readings.
Connect DO to a digital pin (e.g., D2) for digital readings.

int analogPin = A0; // Analog pin connected to AO
int digitalPin = 2; // Digital pin connected to DO
int ledPin = 13; // LED connected to digital pin 13
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(digitalPin, INPUT);
Serial.begin(9600);
}
void loop() {
int analogValue = analogRead(analogPin);
int digitalValue = digitalRead(digitalPin);
Serial.print("Analog Value: ");
Serial.println(analogValue);
Serial.print("Digital Value: ");
Serial.println(digitalValue);
if (digitalValue == HIGH) {
digitalWrite(ledPin, HIGH); // Turn on LED if gas is detected
} else {
digitalWrite(ledPin, LOW); // Turn off LED if no gas is detected
}
delay(1000);
}
This code reads the analog and digital values from the MQ-2 sensor. It lights up the LED if the gas concentration exceeds the threshold while displaying values on the Serial Monitor.
The MQ-2 sensor is highly versatile and finds applications in:
Smoke Alarm Detectors:
Early warning systems for fire hazards. Gas Leak Detectors: Monitoring LPG, methane,. other flammable gases.
Home Security Systems:
Detecting hazardous gas leaks.
Environmental Monitoring:
Measuring air quality.
Science and Engineering Projects:
Ideal for school and final-year projects.
Best Prices in Lahore: Affordable and genuine components for your projects.
Wide Range of Products: From sensors to modules, catering to beginners and professionals alike.
Exceptional Customer Service: Expert guidance for engineering and DIY projects.
Convenient Location: Located at Hall Road, Lahore—a hub for electronics enthusiasts.
Visit their store at Hall Road, Lahore.
Browse their online catalog for detailed product listings and specifications.
Contact their support team for assistance.