Waveshare MQ-135 Gas Sensor for Air Quality and Harmful Gas Detection The Waveshare MQ-135 Gas Sensor is an air-quality module for detecting harmful gases and smoke-related pollution trends. It uses an MQ-135 sensing element that is sensitive to ammonia, nitrogen oxides, alcohols, aromatic compounds, sulfides, and fumes. The module provides AOUT analog output for relative gas concentration trends and DOUT digital output through an LM393 comparator for threshold alarms. Waveshare documents 2.5 V to 5.0 V power, 40.0 x 21.0 mm size, and Arduino/Pico examples on the Waveshare MQ-135 wiki and Waveshare product page. MQ sensors require warm-up and calibration for meaningful measurements. Treat this module as a gas trend and alarm prototype sensor, not a certified safety detector. Technical Specifications Parameter Value Brand / SKU Waveshare 9528 Main sensor MQ-135 gas sensing element Sensitive gases Ammonia, nitrogen oxides, alcohols, aromatic compounds, sulfides, fumes Gas sensing material Tin dioxide / SnO2 class sensing material Main circuit LM393 comparator Power supply 2.5 V to 5.0 V Outputs AOUT analog data output, DOUT digital data output Sensitivity adjustment Onboard potentiometer Dimension 40.0 x 21.0 mm Mounting holes 2.0 mm Warm-up note Preheat before stable readings; Waveshare notes about one minute for demo use Development support Arduino UNO, Raspberry Pi Pico, STM32 examples Board Layout & Label Guide MQ-135 sensing can: Heated gas sensing element; it becomes warm during operation. AOUT pin: Analog voltage output that rises with detected gas concentration trend. DOUT pin: Digital threshold output from the comparator. GND pin: Power ground. VCC pin: 2.5 V to 5.0 V power input. Potentiometer: Adjusts the DOUT threshold. Signal LED: Indicates threshold output status. Application Scenarios 1. Arduino Analog Gas Trend Read AOUT from the MQ-135 module and print a relative air-quality trend after warm-up. const int MQ135_AOUT = A0; void setup() { Serial.begin(115200); } void loop() { int raw = analogRead(MQ135_AOUT); Serial.print("mq135_raw="); Serial.println(raw); delay(1000); } 2. Digital Gas Alarm Use the LM393 threshold output to drive an alarm when the onboard potentiometer threshold is crossed. const int MQ135_DOUT = 2; const int ALARM_PIN = 8; void setup() { pinMode(MQ135_DOUT, INPUT); pinMode(ALARM_PIN, OUTPUT); } void loop() { bool alarm = digitalRead(MQ135_DOUT) == LOW; digitalWrite(ALARM_PIN, alarm ? HIGH : LOW); } 3. Raspberry Pi Pico MicroPython Readout Read the analog output on GP26/ADC0 and the digital threshold output on GP22 with MicroPython. from machine import ADC, Pin from time import sleep gas = ADC(26) threshold = Pin(22, Pin.IN) while True: raw = gas.read_u16() alarm = threshold.value() == 0 print("mq135_raw=", raw, "alarm=", alarm) sleep(1) Packing List 1 x Waveshare MQ-135 Gas Sensor 1 x 4-pin custom connector jumper wire FAQ Q: Does MQ-135 measure CO2 directly?A: No. It responds to multiple gases and is best used as a relative air-quality trend sensor unless carefully calibrated. Q: Why does the sensor get warm?A: MQ sensors use a heated sensing element, so warmth during operation is normal. Q: How long should it warm up?A: Allow warm-up before using readings; Waveshare demo guidance notes about one minute, while calibration workflows can require longer stabilization. Q: Can it work with Raspberry Pi Pico?A: Yes. Waveshare documents AOUT to GP26 and DOUT to GP22 in Pico examples. Q: Can it work with Arduino UNO?A: Yes. Waveshare documents AOUT to A0 and DOUT to D2 in Arduino examples. Q: Is it a certified safety alarm?A: No. It is a development sensor module, not a certified life-safety detector. Q: What is the difference between AOUT and DOUT?A: AOUT is a relative analog trend; DOUT is a comparator threshold output adjusted by the potentiometer. Q: How should I calibrate it?A: Measure baseline in clean air, allow warm-up, and compare readings under controlled target conditions.