Skip to main content

AIR POLLUTION DETECTOR




Corona virus (Covid 19) is spreading all around the world. Polluted air can cause a lot of health diseases. But how to find out if the air around us is polluted or not. This is the simple project that detects air pollution and returns analog value. This data can be further used to keep ourselves alert and take precaution from polluted air.



CIRCUIT DIAGRAM :




CODE :



DESCRIPTION :


ARDUINO SETTINGS :

Most of the code is commented. Some of the important points to highlight

  1. In the code we need to change the gateway according to our network.

  2. Simple method - (For windows) 

    1. Open command prompt - type “ipconfig”

    2. Look for “default gateway”. A set of four numbers will be displayed. In my case its 192.168.xxx.1

    3. Note this “xxx” number, goto line in the code where “staticIP” is defined and replace the 3rd number  with this number you just found.   

    4. Ex: default gateway is 192. 169. 255 .1

So in my code  -

IPAddress staticIP (192, 168, 225, 81); //ESP static ip

IPAddress gateway (192, 168, 225, 1);


  1. Next step is changing SSID and password

    1. Replace  YOUR_SSID in this line - const char* ssid = "YOUR_SSID" with your wifi name.

    2. Replace YOUR_WIFI_PASSWORD in the line const char* password = "YOUR_WIFI_PASSWORD"; with your wifi password.


ARDUINO APP SETTINGS :

  1. To test the project , open the android app “LINK HERE” , type IP address of the device and same gateway .

  2. Now type “CHECK_AIR” keyword into send section and hit send.

In the receive section of the app you will be able to see the response from the arduino device.