The MQ-135 gas sensor is widely used for air quality monitoring. It can detect harmful gases such as NH₃, NOx, alcohol, benzene, smoke, and CO₂. In this project, we interface the MQ-135 with an Arduino Uno to measure air quality levels and display the readings on the Serial Monitor.
This project is suitable for:
- Beginners learning sensor interfacing
- Environmental monitoring demos
- IoT and smart city prototypes
The MQ-135 contains a SnO₂ (Tin Oxide) sensing element. When exposed to polluted air, its resistance changes.The Arduino reads this resistance change as an analog voltage, which corresponds to air quality levels.
Higher sensor values indicate poorer air quality.
Arduino code
#define MQ135_PIN A0
void setup() {
Serial.begin(9600);
Serial.println("MQ-135 Air Quality Monitoring");
}
void loop() {
int airQualityValue = analogRead(MQ135_PIN);
Serial.print("Air Quality Value: ");
Serial.println(airQualityValue);
delay(1000);
}Output Observation- Open Serial Monitor
- Set baud rate to 9600
- Observe real-time air quality values
- Allow 24–48 hours of burn-in time for accurate readings
- Avoid touching the sensor heating element
- Sensor readings are relative, not absolute ppm (without calibration)
- Indoor air quality monitoring
- Smart home ventilation systems
- Pollution detection projects
- IoT-based environmental monitoring
This project demonstrates how easily the MQ-135 sensor can be integrated with Arduino to monitor air quality. It forms a strong foundation for more advanced IoT and environmental monitoring systems.


_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)







Comments