Gas sensors are useful in detecting harmful gases and pollutants that may pose risks to human health and safety. This article will discuss the MQ-135 gas sensor overview, internal structure, pinout details, working principle, usage method, specifications, features, applications, and more.

The MQ-135 gas sensor is a popular air-quality sensor used to detect harmful gases and pollutants in the environment. It is commonly applied in indoor air monitoring systems, smart home projects, and educational electronics. The sensor is sensitive to gases such as ammonia (NH₃), nitrogen oxides (NOₓ), alcohol vapors, benzene, smoke, and relative carbon dioxide (CO₂) levels, making it suitable for general pollution detection rather than precise gas analysis.
This sensor works using a tin dioxide (SnO₂) sensing material whose resistance changes when exposed to polluted air. As gas concentration increases, the sensor’s resistance decreases, producing a measurable analog voltage output. The MQ-135 module typically provides both analog and digital outputs, allowing easy integration with microcontrollers like Arduino, ESP32, and Raspberry Pi after proper preheating and calibration.
If you are interested in purchasing the MQ-135 gas sensor, feel free to contact us for pricing and availability.

• Gas Sensing Layer (SnO₂) – The primary sensing material that changes its electrical resistance when exposed to harmful gases such as ammonia, nitrogen oxides, and smoke, enabling gas detection.
• Electrodes (Au) – Gold electrodes that collect the electrical signal generated by resistance changes in the sensing layer, ensuring stable and accurate measurements.
• Electrode Lines (Pt) – Platinum conductors that connect the electrodes to the external pins, offering excellent conductivity and corrosion resistance.
• Heater Coil (Ni-Cr Alloy) – An internal heating element that maintains the sensing layer at the required operating temperature for consistent sensor performance.
• Tubular Ceramic (Al₂O₃) – An alumina ceramic tube that supports the sensing layer and heater while providing electrical insulation and thermal stability.
• Anti-Explosion Stainless Steel Gauze – A protective mesh that allows gas diffusion while preventing sparks and flame propagation, improving safety.
• Clamp Ring (Nickel-Plated Copper) – Secures the mesh and internal components firmly in place.
• Resin Base (Bakelite) – The insulating base that mechanically supports the sensor and isolates electrical connections.
• Tube Pins (Nickel-Plated Copper) – External terminals used to connect the sensor to the module or external circuitry.
• Load Resistor (RL) – Converts resistance changes of the sensor into a measurable output voltage.
• Power Supply (VC) – Provides AC or DC power to the heater and sensing circuit.

| Pin Label | Pin Name | Description |
| H | Heater Pin | Supplies power to the internal heater element, which heats the sensing material to its operating temperature. |
| H | Heater Pin | Second heater terminal; both H pins must be powered for proper sensor operation. |
| A | Electrode A | One side of the sensing electrode; used to measure resistance changes caused by gas exposure. |
| A | Electrode A | Duplicate electrode A pin for flexible wiring and stable signal connection. |
| B | Electrode B | Other side of the sensing electrode; works with A pins to form a variable resistor. |
| B | Electrode B | Duplicate electrode B pin; commonly paired with one A pin through a load resistor. |
| Pin No. | Pin Name | Description |
| 1 | VCC (+5V) | Power supply input for the module and heater circuit. Typical operating voltage is 5V. |
| 2 | GND | Ground reference for the sensor module and output signals. |
| 3 | DO (Digital Output) | Digital signal from the LM393 comparator. Goes HIGH or LOW when gas concentration crosses the set threshold. |
| 4 | AO (Analog Output) | Analog voltage output proportional to gas concentration, suitable for ADC reading and calibration. |
| Sensor Model | Primary Gases Detected | Detection Focus | Typical Operating Voltage | Sensitivity Type |
| MQ-135 | NH₃, NOₓ, Alcohol, Benzene, Smoke, CO₂ (relative) | Air quality / mixed gases | 5V | Broad, air-quality oriented |
| MQ-2 | Methane, Butane, LPG, Smoke | Combustible gases | 5V | High to flammable gases |
| MQ-3 | Alcohol, Ethanol, Smoke | Alcohol vapors | 5V | High alcohol sensitivity |
| MQ-4 | Methane, CNG | Natural gas | 5V | Methane-focused |
| MQ-5 | LPG, Natural Gas | Combustible gases | 5V | Wide combustible range |
| MQ-6 | LPG, Butane | LPG gases | 5V | High LPG sensitivity |
| MQ-7 | Carbon Monoxide (CO) | Toxic gas | 5V | CO-specific |
| MQ-8 | Hydrogen (H₂) | Hydrogen gas | 5V | Hydrogen-specific |
| MQ-9 | CO, Flammable gases | Dual-purpose | 5V | CO + combustible |
| MQ-131 | Ozone (O₃) | Oxidizing gas | 5V | Ozone-specific |
| MQ-136 | Hydrogen Sulfide (H₂S) | Toxic gas | 5V | H₂S-specific |
| MQ-137 | Ammonia (NH₃) | Toxic gas | 5V | Ammonia-specific |
| MQ-138 | Benzene, Toluene, Alcohol, Formaldehyde | VOCs | 5V | Multi-VOC |
| MQ-214 | Methane, Natural Gas | Combustible gas | 5V | Methane-focused |
| MQ-216 | Natural Gas, Coal Gas | Combustible gas | 5V | Coal gas sensitivity |
| MQ303A | Alcohol, Ethanol, Smoke | Alcohol vapors | 5V | Alcohol-focused |
| MQ306A | LPG, Butane | LPG gases | 5V | LPG-specific |
| MQ307A | Carbon Monoxide | Toxic gas | 5V | CO-specific |
| MQ309A | CO, Flammable gases | Dual-purpose | 5V | CO + flammable |
The MQ-135 gas sensor is widely used for monitoring air quality and detecting harmful gases in indoor and outdoor environments. It supports both digital and analog signal outputs, making it suitable for beginners, students, and professionals working on Arduino, ESP32, and IoT-based air monitoring projects. Understanding how to properly use and calibrate the sensor is essential to obtain stable and meaningful results.
To begin, power the MQ-135 module with a 5V supply. Once powered, the onboard power LED will illuminate, indicating that the module is active. Before taking any readings, the sensor must undergo a preheating (burn-in) period. This allows the internal heater to stabilize the tin dioxide (SnO₂) sensing layer, which is critical for consistent gas detection performance.
When using the digital output (DO), the sensor acts as a simple gas threshold detector. In clean air, the digital output remains LOW. As gas concentration increases and exceeds the preset threshold, the output switches to HIGH. The sensitivity and trigger point can be adjusted using the onboard potentiometer, allowing the sensor to respond only at specific gas concentration levels. This mode is useful for alarms and on/off detection systems.
For more detailed monitoring, the analog output (AO) provides a continuous voltage signal proportional to gas concentration. This signal can be read using a microcontroller’s analog-to-digital converter (ADC). As pollution levels increase, the sensor’s resistance decreases, causing a corresponding change in output voltage. This method enables trend analysis and comparative air-quality measurements.
To estimate gas concentration in parts per million (PPM), calibration is required. The MQ-135 exhibits higher resistance in clean air and lower resistance in polluted environments. First, determine Ro, the sensor resistance in clean air or a known reference condition. Then calculate Rs, the sensor resistance during gas exposure using the formula:
Rs = (Vc / Vout − 1) × RL
Once the Rs/Ro ratio is obtained, it can be compared against the sensitivity curves provided in the MQ-135 datasheet to estimate the approximate PPM value of the target gas. While this method does not provide laboratory-grade accuracy, it is effective for relative measurements, trend monitoring, and air-quality analysis.