Arduino Based Air Quality Monitoring Circuit, check bad stuff in air like CO2, VOCs and PM, it uses Arduino microcontroller and many sensors to check air quality.
Furthermore, Arduino read sensor data and then send to computer or cloud or show on small screen (LCD).
Also, people like this design because it is cheap, easy and useful for DIY and environment watch and it uses Arduino, MQ135 gas sensor, DHT11 temp & humidity sensor and OLED display.
Arduino Code:
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define DHT11_PIN 2
#define MQ135_PIN A0
#define OLED_ADDRESS 0x3C
Adafruit_SSD1306 display(128, 64);
void setup() {
Serial.begin(9600);
display.begin(SSD1306_128_64);
display.clearDisplay();
display.display();
}
void loop() {
// Read gas sensor data
int gasSensorValue = analogRead(MQ135_PIN);
float gasConcentration = map(gasSensorValue, 0, 1023, 0, 1000);
// Read temperature and humidity data
float temperature, humidity;
dht11.read(temperature, humidity);
// Display the results on the OLED
display.clearDisplay();
display.setCursor(0, 0);
display.print("Gas Concentration:");
display.print(gasConcentration);
display.println(" ppm");
display.print("Temperature:");
display.print(temperature);
display.println(" °C");
display.print("Humidity:");
display.print(humidity);
display.println(" %");
display.display();
delay(1000);
}
Code Explanation:
- Code use Adafruit_GFX, Adafruit_SSD1306 and Wire libraries for OLED and I2C work.
- Pins and I2C address set using DHT11_PIN, MQ135_PIN and OLED_ADDRESS.
- In setup(), OLED screen get ready, cleared and serial start.
- In loop() gas sensor read from analog pin and changed to gas level.
- DHT11 read temperature and humidity.
- OLED screen show temp, humidity and gas level.
- Code wait 1 second (1000 ms) for next reading and update.
Circuit Working:

Parts List:
| Components | Quantity |
|---|---|
| Arduino UNO board | 1 |
| IC 7809 (Voltage Regulator) | 1 |
| MQ135 gas sensor (for detecting various gases) | 1 |
| DHT11 (Temperature and Humidity Sensor) | 1 |
| OLED display (for visual output) | 1 |
A 5V DC power source give power to Arduino and all parts and IC 7809 is voltage regulator and it changes high voltage to steady 9V; also it help when input voltage is not stable and gives safe power to circuit.
Arduino gives 5V but sometimes gas sensor or other parts need more and then IC 7809 give constant 9V to those parts for good working.
MQ135 gas sensor connect to Arduino analog pin and sensor resistance changes with gas in air and DHT11 sensor connect to Arduino digital pin and it sends temp and humidity in set format.
Finally, OLED display connect to Arduino I2C pins and it show temp, humidity and gas level.
How to Build:
To build a Arduino Based Air Quality Monitoring Circuit we need to follow the below mentioned steps for connections:
- First, collect all parts as shown in circuit diagram.
- Next, connect IC1 7809 to give steady 9V DC power to Arduino.
DHT11 Sensor:
- Now VCC pin connects to 5V on Arduino, GND pin of DHT11 goes to GND pin on Arduino and then DATA goes to pin 2 on Arduino
MQ135 Gas Sensor:
- Connect the VCC pin of the MQ135 gas sensor to the 5V pin of the Arduino, connect the GND pin of the MQ135 to the GND pin of the Arduino, connect the AOUT pin to the A0 analog input pin of the Arduino and do not use the DOUT pin in this circuit.
OLED Display:
- After that, VCC pin connects to 5V on Arduino, OLED pin display, GND pin connects to GND on Arduino, SCL pin goes to A5 on Arduino and then SDA pin goes to A4 on Arduino
Conclusion:
To conclude, this project for Arduino Based Air Quality Monitoring Circuit show how to check air quality using simple and cheap parts.
Moreover, the system detects many gases and displays the data on the screen and we can add more information in the future if needed.
Also, this circuit costs less, moves easily and works well for homes, factories and environmental monitoring applications.