Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based IoT Indoor Air Quality Monitoring System with Wi-Fi and LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based IoT Indoor Air Quality Monitoring System with Wi-Fi and LCD Display

Circuit Documentation

Summary

The Integrated Humidity, Infrared, and Particulates (IHIP) System is an Internet of Things (IoT) based indoor air quality monitoring and controlling system. This circuit reads data from a DHT11 sensor, an IR sensor, and a PM2.5 air quality sensor. The data is displayed on an LCD and sent to an ESP8266 WiFi module for IoT-based monitoring. Additionally, the system controls a relay based on the sensor readings.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. DHT11 Humidity and Temperature Sensor

    • Description: Sensor for measuring humidity and temperature.
    • Pins: VDD, DATA, NULL, GND
  3. PM2.5 Air Quality Sensor and Breadboard Adapter Kit - PMS5003

    • Description: Sensor for measuring particulate matter (PM2.5) in the air.
    • Pins: VCC, GND, SET, RX, TX, RST
  4. IR Sensor

    • Description: Infrared sensor for detecting objects.
    • Pins: out, gnd, vcc
  5. ESP8266 ESP-201 WiFi Module

    • Description: WiFi module for IoT applications.
    • Pins: 3.3V, IO4, D3, D1, D0, CMD, CLK, D2, IO2, IO0, GND, IO5, T_OUT, RST, CHIP_EN, XPD, IO14, IO12, IO13, IO15, RX, TX
  6. Relay Module 5V-30V

    • Description: Relay module for switching high voltage devices.
    • Pins: common contact, normally open, normally closed, trigger, V-, V+
  7. Adafruit Standard LCD 16x2 White on Blue

    • Description: 16x2 character LCD display.
    • Pins: VSS, VDD, V0, RS, R/W, E, DB0, DB1, DB2, DB3, DB4, DB5, DB6, DB7, LED+, LED-

Wiring Details

Arduino UNO

DHT11 Humidity and Temperature Sensor

PM2.5 Air Quality Sensor and Breadboard Adapter Kit - PMS5003

IR Sensor

ESP8266 ESP-201 WiFi Module

Relay Module 5V-30V

Adafruit Standard LCD 16x2 White on Blue

Code Documentation

/*
 * IHIP (Integrated Humidity, Infrared, and Particulates System)
 * Internet of Things (IoT) - based Indoor Air Quality Monitoring and Controlling
 *
 * This Arduino sketch reads data from a DHT11 sensor, an IR sensor, and a PM2.5
 * air quality sensor. It displays the data on an LCD and sends it to an ESP8266
 * WiFi module for IoT-based monitoring. Additionally, it controls a relay based
 * on the sensor readings.
 */

#include <DHT.h>
#include <LiquidCrystal.h>

// Pin definitions
#define DHTPIN 13
#define DHTTYPE DHT11
#define IRPIN 11
#define RELAYPIN 10
#define LCD_RS 12
#define LCD_E 11
#define LCD_D4 5
#define LCD_D5 4
#define LCD_D6 3
#define LCD_D7 2

// Initialize DHT sensor
DHT dht(DHTPIN, DHTTYPE);

// Initialize LCD
LiquidCrystal lcd(LCD_RS, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7);

void setup() {
  // Start serial communication
  Serial.begin(9600);

  // Initialize DHT sensor
  dht.begin();

  // Initialize LCD
  lcd.begin(16, 2);
  lcd.print("IHIP System");

  // Initialize IR sensor pin
  pinMode(IRPIN, INPUT);

  // Initialize relay pin
  pinMode(RELAYPIN, OUTPUT);
  digitalWrite(RELAYPIN, LOW);
}

void loop() {
  // Read humidity and temperature from DHT11
  float humidity = dht.readHumidity();
  float temperature = dht.readTemperature();

  // Read IR sensor value
  int irValue = digitalRead(IRPIN);

  // Display data on LCD
  lcd.setCursor(0, 1);
  lcd.print("H:");
  lcd.print(humidity);
  lcd.print("% T:");
  lcd.print(temperature);
  lcd.print("C");

  // Send data to ESP8266
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.print("% Temperature: ");
  Serial.print(temperature);
  Serial.print("C IR: ");
  Serial.println(irValue);

  // Control relay based on IR sensor
  if (irValue == HIGH) {
    digitalWrite(RELAYPIN, HIGH);
  } else {
    digitalWrite(RELAYPIN, LOW);
  }

  // Wait for 2 seconds before next loop
  delay(2000);
}

This code initializes the DHT11 sensor, IR sensor, and LCD display. It reads the humidity and temperature from the DHT11 sensor, the IR sensor value, and displays the data on the LCD. The data is also sent to the ESP8266 WiFi module for IoT-based monitoring. The relay is controlled based on the IR sensor readings.