What it is: The MQ-135 is a general air-quality sensor sensitive to CO2, ammonia, benzene, smoke and other pollutants. It's the popular "air quality index" hobby sensor.
How it works: A heated element whose resistance falls as pollutant concentration rises, read as an analog voltage on AO. This sketch shows a relative 0–100 air-quality index plus raw ADC (a real ppm figure needs calibration against clean air).
Wiring:
MQ-135 AO -> GPIO0
MQ-135 VCC -> 5V
MQ-135 GND -> GND
OLED VCC=3V3, GND=GND, SDA=GPIO4, SCL=GPIO5
VOLTAGE WARNING: divide AO to under 3.3V for the ESP32-C3 ADC.
Libraries: only "Adafruit SSD1306" and "Adafruit GFX Library".
On screen / Serial: relative air-quality level (0–100, higher = dirtier) and raw ADC. Breathe on it to see it climb.
Gotchas: Needs burn-in and warm-up. For calibrated CO2/ppm use a dedicated NDIR sensor like the MH-Z19 (tutorial 21) — the MQ-135 is a relative indicator.