Skip to content
A

air-quality

Interfacing MQ 135 with Arduino Uno

What is the MQ 135?

An air-quality sensor commonly used in indoor air monitors, capable of sensing CO2, ammonia, benzene, and smoke. The MQ-135 is a metal-oxide semiconductor gas sensor whose surface resistance shifts in response to a broad mix of harmful gases and vapors, producing a single combined analog signal that rises with overall air-quality degradation — a popular, low-cost way to add general indoor air-quality monitoring to a home automation or environmental logging project, though it reports relative pollutant load rather than any single gas's precise concentration.

Specifications

Sensor typeMQ-135 metal-oxide semiconductor (MOS) gas sensor, tuned for air-quality/pollutant gases
Operating voltage5 V DC
Detectable gasesNH3 (ammonia), NOx, benzene, CO2, alcohol vapor, smoke — broad-spectrum air-quality sensing rather than a single specific gas
Detection range~10-300 ppm depending on the target gas
Warm-up timeRequires several minutes of heater warm-up (some sources recommend a longer burn-in period) before readings stabilize
OutputAnalog voltage proportional to overall detected gas concentration, plus a digital threshold output (DO) on breakout modules
Sensitivity adjustmentOnboard potentiometer sets the digital-output trigger threshold
Interface1 analog pin (AO) + 1 digital pin (DO, breakout-dependent)

MQ 135 Pinout

PinNameDescription
1VCCPower, 5V DC (powers both the internal heater and sensing circuit)
2GNDGround
3AOAnalog output — voltage proportional to combined air-quality gas concentration
4DODigital output — threshold-triggered HIGH/LOW based on the onboard potentiometer setting

Allow several minutes of heater warm-up before trusting readings, and treat the analog output as a general relative air-quality trend rather than a precise ppm reading for any single gas, since the sensor responds to a broad mix of gases simultaneously; results also drift with ambient humidity and temperature over time.

Setting Up MQ 135 with Arduino Uno

Library

No library required — this sensor outputs a plain analog voltage

Wiring

Component pinArduino Uno pinNote
VCC5VMQ-135's heating element draws ~150mA — fine on Uno's 5V pin
GNDGND
AOUTA0Analog output — raw ratio, not a calibrated ppm value

Example code

C++

Needs a 24–48 hour burn-in before readings stabilize, and the raw analog value is not ppm — converting to an actual gas concentration requires calibrating against a known-clean-air baseline (RZERO) per the datasheet's resistance curve. Treat the raw number as relative air-quality trend data unless you do that calibration.

Related Guides & Projects