TechieYan Technologies

Air Quality Monitoring System

air quality monitoring system using arduino by TechieYan Technologies


Growing concerns have been raised about how machines’ and industries’ daily emissions of gaseous and particle pollution affect people’s health and the environment. The highly industrialized zones have seen a noticeable rise in mortality as a result of this influence. monitoring is therefore necessary. Due to the increase of vehicles on the road today, as well as the eras of industrialization and urbanization, air pollution has emerged as one of the major problems. This increase in contamination has detrimental effects on prosperity. For a safer future, improving air quality and raising public awareness is crucial, which prompted governments worldwide to invest large sums of money in developing policies and strategizing solutions. The objective of this air quality monitor project is to develop an air quality monitoring system. Any physical, biological, or chemical change in the air or in the environment  is referred to as air pollution. Air pollution not only pollutes the air but also changes the climatic conditions, which leads to global warming. In this project, we are going to make an Arduino-based system that will monitor the air quality. Compared to the existing system, the proposed system is more reliable and cost-effective. With the help of sensors, we can check the number of pollutants present in the air and can give an alert if the quality of the air worsens.


One of the most prevalent and important challenges in the globe is air pollution. Air pollution is referred to as the release of air pollutants into the air, perhaps unwanted particles into the air. As per the stats provided by the World Health Organisation (WHO), nearly 7 million people die because of air pollution. The burning of fossil fuels, industrial emissions, open burning of garbage, construction, and emissions, etc. are some of the primary reasons for air pollution. The atmosphere’s concentration of carbon dioxide and methane increases the temperature of the planet. As a result of air pollution, a person may have serious health problems as well as chronic illnesses such as heart disease, lung cancer, emphysema, asthma, lung cancer, ventricular hypertrophy, Alzheimer’s and Parkinson’s diseases, psychological disorders, and low birth weight.. As an individual, one can reduce the effect of air pollution and can save the environment by implementing and directing their day-to-day life. By using public transportation, replacing fans instead of using air conditioners(as ACs use lots of energy and emit HFCs which are not good for the environment), avoiding using crackers, etc., one can reduce unwanted particles(pollutants) suspended in the air.

Components Required

Hardware Requirements

  • Arduino Uno : Arduino Uno is a microcontroller from the Arduino Family. It was developed by Arduino. cc and is based on the Microchip ATmega328P microcontroller. Uno has 20 I/O pins, 6 are analog and 14 are digital pins.
air quality monitoring system Arduino

For more details,  pinout and datasheet, you can visit :

  • DHT sensor: DHT sensor is used to measure the temperature and humidity. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air.
  • Gas sensor(MQ-135): it is a low-cost application that is used for detecting smoke and toxic gases.
  • Red LED: LED stands for the light-emitting diode. LED lighting products produce red light.
  • Green LED: LED lighting products produce green light.
  • Buzzer: An Audio Signalling Device. Buzzers can be mechanical, electromechanical, or piezoelectric. It produces an alarming sound when triggered. Used in various applications like Game buzzers, Alarm Buzzers, Trains, etc.
  • LCD: LCD (Liquid Crystal Display) is a type of flat panel display used to print values.

Software Requirements

  • Arduino Ide : Arduino IDE (Integrated development environment) is software used to dump the program into boards. Arduino- IDE’s major use is to build electronics-related projects. Arduino is an open-source platform simple and easy-to-understand platform for coding.


Block diagram

In the following block diagram DHT sensor and gas sensor are the input devices. Buzzer, LCD, and red LED are the output devices. Arduino Uno is the controller which is interfaced with input and output devices.

air quality monitorind system block diagram

Flow Chart

A flowchart is a diagram that shows a process’ individual steps in their proper order, similarly, the following flowchart tells about the steps involved in the project and the sequential flow of the code also. So as it starts, first, it measures the gas values present in the air. if the sensor’s value is greater than the given condition then turn on the buzzer, and LED, or else it will be turned off.  

air quality monitoring system flow chart

*website used to make Flow Chart and Block Diagram :

Pin Connections


DHT11 has 3 pins GND, VCC, and IN. where GND is connected to the GND of the Arduino Uno.VCC is connected to the 6th pin of the Arduino Uno. IN is connected to the 7th pin of the Arduino Uno.

DHT11 pin connection to arduino for air quality checker device

MQ135 sensor

MQ135 sensor has 4 pins VCC, GND, analog pin, and digital pin, where GND is connected to GND of Arduino UNO. VCC is connected to 5V of the Arduino Uno. The digital pin is connected to the D2 of the Arduino Uno. A0 is connected to the A0 pin of the Arduino UNO.

air quality checker MQ pin connections to arduino


The LCD has 16 pins. VSS is connected to the GND of the Arduino Uno.VCC is connected to the VIN of the Arduino Uno.VEE is connected to the potentiometer of the Arduino Uno.RS is connected to the 13th pin of the Arduino Uno.R/W is connected to the GND of the Arduino Uno.E is connected to the 12th pin of the Arduino Uno.DB4is connected to the A2 pin of the Arduino Uno.DB5 is connected to the A3pin  of the Arduino Uno.DB6 is connected toA4 of the Arduino Uno.DB7 is connected toA5 of the Arduino Uno.LED+ve is connected to the Vin of the Arduino Uno. LED-ve is connected to the GND of the Arduino Uno.

Air quality checker LCD pin connections to Arduino


Potentiometer has 3 pins GND, VCC, and output. where Pin1 is connected to the 5V of the Arduino Uno. Pin2 is Connected to LCD VEE. Pin 3 is connected to the GND of the Arduino Uno.


potentio meter pin connections to Arduino for air quality checker

RGB Led has 3 pins GND, VCC, and IN. where GND is connected to the GND of the Arduino  Nano. VCC is connected to the 8th pin of the Arduino  Nano. IN is connected to the 10th pin of the Arduino  Nano.

air quality checker LED pin connections

Circuit diagram

Note: make sure to take proper precautions while connecting the components.

air quality monitoring system circuit diagram


The DTH sensor measures the temperature and humidity. Gas Sensor detects toxic gases. if the values are greater than the given range then the buzzer and led will be turned on else it remains off.


Here, we developed an air quality monitoring system. that will monitor the quality of air. It also alerts if the value goes above a certain limit. In the future, we can connect this to IoT so that we can get real-time data and alert the concerned person through iot.

Working Code

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include <DHT.h>

#define LCD_I2C_ADDRESS 0x3f 
#define LCD_DISP_COLS   16
#define LCD_DISP_ROWS   2

#define DHTPIN 2                                                             // Digital pin 2
#define DHTTYPE DHT11                                                        // DHT 11
#define Buzzer 8                                                             //buzzer pin connecetd to pin 8 of Arduino Nano 
#define LED 13                                                               //LED pin connecetd to pin 9 of Arduino Nano 


int gasLevel = 0;        
String quality ="";

void sendSensor()
  float h = dht.readHumidity();
  float t = dht.readTemperature();

  if (isnan(h) || isnan(t)) {
  Serial.println("Failed to read from DHT sensor!");
  digitalWrite ( LED , LOW );     // turns the LED on
  digitalWrite(Buzzer, LOW);       // turns the buzzer on  
lcd.setCursor (0,0);
lcd.print("Temp: ");
lcd.setCursor (12,0);
lcd.setCursor (0,1);
lcd.print("RH  : ");
lcd.setCursor (12,1);

void air_sensor()
  gasLevel = analogRead(A0);

    quality = "  GOOD!";
    digitalWrite ( LED , LOW );     // turns the LED on
    digitalWrite(Buzzer, LOW);       // turns the buzzer on  
  else if (gasLevel >182 && gasLevel<225){
    quality = "  Poor!";
    digitalWrite ( LED , HIGH );     // turns the LED on
    digitalWrite(Buzzer, HIGH );       // turns the buzzer on  
lcd.setCursor (0,0);
lcd.print("Air Quality  ");
lcd.setCursor (3,1);

void setup() {
  lcd.begin(16, 2);

  lcd.setCursor (0,0);                  
  lcd.print("                ");
  lcd.setCursor (0,1);
  lcd.print("                ");
  lcd.setCursor (0,0);
  lcd.print("  AIR QUALITY  ");
  lcd.setCursor (0,1);
  lcd.print("    MONITOR   ");

void loop() {

If You Face Any Issue Feel Free To Contact us Any Time.

+91 7075575787