The air purifier is an Arduino-based project designed to clean the surrounding air and maintain fresh air to breathe. It features an MQ135 air quality sensor that detects air quality. This sensor is easy to use, making it accessible for K-12 students. The detected values are displayed on an LCD screen. A DC fan continuously collects the surrounding air and passes it through for filtration. This project helps creative students better understand basic tinkering concepts.
Components used in this project are:
- Arduino UNO with cable
- MQ135 gas sensor
- Jumper Wires – Male to Male x 2
Male to Female x 7 - DC motor 5V
Featured Image:
Connection Pins with Arduino:
- MQ135 (VCC -> 5V, GND ->GND, A0 -> A3)
- DC fan (Green -> GND, Yellow-> Arduino Digital Pin 5)
- LCD I2C Display( VCC -> 5V, GND -> GND , SCL -> A5 , SDA ->A4)
CIrcuit Diagram:
Code:
// Install "LiquidCrystal I2C library by Marco Schwartz" from library manager
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
#define fan 5
#define sensor A3
void setup() {
Serial.begin(9600);
lcd.init(); // initialize the lcd
lcd.clear(); // Clear the lcd screen
lcd.backlight();
lcd.setCursor(2, 0);
lcd.print("Air Purifier");
pinMode(fan, OUTPUT);
digitalWrite(sensor, LOW);
}
void loop() {
int value = analogRead(sensor);
value = map(value, 0, 1023, 0, 100);
Serial.println("value");
digitalWrite(fan, HIGH);
lcd.clear();
lcd.setCursor(2, 0);
lcd.print("Air Quality: ");
lcd.print(value);
delay(100);
}