📋 Overview
The MQ-5 gas sensor detector module is designed for leak detection of LPG (Liquified Petroleum Gas), methane (CH₄), propane, butane, natural gas, and city gas. It features low sensitivity to alcohol and smoke, making it well-suited for both home and industrial gas monitoring applications.
The module is built around the MQ-5 semiconductor gas sensor element mounted on a convenient breakout board with onboard signal conditioning. It provides both an analog output (AO) that varies with gas concentration and a digital TTL output (DO) that triggers when gas concentration exceeds an adjustable threshold. The threshold is set using the onboard potentiometer.
With its fast response and recovery characteristics, long service life, and reliable stability, the MQ-5 module is a popular choice for gas leak alarm systems, air quality monitors, and Arduino-based safety projects.
⭐ Key Features
- Multi-Gas Detection — Detects LPG, methane, propane, butane, natural gas, and city gas
- Dual Signal Output — Analog (AO) and digital TTL (DO) outputs for flexible integration
- Adjustable Threshold — Onboard potentiometer to set the digital output trigger level
- Indicator LEDs — Power LED and digital output (DO) status LED for visual feedback
- Low Cross-Sensitivity — Low sensitivity to alcohol and smoke reduces false triggers
- Fast Response & Recovery — Quick detection and return to baseline for reliable monitoring
- Simple Interface — Only 4 pins (VCC, GND, AO, DO) — no library required
- 5V Compatible — Works directly with Arduino, ESP8266, and other 5V development boards
📊 Specifications
| Parameter | Value |
|---|---|
| Operating Voltage | 5V DC |
| Maximum Power Consumption | 800 mW (160 mA at 5V) |
| Analog Output (AO) | 0V to ~5V (proportional to gas concentration) |
| Digital Output (DO) | TTL level — LOW normally, HIGH when gas detected |
| Threshold Adjustment | Onboard potentiometer |
| Detectable Gases | LPG, methane (CH₄), propane, butane, natural gas, city gas |
| Preheat / Warm-Up Time | 24–48 hours (initial); ~2–5 minutes for subsequent power-ons |
| Indicator LEDs | Power LED, DO (Digital Output) LED |
| Dimensions | Approx. 32 × 20 × 27 mm (1.25 x 0.8 x 1.1 inches) L × W × H |
| Weight | ~7 grams |
📌 Pinout
The MQ-5 module has 4 pins arranged in a single header row:
| Pin | Label | Description |
|---|---|---|
| 1 | VCC | Power supply input — connect to +5V |
| 2 | GND | Ground — connect to GND |
| 3 | DO | Digital output — TTL HIGH when gas exceeds threshold |
| 4 | AO | Analog output — voltage proportional to gas concentration (0–5V) |
📝 Note: Pin order may vary slightly between manufacturers. Always verify the silkscreen labels printed on your specific module before wiring.
🏗️ Schematic / Circuit Diagram
The schematic below shows the onboard circuit of the MQ-5 gas sensor detector module, including the sensor element, comparator (LM393), potentiometer for threshold adjustment, and indicator LEDs.

Key components on the module:
- MQ-5 Sensor Element — The cylindrical metal-mesh component that detects combustible gases
- LM393 Comparator — Compares the sensor signal against the potentiometer threshold to produce the digital output
- Potentiometer — Adjusts the gas concentration threshold for the digital (DO) output. Turn clockwise to increase sensitivity (trigger at lower concentrations), counter-clockwise to decrease
- Power LED — Illuminates when the module is powered
- DO LED — Illuminates when the digital output is triggered (gas detected above threshold)
🔌 Wiring to Arduino
The MQ-5 module connects to an Arduino Uno (or compatible board) with just 4 wires. No external components are needed.
Wiring Table
| MQ-5 Module Pin | Arduino Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| AO | A0 (Analog Input) |
| DO | D2 (Digital Input) |
⚠️ Important: The MQ-5 sensor element draws up to 160 mA. When powering from an Arduino's 5V pin, make sure you are using USB power or an external supply that can provide sufficient current. If you experience unstable readings, use an external 5V power supply for the module's VCC pin (with a shared GND connection to the Arduino).
🔧 How It Works
The MQ-5 module uses a tin dioxide (SnO₂) semiconductor sensor element. Here's how it operates:
- Heating: The sensor contains a small heater coil that raises the SnO₂ element to its operating temperature. This is why the module draws relatively high current (~160 mA) and requires a warm-up period.
- Gas Detection: When combustible gas molecules contact the heated SnO₂ surface, the sensor's electrical resistance decreases. Higher gas concentration means lower resistance.
- Analog Output (AO): The onboard voltage divider converts the resistance change into a voltage signal (0–5V). Higher gas concentration produces a higher voltage on the AO pin.
- Digital Output (DO): The LM393 comparator compares the analog signal against a reference voltage set by the potentiometer. When the gas concentration exceeds the threshold, the DO pin goes HIGH and the DO LED illuminates.
🚀 Step 1: Reading Analog Gas Levels
This basic sketch reads the analog output from the MQ-5 sensor and prints the raw value (0–1023) to the Serial Monitor. Use this to observe how the sensor responds to gas and to help calibrate your threshold.
/*
* MQ-5 Gas Sensor — Analog Reading
* Envistia Mall - Product Support
*
* Reads the analog output of the MQ-5 sensor
* and prints the value to the Serial Monitor.
*
* Connections:
* MQ-5 VCC -> Arduino 5V
* MQ-5 GND -> Arduino GND
* MQ-5 AO -> Arduino A0
* MQ-5 DO -> Arduino D2 (optional for this sketch)
*/
const int gasSensorAnalog = A0; // Analog input pin
void setup() {
Serial.begin(9600);
Serial.println("MQ-5 Gas Sensor - Analog Reading");
Serial.println("Warming up sensor (allow 2-5 minutes)...");
Serial.println();
}
void loop() {
int sensorValue = analogRead(gasSensorAnalog);
Serial.print("Gas Level (raw): ");
Serial.print(sensorValue);
Serial.print(" | Voltage: ");
Serial.print(sensorValue * (5.0 / 1023.0), 2);
Serial.println(" V");
delay(1000); // Read once per second
}
How to Use:
- Wire the MQ-5 module to your Arduino as shown in the wiring table above
- Upload the sketch to your Arduino
- Open the Serial Monitor at 9600 baud
- Allow the sensor 2–5 minutes to warm up — readings will stabilize as the heater reaches operating temperature
- Observe the baseline reading in clean air, then bring a gas source (such as a butane lighter with the gas valve open but unlit) near the sensor to see the value increase
🚀 Step 2: Digital Threshold Gas Detection with Alarm
This sketch uses both the analog and digital outputs. The digital output (DO) triggers when gas concentration exceeds the threshold set by the onboard potentiometer. This example also demonstrates a simple serial alarm message.
/*
* MQ-5 Gas Sensor — Digital Threshold Detection
* Envistia Mall - Product Support
*
* Reads both analog and digital outputs.
* Prints an alarm when gas exceeds the
* potentiometer-set threshold.
*
* Connections:
* MQ-5 VCC -> Arduino 5V
* MQ-5 GND -> Arduino GND
* MQ-5 AO -> Arduino A0
* MQ-5 DO -> Arduino D2
*/
const int gasSensorAnalog = A0; // Analog input pin
const int gasSensorDigital = 2; // Digital input pin
void setup() {
Serial.begin(9600);
pinMode(gasSensorDigital, INPUT);
Serial.println("MQ-5 Gas Sensor - Threshold Detection");
Serial.println("Warming up sensor (allow 2-5 minutes)...");
Serial.println();
}
void loop() {
int analogValue = analogRead(gasSensorAnalog);
int digitalValue = digitalRead(gasSensorDigital);
Serial.print("Analog: ");
Serial.print(analogValue);
Serial.print(" | Digital: ");
Serial.print(digitalValue);
if (digitalValue == HIGH) {
Serial.print(" | *** GAS DETECTED! ***");
} else {
Serial.print(" | Normal");
}
Serial.println();
delay(500);
}
How to Use:
- Wire the MQ-5 module to your Arduino including both AO and DO connections
- Upload the sketch to your Arduino
- Open the Serial Monitor at 9600 baud
- Allow the sensor to warm up for 2–5 minutes
- Use a small screwdriver to adjust the onboard potentiometer — turn it to set the threshold where the DO LED just turns off in clean air
- Introduce gas near the sensor — when the concentration exceeds your threshold, you'll see "GAS DETECTED!" in the Serial Monitor and the DO LED will illuminate
💡 Tips & Best Practices
- Initial Burn-In: For best accuracy, the MQ-5 datasheet recommends a 24–48 hour initial burn-in period the first time you use the sensor. After this initial period, subsequent warm-ups only take about 2–5 minutes.
- Potentiometer Calibration: Adjust the potentiometer in clean air so the DO LED is just off. This sets your baseline. Then test with a known gas source to verify the trigger point.
- Ventilation: After gas exposure, allow the sensor to return to clean air. The readings will gradually return to baseline — this is normal recovery behavior.
- Placement: For detecting gases lighter than air (like methane and natural gas), mount the sensor high. For heavier-than-air gases (like propane and butane), mount it low near the floor.
- Analog Readings: The raw analog value (0–1023) is not a direct PPM measurement. For approximate PPM conversion, you would need to calibrate against a known gas concentration and apply the sensitivity curves from the MQ-5 datasheet.
- Power Supply: If readings seem erratic, try powering the module from an external 5V supply rather than the Arduino's 5V pin. The sensor's heater draws significant current that can affect other components.
⚠️ Important Notes
- The sensor element gets hot during operation. Do not touch the metal mesh cylinder while the module is powered — it can cause burns.
- This module is intended for gas detection and indication only. It is not a certified safety device and should not be used as the sole protection against gas leaks in life-safety applications.
- Do not expose the sensor to high concentrations of gas for extended periods, as this can degrade the sensor element over time.
- The MQ-5 sensor has low sensitivity to alcohol and smoke, but it is not completely immune. In environments with heavy smoke or alcohol vapors, some cross-sensitivity may occur.
- Keep the sensor away from direct airflow (fans, HVAC vents) that could dilute gas concentrations and cause missed detections.
🎯 Typical Applications
- Home gas leak detection (kitchen, furnace room, garage)
- Industrial gas monitoring systems
- Arduino and microcontroller safety projects
- Portable gas sniffers and handheld detectors
- Smart home automation — trigger ventilation fans or shut-off valves when gas is detected
- Educational and STEM projects demonstrating analog sensor interfacing
🏪 Where to Buy the MQ-5 Gas Sensor Module
This module is available at envistiamall.com.
- 📦 Fast US Shipping
- 🔄 Hassle-Free Returns
- 📧 Responsive Customer Support
📚 Additional Resources
- MQ-5 Gas Sensor Datasheet — Detailed sensitivity curves, temperature characteristics, and electrical specifications
- LM393 Comparator Datasheet — For understanding the digital output circuit on the module
- Arduino analogRead() Reference — Arduino documentation for reading analog sensor values
This guide is provided by Envistia Mall for educational and technical reference purposes. The manufacturer and Envistia LLC (dba Envistia Mall) are not responsible for any damages or losses resulting from the use of this product. Always follow proper electrical safety practices when working with electronic components. Specifications are based on manufacturer data and are subject to change without notice.