Difficulty Level Medium Project Duration 1-2 Days Project Expenditure Rs. 3000 Project Scale Semester Projects Components Required Arduino UNO x 1 (Rs. 2000)Jumper Wires (Generic) x 10 (Rs. 40)Ultrasonic Sensor (HC-SR-04) x 1 (Rs. 200)SG-90 Servo Motor x 1 (Rs. 400) Softwares Required Arduino IDE (Free) Sale! Add to basket Ultrasonic Security System Project Kit ₨ 3,500 ₨ 3,000 Project Description DIY Arduino air quality monitor which can measure surrounding air quality also shows temperature and humidity in your room. Many times we feel very weak while waking up from the bed even after getting a good sleep at night. This sometimes happens because of the poor air quality in the closed room at night. This is a low cost Air Quality Monitor which can monitor the air quality of a room using MQ135 air quality sensor. It also measure the room temperature and humidity using DHT11 and shows the data on a OLED display. It is a fun little project and very helpful too. Wiring Arduino D2 to DHT11 out Arduino A0 to MQ135 Ao Arduino A5 to Oled SCL Arduino A4 to Oled SDA Arduino Code In the coding part you will need to install some library to run the code Adafruit_SSD1306.h Adafruit_GFX.h DHT.h there is two main function in the code sendSensor() and air_sensor() . In air_sensor() function it read the analog value from the Air quality sensor gasLevel = analogRead(sensor); and define the quality for that corresponding gasLevel . And the sendSensor() function measure the temperature and humidity data with dht library and display it on the oled.In the air_sensor() function you might need to celebrate your gasLevel value for your sensor. For that power 5V to the mq135 sensor and put it on a clean environment for at least 24 hour before using it. it is (burning) necessary for this kind of sensor because the sensor comes polluted. so burning helps it to clean itself and gives more accurate result. then connect the sensor to your circuit and go outside with it and tune the right value for your place. Copy Text Copied Use a different Browser #include #include #include #include #include #include #include #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels #define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); #define sensor A0 #define DHTPIN 2 // Digital pin 2 #define DHTTYPE DHT11 // DHT 11 int gasLevel = 0; //int variable for gas level String quality =""; DHT dht(DHTPIN, DHTTYPE); void sendSensor() { float h = dht.readHumidity(); float t = dht.readTemperature(); if (isnan(h) || isnan(t)) { Serial.println("Failed to read from DHT sensor!"); return; } display.setTextColor(WHITE); display.setTextSize(1); display.setFont(); display.setCursor(0, 43); display.println("Temp :"); display.setCursor(80, 43); display.println(t); display.setCursor(114, 43); display.println("C"); display.setCursor(0, 56); display.println("RH :"); display.setCursor(80, 56); display.println(h); display.setCursor(114, 56); display.println("%"); } void air_sensor() { gasLevel = analogRead(sensor); if(gasLevel181 && gasLevel225 && gasLevel300 && gasLevel<350){ quality = "ur dead!"; } else{ quality = " Toxic"; } display.setTextColor(WHITE); display.setTextSize(1); display.setCursor(1,5); display.setFont(); display.println("Air Quality:"); display.setTextSize(1); display.setCursor(20,23); display.setFont(&FreeMonoOblique9pt7b); display.println(quality); } void setup() { Serial.begin(9600); pinMode(sensor,INPUT); dht.begin(); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c)) { // Address 0x3D for 128x64 Serial.println(F("SSD1306 allocation failed")); } display.clearDisplay(); display.setTextColor(WHITE); display.setTextSize(2); display.setCursor(50, 0); display.println("Air"); display.setTextSize(1); display.setCursor(23, 20); display.println("Qulaity monitor"); display.display(); delay(1200); display.clearDisplay(); display.setTextSize(2); display.setCursor(20, 20); display.println("BY Abid"); display.display(); delay(1000); display.clearDisplay(); } void loop() { display.clearDisplay(); air_sensor(); sendSensor(); display.display(); }