IOT BASED AIR QUALITY MONITORING SYSTEM

IOT BASED AIR QUALITY MONITORING SYSETEM USING ESP32,MQ135,DHT11



                        Air Quality is very important in Human life. In an era of growing industrialization ,urbanization and increased environmental health awareness is need to precisely quantify air contaminants has become critical .Poor air quality can have adverse effect on human health, ecosystem and the environment. Air Quality goes down when the enough amount of harmful gases present in air .In order to analyze  an IOT based Air Quality Monitoring system is developed .


REQUIRED COMPONENT:


CIRCUIT DIAGRAM AND EXPLANATION:

                         The DATA Pin of DHT11 sensor is connected to D4 pin in ESP32 and the A0 pin of the MQ135 sensor is connected to D34 pin in ESP32 .The 3V3 and GND pin of ESP32 is connected to the VCC and GND  pin of DHT11 and MQ135 sensor .The data from these Senor is sent to the Blynk app  through ESP32 .And the data is monitor with the help of Blynk app. 

BLYNK SETUP:

  • Step 1: create an account  in Blynk.

  • Step 2: Create new template.

  • Step 3:Choose the DataStream and create 3 virtual pins.



  • Step 4:Click the web dashboard and place the widgets.Then save it


  • Step 5:Click the search icon and Select the new device .Then choose the template and click create.


  • Step 6:Click the Device and then choose the device info .Copy the BLYNK id, BLYNK template, BLYNK Auth_token and paste it in the code.
  • Step 7:click the dashboard and monitor the data.


CODE:

#include <DHT.h>
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "xxxxxxxxxxxxxx"
#define BLYNK_TEMPLATE_NAME "xxxxxx"
#define BLYNK_AUTH_TOKEN "xxxxxxx"
#define mqsensor 34
#define DHTPIN 4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>


char ssid[] = "Your Wifi-name";
char pass[] = "Your Wifi-password";

void setup()
{
  pinMode(mqsensor,INPUT);

  Serial.begin(9600);

  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  dht.begin();
}

void loop()
{
  Blynk.run();
  delay(250);
  float humi  = dht.readHumidity();
  Serial.print("Humidity: ");
  Serial.println(humi);
  Serial.print("%");
  float tempC = dht.readTemperature();
  Serial.print("Temperature");
  Serial.println(tempC);
  Serial.print ("C");
  int gas=analogRead(mqsensor);
  Serial.print("GAS level");
  Serial.println(gas);
  Serial.print("");
  delay(200);
  Blynk.virtualWrite(V0,gas);
  Blynk.virtualWrite(V1,humi);
  Blynk.virtualWrite(V2,tempC);
  delay(300);
}


  • Upload this code to the ESP32 After changing the  BLYNK id, BLYNK template, BLYNK Auth_token ,wi-fi name ,wi-fi password in the code.
  • After this you can able to see the data in Blynk app.

CONCLUSION:

            By this project We can able to monitor the humidity, Temperature, Gas in the environment in the BLNYK IOT app.

Comments