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.
Arduino read sensor data and then send to computer or cloud or show on small screen (LCD).
People like this design because it is cheap, easy and useful for DIY and environment watch.
It uses Arduino, MQ135 gas sensor, DHT11 temp & humidity sensor and OLED display.
Coding:
#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:
| Component | 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.
IC 7809 is voltage regulator and it changes high voltage to steady 9V.
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.
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.
DHT11 sensor connect to Arduino digital pin and it sends temp and humidity in set format.
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.
- Connect IC1 7809 to give steady 9V DC power to Arduino.
DHT11 Sensor:
- VCC connects to 5V on Arduino
- GND of DHT11 goes to GND on Arduino
- DATA goes to pin 2 on Arduino
MQ135 Gas Sensor:
- VCC connects to 5V on Arduino
- MQ135 gas sensor GND goes to GND on Arduino
- AOUT goes to A0 on Arduino
- DOUT is not used
OLED Display:
- VCC connects to 5V on Arduino
- OLED display GND connects to GND on Arduino
- SCL goes to A5 on Arduino
- SDA goes to A4 on Arduino
Conclusion:
This project for Arduino Based Air Quality Monitoring Circuit show how to check air quality using simple and cheap parts.
System can detect many gases and show data on screen.
It required more information can be added.
This circuit is low cost, easy to move, good for home, factory or environment use.
References:
Development of Arduino Based Air Quality Monitoring Systems for Measuring Gas Sensor
