[go: up one dir, main page]

0% found this document useful (0 votes)
496 views12 pages

Room Environment Monitoring System

The Room Environment Monitoring System utilizes an Arduino microcontroller to monitor temperature, humidity, and air quality, displaying the data on a 16x2 LCD and triggering a buzzer alert when thresholds are exceeded. It employs sensors like the DHT11 for temperature and humidity and the MQ-2 for air quality, ensuring a safe indoor environment. This project highlights the importance of continuous monitoring and offers potential for upgrades such as wireless connectivity.

Uploaded by

engrabdullah342
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
496 views12 pages

Room Environment Monitoring System

The Room Environment Monitoring System utilizes an Arduino microcontroller to monitor temperature, humidity, and air quality, displaying the data on a 16x2 LCD and triggering a buzzer alert when thresholds are exceeded. It employs sensors like the DHT11 for temperature and humidity and the MQ-2 for air quality, ensuring a safe indoor environment. This project highlights the importance of continuous monitoring and offers potential for upgrades such as wireless connectivity.

Uploaded by

engrabdullah342
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Room Environment Monitoring System

Project Report

Project Overview
The Room Environment Monitoring System is designed to monitor temperature, humidity, and
air quality using an Arduino microcontroller. The system displays the readings on a 16x2 LCD
and triggers a buzzer alert when any parameter exceeds the defined threshold. This project is
essential for maintaining a safe and comfortable environment.

Introduction
In today's fast-paced and urbanized world, maintaining a healthy indoor environment has become
more important than ever. Indoor conditions such as temperature, humidity, and air quality
significantly influence human health, comfort, and productivity. Unregulated environmental
conditions may lead to discomfort, respiratory problems, and a decline in indoor air quality,
particularly in enclosed spaces such as homes, offices, classrooms, and hospitals. Therefore,
continuous monitoring of these parameters is essential.

The Room Environment Monitoring System addresses this need by utilizing modern electronic
components integrated with an Arduino microcontroller. It uses various sensors to collect real-
time data on temperature, humidity, and air quality. This information is then displayed on an
LCD screen for easy visibility. Additionally, the system is programmed to trigger an alarm using
a buzzer when any of the measured values exceed the pre-set safety thresholds, thereby
providing a quick warning to take necessary corrective actions.

This project not only showcases the application of embedded systems in environmental control
but also encourages users to understand the importance of monitoring their surroundings. With
potential for further upgrades such as wireless connectivity or mobile integration, this system
represents a scalable and affordable solution for enhancing indoor environmental safety.

Components Used
Arduino Board

The Arduino board is the central component of this monitoring system, responsible for
processing and controlling all sensor inputs and output devices. In this project, the Arduino Nano
is used due to its compact size and powerful features, making it ideal for embedded applications.

 Model: Arduino Nano


 Technical Details: Equipped with an ATmega328P microcontroller, it features 14 digital
input/output pins, 6 analog inputs, a 16 MHz clock speed, and operates on 5V DC.
 Function: The Arduino Nano acts as the brain of the system. It reads sensor data from
the DHT11 and MQ-2 sensors, evaluates whether the parameters fall within safe limits,
and activates the LCD and buzzer accordingly. Its versatility and ease of programming
make it highly suitable for small to medium-sized automation and monitoring projects.

DHT11 Sensor
The DHT11 is a basic, low-cost digital sensor that provides readings for both temperature and
humidity. It is widely used in various DIY and embedded applications due to its reliability and
simplicity. The sensor uses a capacitive humidity sensor and a thermistor to measure the
surrounding air and provides a digital signal on a single data pin, making it easy to interface with
microcontrollers like the Arduino.

 Technical Details: Temperature range: 0–50°C, Humidity range: 20–90% RH, Accuracy:
±2°C for temperature and ±5% RH for humidity.
 Function: The DHT11 sensor continuously monitors the ambient temperature and
relative humidity in the room. These readings are essential for ensuring that the
environment remains within comfortable and safe ranges. The data from the DHT11 is
sent to the Arduino for processing and display.

MQ-2 Gas Sensor


The MQ-2 gas sensor is a widely used sensor in environmental and industrial monitoring
projects. It is capable of detecting a variety of gases, including LPG, smoke, methane, carbon
monoxide, alcohol, propane, and hydrogen. The sensor outputs an analog voltage corresponding
to the concentration of gases in the air, which can be easily read by the analog input pins of the
Arduino.

 Technical Details: Detects LPG, smoke, alcohol, propane, hydrogen, methane, and
carbon monoxide. Operating voltage: 5V DC, analog output.
 Function: The MQ-2 sensor serves to monitor air quality by detecting the presence of
harmful gases in the room. It helps in identifying unsafe conditions that may arise from
gas leaks or accumulation of pollutants, enabling timely intervention through system
alerts.

6x2 LCD Display (Non-I2C)


The 16x2 LCD is a character display module that shows data in a 2-line format with up to 16
characters per line. It communicates with the Arduino using a parallel interface, requiring
multiple digital pins for data and control. Though it lacks the simplicity of an I2C module, it is
still widely used due to its affordability and ease of programming.

 Technical Details: 16 characters by 2 lines, parallel interface, operating voltage 5V.


 Function: This component is responsible for displaying real-time readings of
temperature, humidity, and air quality, providing a user-friendly interface for monitoring
the indoor environment.

Buzzer
A buzzer is an electronic sound component used to produce audio signals. In monitoring
systems, it serves as an alert mechanism to indicate that a certain parameter has exceeded its
acceptable limit. The buzzer is controlled by a digital output from the Arduino.

 Technical Details: Operating voltage: 3–12V, sound output: 85 dB.


 Function: The buzzer generates an audible alarm when the Arduino detects that the
temperature, humidity, or air quality has gone beyond safe thresholds. This immediate
alert mechanism helps in taking prompt corrective measures.

1. Power Adapter
o Technical Details: 9V DC output, 1A current rating.
o Function: Provides power to the circuit.
2. PCB Board
o Technical Details: Standard perfboard for mounting and connecting components.
o Function: Provides a stable platform for the circuit.
3. Wires and Connectors
o Technical Details: Copper wires with insulation, standard pin connectors.
o Function: Establishes connections between components.

Circuit Design and Wiring


 The DHT11 sensor is connected to the Arduino pin for temperature and humidity data.
 The MQ-2 sensor is connected to the analog pin to measure air quality.
 The 16x2 LCD is connected to the Arduino’s digital pins.
 The buzzer is connected to the output pin to sound alerts when thresholds are crossed.

Working Mechanism
1. The Arduino reads data from the DHT11 and MQ-2 sensors.
2. The data is displayed on the 16x2 LCD.
3. If the temperature, humidity, or air quality surpasses the threshold, the buzzer sounds an
alert.
4. The system continuously updates the readings and monitors the environment.

Complete code for "Room Environment Monitoring


System" project.
Your code has a small syntax error: the last delay(2000) statement is not followed by a semicolon,
and the closing brace } for loop() should be properly aligned. Here's the corrected version:

// Include the necessary libraries


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

// Define pins and constants


#define DHTPIN 8 // DHT11 data pin
#define DHTTYPE DHT11
#define MQ2PIN A0 // MQ-2 sensor analog pin
#define BUZZER 9 // Buzzer pin
#define RS 2
#define EN 3
#define D4 4
#define D5 5
#define D6 6
#define D7 7

// Threshold values
#define TEMP_MAX 30.0
#define HUM_MAX 80.0
#define AIR_QUALITY_MAX 150

// Initialize the DHT sensor and LCD


DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);

void setup() {
Serial.begin(9600);
dht.begin();
lcd.begin(16, 2);
pinMode(MQ2PIN, INPUT);
pinMode(BUZZER, OUTPUT);
lcd.setCursor(0, 0);
lcd.print("Room Monitor");
delay(2000);
}

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

// Read air quality from MQ-2 sensor


int airQuality = analogRead(MQ2PIN);

// Display data on LCD


lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temp: ");
lcd.print(temp);
lcd.print(" C");

lcd.setCursor(0, 1);
lcd.print("Hum: ");
lcd.print(humidity);
lcd.print("%");

delay(2000);

lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Air: ");
lcd.print(airQuality);

// Trigger buzzer alert if any value exceeds the threshold


if (temp > TEMP_MAX || humidity > HUM_MAX || airQuality > AIR_QUALITY_MAX) {
digitalWrite(BUZZER, HIGH);
lcd.setCursor(0, 1);
lcd.print("Alert: High Values!");
} else {
digitalWrite(BUZZER, LOW);
}

delay(2000); // <--
}

Let me know if you also want to add serial output or modify the alert message!

Here's an explanation of the code:

Library Inclusion
#include <LiquidCrystal.h>
#include "DHT.h"

 The LiquidCrystal library is used to control the 16x2 LCD display.


 The DHT.h library is used for interfacing with the DHT11 temperature and humidity sensor.

Pin and Constant Definitions


#define DHTPIN 8
#define DHTTYPE DHT11
#define MQ2PIN A0
#define BUZZER 9
#define RS 2
#define EN 3
#define D4 4
#define D5 5
#define D6 6
#define D7 7

 DHTPIN is the pin where the DHT11 sensor is connected.


 DHTTYPE specifies the DHT sensor type (DHT11).
 MQ2PIN is the analog pin where the MQ-2 gas sensor is connected.
 BUZZER is the pin for the buzzer.
 RS, EN, D4, D5, D6, D7 are the pins connected to the LCD.

Threshold Values
#define TEMP_MAX 30.0
#define HUM_MAX 80.0
#define AIR_QUALITY_MAX 150

 These constants define the maximum threshold limits for temperature, humidity, and air quality.
If any value exceeds these limits, the buzzer will be activated.

Initialize the Sensor and LCD


DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);

 Initializes the DHT sensor and LCD with the defined pins.

Setup Function
void setup() {
Serial.begin(9600);
dht.begin();
lcd.begin(16, 2);
pinMode(MQ2PIN, INPUT);
pinMode(BUZZER, OUTPUT);
lcd.setCursor(0, 0);
lcd.print("Room Monitor");
delay(2000);
}

 Starts the serial communication for debugging.


 Initializes the DHT sensor and sets the LCD dimensions (16x2).
 Sets the MQ-2 sensor pin as input and the buzzer pin as output.
 Displays "Room Monitor" on the LCD for 2 seconds.

Loop Function
void loop() {

This function continuously runs the logic to monitor and display environmental data.
Read Sensor Data
float temp = dht.readTemperature();
float humidity = dht.readHumidity();
int airQuality = analogRead(MQ2PIN);

 Reads temperature and humidity from the DHT11 sensor.


 Reads air quality (gas concentration) from the MQ-2 sensor.

Display Temperature and Humidity


lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temp: ");
lcd.print(temp);
lcd.print(" C");

lcd.setCursor(0, 1);
lcd.print("Hum: ");
lcd.print(humidity);
lcd.print("%");

delay(2000);

 Clears the LCD.


 Displays the temperature on the first row and humidity on the second row.
 Waits for 2 seconds.

Display Air Quality


lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Air: ");
lcd.print(airQuality);

 Clears the LCD and displays the air quality reading.

Buzzer Alert Condition


if (temp > TEMP_MAX || humidity > HUM_MAX || airQuality > AIR_QUALITY_MAX) {
digitalWrite(BUZZER, HIGH);
lcd.setCursor(0, 1);
lcd.print("Alert: High Values!");
} else {
digitalWrite(BUZZER, LOW);
}
 If any of the readings exceed the defined threshold values, the buzzer is activated, and "Alert:
High Values!" is shown on the LCD.
 Otherwise, the buzzer remains off.

Delay for Stability


delay(2000);
}

 Adds a 2-second delay before the next reading to stabilize the system and avoid rapid updates.

Overall Working:
1. Continuously monitors temperature, humidity, and air quality.
2. Displays the readings on the LCD screen.
3. If any reading exceeds the set threshold, the buzzer sounds an alarm and displays an alert
message.

Conclusion
The Room Environment Monitoring System effectively ensures real-time monitoring and alerts for
temperature, humidity, and air quality, providing essential data to maintain a safe and comfortable
environment. By using affordable and reliable sensors like the DHT11 for temperature and humidity, and
the MQ-2 for air quality, this system offers an efficient solution for both residential and industrial
settings. The Arduino microcontroller processes data, and the 16x2 LCD display provides clear readings.
A buzzer alarm alerts users when parameters exceed preset safety limits, enabling quick corrective action.
This system is a valuable tool for improving indoor air quality, preventing hazards, and enhancing overall
comfort, making it suitable for a wide range of applications in diverse environments.

You might also like