📋 Overview
The MQ-135 gas sensor detector module is designed for air quality monitoring, detecting a broad range of gases and vapors including ammonia (NH₃), nitrogen oxides (NOx), alcohol, benzene, smoke, and carbon dioxide (CO₂). Unlike other MQ-series sensors that focus primarily on combustible or toxic gases, the MQ-135 is optimized for general air quality assessment — making it ideal for indoor environment monitoring, ventilation control, and pollution detection.
The module is built around the MQ-135 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 concentration exceeds an adjustable threshold set by the onboard potentiometer.
With its fast response and recovery characteristics, long service life, and reliable stability, the MQ-135 module is a popular choice for air quality monitors, smart ventilation systems, and Arduino-based environmental sensing projects. It is suitable for both home and industrial use.
⭐ Key Features
- Air Quality Monitoring — Detects ammonia (NH₃), nitrogen oxides (NOx), alcohol, benzene, smoke, and CO₂
- Broad-Spectrum Detection — Responds to both toxic gases and volatile organic compounds (VOCs)
- 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
- 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) |
| Detectable Gases | Ammonia (NH₃), nitrogen oxides (NOx), alcohol, benzene, smoke, CO₂ |
| 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 |
| Preheat / Warm-Up Time | 24–48 hours (initial burn-in); ~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 |
🔬 Detectable Gases Reference
The MQ-135 responds to a variety of gases and vapors commonly associated with poor air quality. The table below summarizes each target gas and its typical sources.
| Gas / Vapor | Formula | Common Sources |
|---|---|---|
| Ammonia | NH₃ | Cleaning products, fertilizers, animal waste, refrigeration leaks |
| Nitrogen Oxides | NOx | Vehicle exhaust, combustion appliances, industrial emissions |
| Alcohol | C₂H₅OH | Solvents, sanitizers, fermentation, cleaning agents |
| Benzene | C₆H₆ | Paints, adhesives, gasoline vapors, tobacco smoke |
| Smoke | — | Combustion byproducts, cooking, tobacco, wildfires |
| Carbon Dioxide | CO₂ | Human respiration, combustion, fermentation, HVAC systems |
📝 Note: The MQ-135 provides a general air quality indication. It cannot distinguish between individual gases on its own — the analog output reflects the combined presence of all detectable gases. For gas-specific measurements, dedicated sensors (e.g., an NDIR sensor for precise CO₂ readings) are recommended.
📌 Pinout
The MQ-135 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-135 air quality gas sensor detector module, including the sensor element, comparator (LM393), potentiometer for threshold adjustment, and indicator LEDs.

Key components on the module:
- MQ-135 Sensor Element — The cylindrical metal-mesh component that detects air quality gases and vapors
- 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 (poor air quality detected above threshold)
🔌 Wiring to Arduino
The MQ-135 module connects to an Arduino Uno (or compatible board) with just 4 wires. No external components are needed.
Wiring Table
| MQ-135 Module Pin | Arduino Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| AO | A0 (Analog Input) |
| DO | D2 (Digital Input) |
⚠️ Important: The MQ-135 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-135 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 target gas molecules (NH₃, NOx, alcohol, benzene, smoke particles, or CO₂) 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 Air Quality Levels
This basic sketch reads the analog output from the MQ-135 sensor and prints the raw value (0–1023) to the Serial Monitor. Use this to observe how the sensor responds to changes in air quality and to help calibrate your threshold.
/*
* MQ-135 Air Quality Sensor — Analog Reading
* Envistia Mall - Product Support
*
* Reads the analog output of the MQ-135 sensor
* and prints the value to the Serial Monitor.
*
* Connections:
* MQ-135 VCC -> Arduino 5V
* MQ-135 GND -> Arduino GND
* MQ-135 AO -> Arduino A0
* MQ-135 DO -> Arduino D2 (optional for this sketch)
*/
const int airSensorAnalog = A0; // Analog input pin
void setup() {
Serial.begin(9600);
Serial.println("MQ-135 Air Quality Sensor - Analog Reading");
Serial.println("Warming up sensor (allow 2-5 minutes)...");
Serial.println();
}
void loop() {
int sensorValue = analogRead(airSensorAnalog);
Serial.print("Air Quality (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-135 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, well-ventilated air — this is your "good air quality" reference value
- Try breathing near the sensor (exhaled CO₂), using a cleaning product nearby (ammonia/alcohol), or introducing smoke — you should see the value increase
🚀 Step 2: Digital Threshold Air Quality Alert
This sketch uses both the analog and digital outputs. The digital output (DO) triggers when air quality degrades past the threshold set by the onboard potentiometer. This example demonstrates a simple serial alert message.
/*
* MQ-135 Air Quality Sensor — Digital Threshold Detection
* Envistia Mall - Product Support
*
* Reads both analog and digital outputs.
* Prints an alert when air quality degrades past
* the potentiometer-set threshold.
*
* Connections:
* MQ-135 VCC -> Arduino 5V
* MQ-135 GND -> Arduino GND
* MQ-135 AO -> Arduino A0
* MQ-135 DO -> Arduino D2
*/
const int airSensorAnalog = A0; // Analog input pin
const int airSensorDigital = 2; // Digital input pin
void setup() {
Serial.begin(9600);
pinMode(airSensorDigital, INPUT);
Serial.println("MQ-135 Air Quality Sensor - Threshold Detection");
Serial.println("Warming up sensor (allow 2-5 minutes)...");
Serial.println();
}
void loop() {
int analogValue = analogRead(airSensorAnalog);
int digitalValue = digitalRead(airSensorDigital);
Serial.print("Analog: ");
Serial.print(analogValue);
Serial.print(" | Digital: ");
Serial.print(digitalValue);
if (digitalValue == HIGH) {
Serial.print(" | *** POOR AIR QUALITY! ***");
} else {
Serial.print(" | Air Quality OK");
}
Serial.println();
delay(500);
}
How to Use:
- Wire the MQ-135 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, well-ventilated air
- Introduce a gas source near the sensor — when the air quality degrades past your threshold, you'll see "POOR AIR QUALITY!" in the Serial Monitor and the DO LED will illuminate
🚀 Step 3: Simple Air Quality Index Display
This sketch maps the MQ-135 analog reading to a simple air quality index with descriptive labels. This is useful for display projects, dashboards, or smart home integrations.
/*
* MQ-135 Air Quality Sensor — Simple AQI Display
* Envistia Mall - Product Support
*
* Maps the analog reading to a simple air quality
* index with descriptive labels.
*
* Connections:
* MQ-135 VCC -> Arduino 5V
* MQ-135 GND -> Arduino GND
* MQ-135 AO -> Arduino A0
*
* Note: These thresholds are approximate and should
* be calibrated for your specific environment.
* They are NOT equivalent to official AQI values.
*/
const int airSensorAnalog = A0;
void setup() {
Serial.begin(9600);
Serial.println("MQ-135 Air Quality Index Display");
Serial.println("Warming up sensor (allow 2-5 minutes)...");
Serial.println();
Serial.println("Calibration: Note the baseline reading in");
Serial.println("clean air and adjust thresholds accordingly.");
Serial.println();
}
void loop() {
int sensorValue = analogRead(airSensorAnalog);
float voltage = sensorValue * (5.0 / 1023.0);
Serial.print("Raw: ");
Serial.print(sensorValue);
Serial.print(" | ");
Serial.print(voltage, 2);
Serial.print("V | Air Quality: ");
// Approximate thresholds — calibrate for your environment
if (sensorValue < 150) {
Serial.println("EXCELLENT (Fresh Air)");
} else if (sensorValue < 300) {
Serial.println("GOOD");
} else if (sensorValue < 500) {
Serial.println("MODERATE");
} else if (sensorValue < 700) {
Serial.println("POOR — Consider Ventilation");
} else {
Serial.println("HAZARDOUS — Ventilate Immediately!");
}
delay(2000); // Read every 2 seconds
}
How to Use:
- Wire the MQ-135 module to your Arduino (only AO is needed for this sketch)
- Upload the sketch to your Arduino
- Open the Serial Monitor at 9600 baud
- Allow the sensor to warm up for 2–5 minutes in clean, well-ventilated air
- Note the baseline reading — this is your "Excellent" reference point
- Adjust the threshold values in the code to match your baseline. For example, if your clean-air baseline reads ~100, the thresholds above should work well. If your baseline is higher (e.g., ~200), shift all thresholds up accordingly
- Test by introducing various sources: exhale near the sensor, use a cleaning product nearby, or introduce smoke
📝 Note: The thresholds in this sketch are approximate starting points and are not equivalent to official Air Quality Index (AQI) values. Calibrate them based on your specific environment and baseline readings.
💡 Tips & Best Practices
- Initial Burn-In: For best accuracy, allow a 24–48 hour initial burn-in period the first time you use the sensor. This conditions the sensing element for stable, reliable readings. After this initial period, subsequent warm-ups only take about 2–5 minutes.
- Potentiometer Calibration: Adjust the potentiometer in clean, well-ventilated air so the DO LED is just off. This sets your baseline. Then test with a known gas source to verify the trigger point.
- Baseline Drift: The MQ-135 baseline reading can shift with temperature and humidity changes. For best results, recalibrate periodically or account for environmental conditions in your code.
- Ventilation: After gas exposure, allow the sensor to return to clean air. The readings will gradually return to baseline — this is normal recovery behavior.
- Easy Test Sources: Exhale near the sensor (CO₂), hold a cotton ball with rubbing alcohol nearby (alcohol), or use a household ammonia-based cleaner at a safe distance (NH₃). These are safe ways to verify the sensor is responding.
- CO₂ Limitations: While the MQ-135 responds to CO₂, it is not a precision CO₂ sensor. For accurate CO₂ measurements (e.g., for HVAC or greenhouse control), use a dedicated NDIR CO₂ sensor. The MQ-135 is best used as a general air quality indicator.
- 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-135 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 air quality indication only. It is not a certified air quality monitor and should not be used as the sole basis for health or safety decisions.
- The MQ-135 is a broad-spectrum sensor — it responds to multiple gases and vapors simultaneously. It cannot differentiate between individual gas types on its own.
- Do not expose the sensor to high concentrations of corrosive gases (such as concentrated ammonia or strong solvents) for extended periods, as this can degrade the sensor element over time.
- Keep the sensor away from direct airflow (fans, HVAC vents) that could dilute gas concentrations and cause inaccurate readings.
- Benzene is a known carcinogen. Do not intentionally expose yourself to benzene vapors for testing purposes. Use the sensor in well-ventilated areas when monitoring for benzene.
- Temperature and humidity can affect sensor readings. For outdoor or high-humidity environments, consider housing the module in a protective enclosure with adequate airflow.
🎯 Typical Applications
- Indoor air quality monitoring (homes, offices, classrooms)
- Smart ventilation and HVAC control — trigger fans or dampers when air quality degrades
- Ammonia detection in agricultural and livestock facilities
- Solvent and VOC monitoring in workshops and labs
- Smoke detection as a secondary indicator
- CO₂ trend monitoring (general indication, not precision)
- Arduino and microcontroller environmental sensing projects
- Air quality dashboards and IoT data logging
- Smart home automation — trigger alerts, fans, or air purifiers
- Educational and STEM projects demonstrating analog sensor interfacing
🏪 Where to Buy the MQ-135 Air Quality Gas Sensor Detector Module
This module is available at Envistia Mall.
- 📦 Fast US Shipping
- 🔄 Hassle-Free Returns
- 📧 Responsive Customer Support
📚 Additional Resources
- MQ-135 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.