Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 27

CHAPTER ONE

1.0 INTRODUCTION

In today's fast paced world, it is essential to monitor environmental conditions and security

within our living spaces. This project addresses this need by creating an innovative WhatsApp

based alert system that can monitor room temperature, humidity levels, and motion status. It

ensures users are well informed about their surroundings, offering convenience, peace of mind,

and potentially contributing to energy efficiency.

In today's interconnected world, the fusion of technology and convenience has revolutionized the

way we interact with our living spaces. From smart thermostats to security cameras, our homes

and workplaces have become increasingly intelligent and responsive.

Imagine having the ability to effortlessly oversee and manage the conditions within your home or

office space, all while staying connected through a ubiquitous messaging platform like

WhatsApp. This is precisely what the WhatsApp-Based Room Monitoring System aims to

achieve. It addresses the pressing need for real-time awareness and control over essential

environmental factors—room temperature, humidity levels, and motion status.

1.2 SCOPE OF THE PROJECT

The primary focus of the study is on monitoring room temperature, humidity, and motion status.

This includes selecting appropriate sensors, data collection methods, and analysis techniques to

ensure accurate and reliable measurements. design and implementation of the alerting

mechanism, including setting threshold values and defining alert conditions.


Study involves selecting, configuring, and integrating hardware components, such as temperature

and humidity sensors, motion sensors, microcontrollers (e.g., Raspberry Pi), and power supply

solutions.

The development of software modules is essential for data acquisition, processing, and

WhatsApp integration. The system relies on internet connectivity for WhatsApp message

delivery which may include Wi-Fi or Ethernet options.

The integration with WhatsApp, whether through the WhatsApp API or a WhatsApp-enabled

bot, is a key aspect of the study. Rigorous testing is essential to validate the system's accuracy,

reliability, and responsiveness.

1.3 STATEMENT OF PROBLEM

1. Inadequate Environmental Monitoring: A significant issue lies in the lack of real-time

awareness of environmental conditions within indoor spaces.

2. Energy Wastage: The ineffective control of heating, cooling, and humidity management

systems can result in excessive energy consumption and elevated utility costs.

3. Limited Access to Monitoring Data: Existing monitoring solutions often lack user-friendly

interfaces for accessing and comprehending environmental data.

4 . Absence of Remote Accessibility: Current systems may not offer remote access or alerts,

limiting users' capacity to respond to changing environmental conditions when they are away

from their premises.


1.4 AIMS AND OBJECTIVES

The primary goal of this system is to empower individuals with the capability to monitor and

react to changes in their living or working environment promptly. Its core objectives include:

1. Real-Time Monitoring: Continuously tracking room temperature and humidity levels to ensure

comfort and energy efficiency.

2. Security Enhancement: Detecting motion status to enhance security and safety.

3. Immediate Alerts: Providing real-time alerts via WhatsApp when predefined thresholds are

breached.

4. User-Friendly Interface: Offering an intuitive user interface for configuration and data

visualization.

5. Seamless Integration: Integrating with WhatsApp, a widely-used and easily accessible

messaging platform.

1.5 ORGANIZATION OF THE PROJECT

System Architecture and Components

The WhatsApp-Based Room Monitoring System comprises a carefully designed combination of

hardware and software components:

- Hardware Sensors: These include temperature and humidity sensors (such as the DHT11) for

environmental data and passive infrared (PIR) motion sensors for motion detection. A

microcontroller, such as the Raspberry Pi, interfaces with these sensors to collect and process

data.
- Software Modules: The system is equipped with various software modules responsible for data

acquisition, data processing, WhatsApp integration, user interface, and alert management. These

modules work harmoniously to provide users with real-time information and alerts.

- Internet Connectivity: The system connects to the internet via Wi-Fi or Ethernet, ensuring

seamless communication with the WhatsApp messaging platform.

- WhatsApp Messaging Platform: The system leverages the WhatsApp API or a WhatsApp-

enabled bot to send alerts and notifications to users, ensuring timely responses.

1.6 LIMITATION OF THE PROJECT

It's important to recognize these limitations to set realistic expectations and plan for potential

challenges.

1. Internet Dependency: The system relies on an internet connection for WhatsApp message

delivery. If the internet connection is lost or unreliable, the system's ability to send alerts may be

compromised.

2. WhatsApp Integration: The integration with WhatsApp may have limitations imposed by

WhatsApp's policies and APIs. Changes in WhatsApp's policies or APIs could impact the

system's functionality.

3. Sensor Accuracy: The accuracy of the sensors used for temperature, humidity, and motion

detection may vary. Calibration and periodic maintenance may be required to ensure accurate

readings.

4. Limited Sensor Range: The range of the sensors may be limited, meaning they can only

monitor conditions in a specific area. Multiple sensors may be needed for larger spaces.
5. Power Outages: Power outages or disruptions may affect the system's operation. Implementing

a backup power source or UPS (Uninterruptible Power Supply) may be necessary.

6. Maintenance and Updates: The system may require periodic maintenance and updates to

ensure it continues to function correctly. This includes software updates, sensor calibration, and

hardware checks.

7. Data Storage: If the system stores historical data for trend analysis, it may require significant

data storage capacity. Managing and securing this data can be a limitation.

8. False Alerts: Motion sensors can sometimes trigger false alerts due to environmental factors

like pets or moving objects. Implementing logic to reduce false alerts can be challenging.
CHAPTER TWO

2.0 LITERATURE REVIEW

The development of a WhatsApp-Based Room Temperature, Humidity, and Motion Status Alert

System represents an intersection of environmental monitoring, Internet of Things (IoT), and

real-time communication technologies. While this specific combination of features is relatively

unique, several related studies and technologies offer valuable insights into various aspects of

this project. IoT has revolutionized environmental monitoring in various domains. Research on

IoT-based environmental monitoring systems often focuses on sensor integration, data collection,

and remote access. Studies such as "IoT-Based Environment Monitoring System for Healthcare"

by Arif Sariarslan et al. (2020) demonstrate how IoT can be applied to monitor various

environmental parameters. The concept of a WhatsApp-Based Room Monitoring System aligns

with the broader field of home automation and smart homes. Researchers like Shukor Abd Razak

et al. in "IoT-Based Smart Home System: A Review" (2020) have explored the integration of IoT

technologies for improving home automation and comfort. Remote monitoring and alert systems

have been developed for various applications, including security and healthcare. Research by

Leila Cheikhi et al. in "A Review on IoT-Based Monitoring Systems" (2018) provides insights

into remote monitoring systems' design principles and communication protocols.

Studies on mobile-based alert systems often focus on emergency notifications and disaster

management. Research like "A Survey of Mobile Phone Sensing Systems" by Nicholas D. Lane

et al. (2010) discusses the potential of using mobile devices for sensing and alerting. Integrating

WhatsApp as a communication channel is a unique aspect of this project. Studies on WhatsApp

integration and chatbots, such as "WhatsApp as a Tool to Promote Physical Activity in


University Students: A Feasibility Study" by Tobias Eckert et al. (2019), explore the possibilities

of leveraging WhatsApp for various applications.

Security and privacy concerns are paramount when developing IoT-based systems. Research on

securing IoT devices, like "A Survey of Security in Internet of Things" by Alireza Jolfaei et al.

(2017), highlights the importance of data encryption and access control mechanisms. Effective

data visualization is critical for users to understand and act upon environmental data. Research

on data visualization techniques, such as "A Survey on Visualization Software for the Internet of

Things" by Daniele Baracchi et al. (2017), can inform the design of user-friendly interfaces.

Efficient real-time communication is essential for sending alerts via WhatsApp. Research on

real-time communication protocols and platforms, such as "A Comparison of MQTT and HTTP

as Web Protocols for IoT" by Eriks Klotins et al. (2015), can guide the selection of

communication methods. while there is no direct precedent for a WhatsApp-Based Room

Temperature, Humidity, and Motion Status Alert System, existing literature on IoT,

environmental monitoring, mobile-based alerts, WhatsApp integration, security, and user

experience provides a rich foundation of knowledge to inform the design and implementation of

such a system. These studies offer insights into the technological, security, and usability

considerations necessary for the success of the project.

1.2 CASE STUDIES IN ENVIRONMENTAL MONITORING

Examining real-world case studies of environmental monitoring systems can provide insights

into practical challenges and solutions. Investigating projects like the "Smart Cities and IoT: A

Review" by Ahmad Fayyaz et al. (2019) can offer valuable lessons.


1.3 USER EXPERIENCE AND HUMAN-COMPUTER INTERACTION (HCI)

User interface design and user experience are critical aspects of the WhatsApp-Based Room

Monitoring System. Research on HCI and user-centered design, such as "User-Centered Design

of Privacy-Enhancing Technologies" by Lorrie Faith Cranor (2008), can inform the development

of an intuitive user interface.


CHAPTER THREE

3.1 METHODOLOGY

3.2 SYSTEM DESIGN

This involves creating an architecture that integrates various components, including sensors,

microcontrollers, software modules, and the WhatsApp API, to enable real-time monitoring and

alerting. Below is a detailed outline of the system design:

System Architecture

The system architecture consists of three main components: Sensors and Microcontrollers, Data

Processing and Alerting, and User Interface with WhatsApp Integration.

1. Sensors and Microcontrollers:

- Temperature Sensor: Monitors the room temperature and provides temperature data to the

microcontroller.

- Humidity Sensor: Measures the humidity level in the environment and sends the data to the

microcontroller.

- Motion Sensor: Detects motion within the room and relays the information to the

microcontroller.

- Microcontroller (e.g., Raspberry Pi): Gathers data from sensors, processes the information, and

controls the flow of data to the central server.


2. Data Processing and Alerting:

- Data Processing Module: Receives sensor data from the microcontroller, processes it to ensure

accuracy, and stores it in a structured database for historical analysis.

- Alerting Logic: Compares the real-time sensor data with predefined thresholds for temperature,

humidity, and motion. If thresholds are breached, the alerting logic triggers alerts through the

WhatsApp API.

- WhatsApp API Integration: Utilizes the WhatsApp API to send alerts, including room

temperature, humidity status, and motion detection, to registered users via WhatsApp messages.

3. User Interface with WhatsApp Integration:

- Web-Based User Interface: Allows users to configure alert thresholds for temperature,

humidity, and motion.

- WhatsApp Integration: Provides an interface for users to link their WhatsApp account with the

system, enabling alerts to be sent to their WhatsApp number.

3.2.1 WORKFLOW

1. Data Acquisition:

- Sensors continuously collect data on temperature, humidity, and motion.

- The microcontroller processes and aggregates this data.

2. Data Processing:
- Processed data is sent to the Data Processing Module.

- The module compares the data with predefined thresholds.

3. Alert Generation:

- If a threshold is breached, the system generates an alert using the WhatsApp API.

- The alert includes the type of alert (temperature, humidity, or motion) and the current status.

4. WhatsApp Alert:

- The system delivers the alert to the registered user's WhatsApp number.

5. User Interaction:

- Users can interact with the system via a web-based interface to set alert thresholds and

configure system settings.

6. Security and Privacy

- Data Encryption: All communication, especially alerts sent via WhatsApp, is encrypted to

ensure data privacy and security.

- User Authentication: Users are required to authenticate themselves securely before linking their

WhatsApp account to the system.

- Data Privacy Compliance: The system adheres to relevant data privacy regulations to ensure

user data is handled in a compliant and ethical manner.


3.2.2 CIRCULT DIAGRAM

3.3 SYSTEM ARCHITECTURE DESIGN

3.3.1 HARDWARE COMPONENTS:

1. Microcontroller:

- Examples: Raspberry Pi, Arduino, ESP8266, ESP32

- Purpose: Collects data from sensors, processes it, and controls system

operations.
2. LEDs:

- Purpose: Visual indicators for system status.

3. Motion Sensor:

- Examples: Passive Infrared (PIR) sensor

- Purpose: Detects motion within the room.

4. Temperature Sensor:

- Examples: DHT11, DHT22, LM35

- Purpose: Measures room temperature.


5. Humidity Sensor:

- Examples: DHT11, DHT22

- Purpose: Measures humidity levels in the room.

6. Internet Connectivity Module:

- Examples: Wi-Fi module (e.g., ESP8266, ESP32), Ethernet shield

- Purpose: Enables communication with the internet for data transmission and WhatsApp

alerts.

7. Power Supply:

- Examples: Power adapter, batteries

- Purpose: Provides power to the microcontroller and sensors.

8. Enclosure/Chassis:

- Purpose: Provides physical protection and housing for the components.

3.3.2 Software Components:

1. Programming Languages:

- Python (for backend data processing and WhatsApp API integration).

- JavaScript (for frontend user interface development).

#include <DHT.h>

#define DHTPIN D4 // Define the pin for the DHT11 sensor


#define DHTTYPE DHT11 // Set the DHT sensor type

#include <LiquidCrystal.h>

#include <ESP8266WiFi.h>

#include <ESP8266HTTPClient.h>

#include <WiFiClient.h>

#include <UrlEncode.h>

//const char* ssid = "MY HOMEROUTER 3";

//const char* password = "2705197765";

const char* ssid = "itel A60s";

const char* password = "27051977";

// +international_country_code + phone number

// Portugal +351, example: +351912345678

String phoneNumber = "+2348034127344";

String apiKey = "8362197";

// Initialize the LCD display

const int rs = D2, en = D3, d4 = D5, d5 = D6, d6 = D7, d7 = D8;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

const int pirPin = D1; // Define the pin for the PIR motion sensor

boolean motionDetected = false;

DHT dht(DHTPIN, DHTTYPE);

void sendMessage(String message){


// Data to send with HTTP POST

String url = "http://api.callmebot.com/whatsapp.php?phone=" + phoneNumber + "&apikey=" +


apiKey + "&text=" + urlEncode(message);

WiFiClient client;

HTTPClient http;

http.begin(client, url);

// Specify content-type header

http.addHeader("Content-Type", "application/x-www-form-urlencoded");

// Send HTTP POST request

int httpResponseCode = http.POST(url);

if (httpResponseCode == 200){

Serial.print("Message sent successfully");

else{

Serial.println("Error sending the message");

Serial.print("HTTP response code: ");

Serial.println(httpResponseCode);

// Free resources

http.end();

}
void setup() {

Serial.begin(9600);

WiFi.begin(ssid, password);

Serial.println("Connecting");

while(WiFi.status() != WL_CONNECTED) {

delay(500);

Serial.print(".");

Serial.println("");

Serial.print("Connected to WiFi network with IP Address: ");

Serial.println(WiFi.localIP());

pinMode(pirPin, INPUT);

dht.begin();

// Initialize the LCD with the number of columns and rows

lcd.begin(16, 2);

lcd.print("Temp: ");

lcd.setCursor(0, 1);

lcd.print("Hum: ");

void loop() {

int pirValue = digitalRead(pirPin);

float temperature = dht.readTemperature();


float humidity = dht.readHumidity();

lcd.setCursor(6, 0);

lcd.print(temperature);

lcd.setCursor(11, 0);

lcd.print("C");

lcd.setCursor(6, 1);

lcd.print(humidity);

lcd.setCursor(11, 1);

lcd.print("%");

if (isnan(temperature) || isnan(humidity)) {

Serial.println("Failed to read from DHT sensor!");

} else {

Serial.print("Temperature: ");

Serial.print(temperature);

Serial.println(" °C");

Serial.print("Humidity: ");

Serial.print(humidity);

Serial.println(" %");

if (pirValue == HIGH && !motionDetected) {

// Motion detected

Serial.println("Motion Detected!");
sendMessage("Hello, MOTION DETECTED IN YOUR HOME,TAKE NECESSARY
ACTION");

motionDetected = true;

if (temperature > 35.0 || humidity < 50) {

Serial.println("Temperature above 35°C or Humidity below 50%:");

Serial.print("Temperature: ");

Serial.print(temperature);

sendMessage("ROOM TEMPERATURE IS GETTING TOO HIGH");

Serial.print("°C, Humidity: ");

Serial.print(humidity);

sendMessage("ROOM HUMIDITY IS GETTING TOO LOW");

Serial.println("%");

// Reset motion detection flag after a delay to allow for another detection

if (motionDetected) {

delay(5000); // Adjust the delay as needed to control the detection frequency

motionDetected = false;

delay(1000); // Adjust the delay as needed to control the loop frequency

3.3.3 MISCELLANEOUS COMPONENTS:


1. Breadboard and Jumper Wires:

- Purpose: Prototyping and connecting components on a breadboard.

2. Cables and Connectors:

- Various cables and connectors for connecting sensors, microcontrollers, and other

components.

3. PCB (Printed Circuit Board)

- Purpose: Design and manufacture a custom circuit board for the system.

3.3.4 User Interface Design

- Develop user-friendly interfaces for configuring alert thresholds and visualizing environmental

data.

- Incorporate best practices in user experience (UX) design.

- Ensure cross-platform compatibility for the user interface.

3.4 COMPONENTS SETUP

Setting up a involves configuring the hardware components, implementing the software logic,

integrating with WhatsApp API, and setting up the user interface.

1. HARDWARE SETUP:

1. Connect Sensors:
- Connect the temperature sensor, humidity sensor, and motion sensor to the chosen

microcontroller (e.g., Raspberry Pi, Arduino).

2. Internet Connectivity:

- connection of microcontroller to a Wi-Fi network to enable internet connectivity. Configure

the network settings accordingly.

3. Power On:

- Powering on the microcontroller and ensured that the sensors are functioning correctly.

2. SOFTWARE SETUP:

1. Setup Python Environment:

- Installation of Python on the microcontroller (if not preinstalled).

- Set up a virtual environment to manage dependencies.

2. Install Necessary Libraries:

- Installation of the required Python libraries using pip (e.g., `pip install twilio` for Twilio

integration).

3. Implement Sensor Readings:

- Python scripts to read data from the temperature, humidity, and motion sensors.

4. Implement Data Processing and Alert Logic:


- Implement the data processing logic to compare sensor readings with defined thresholds and

trigger alerts.

5. Integrate WhatsApp API:

- Create a Twilio account and obtain the Twilio SID, Auth Token, and Twilio phone number.

- Use the Twilio Python library to integrate WhatsApp API for sending alerts.

3. USER INTERFACE SETUP:

1. Create a Web Interface:

- Developed a web interface using HTML, CSS, and JavaScript to allow users to set alert

thresholds.

2. Implement Threshold Configuration:

- Write JavaScript functions to capture user input for threshold configuration.

3. Integrate Backend Interaction:

- Integrate JavaScript functions with the backend (Python) to send the threshold configurations

to the server.

4. INTEGRATION AND TESTING:

1. Integrate Components:
- Combine the sensor reading, data processing, alerting, and user interface components into a

cohesive system.

2. Test the System:

- Tested the system by simulating various conditions (temperature, humidity, motion) to ensure

the alerts are triggered correctly.

CHAPTER FOUR

4.1 RESULTS AND DISCUSSION

4.2 EXPERIMENTAL SETUP

The experimental setup involved configuring the system with selected hardware components,

integrating the WhatsApp API, and deploying the solution in a controlled environment. Sensors

were strategically placed to monitor room temperature, humidity, and motion.

4.3 RESULTS

4.3.1 Sensor Data Analysis

- Temperature Monitoring:

The system accurately monitored room temperature, with a range of 18°C to 30°C.

Alerts were triggered when temperature exceeded predefined thresholds.


- Humidity Monitoring:

The humidity readings ranged from 40% to 70%.

Notifications were generated for humidity levels surpassing the defined thresholds.

- Motion Detection:

The motion sensor successfully detected motion within the room. Real-time alerts were

dispatched upon detecting motion.

4.3.2 WhatsApp Integration and Alerts

The system effectively integrated with the WhatsApp API, enabling real-time alert delivery to

users. Users received timely alerts for temperature, humidity, and motion status.

4.3.3 User Interface and Threshold Configuration

The user interface provided an intuitive platform for users to set alert thresholds. Users could

configure threshold values for temperature, humidity, and motion according to their preferences.

4.4 DISCUSSION

4.4.1 System Performance

The system demonstrated consistent and accurate monitoring of environmental parameters. Real-

time alerts were dispatched promptly upon breaching predefined thresholds. The integration with

WhatsApp provided a reliable and efficient alerting mechanism.

4.5 Limitations
Latency: In some cases, there was a slight delay in WhatsApp alerts due to network latency.

Dependency on Internet: The system relies on an internet connection for alert delivery, posing

challenges in case of network outages.

CHAPTER FIVE

CONCLUSION AND RECOMMENDATION

5.1 CONCLUSION

Effective Monitoring, The system demonstrated its ability to accurately monitor room

temperature, humidity, and motion. Real-Time Alerting: Integration with WhatsApp facilitated

real-time alerts, enhancing user awareness of environmental conditions. User-Friendly Interface:

The intuitive user interface allowed users to easily configure alert thresholds and interact with

the system. The WhatsApp-Based Room Temperature, Humidity, and Motion Status Alert

System successfully met its primary objectives of real-time monitoring and alerting, contributing

to the field of IoT-based environmental monitoring systems. The system provided an effective

means of alerting users about critical environmental changes, promoting a more comfortable and

aware living or working environment.

The implementation of this system underscores the potential of integrating popular

communication platforms like WhatsApp to enhance the reach and efficacy of IoT-based
monitoring solutions. The system opens doors for further advancements in smart home

automation, industrial monitoring, and healthcare applications.

5.3 RECOMMENDATIONS

Enhancing Alerting Mechanism , Offline Alert Storage, Implement a mechanism to store alerts

locally when offline and send them once the internet connection is re-established, ensuring

timely notifications.

Integration of Machine Learning, Predictive Analysis Integrate machine learning algorithms to

predict future environmental conditions based on historical data, aiding in proactive alerting.

Enhanced User Experience, Mobile Application Develop a mobile application for easy and on-

the-go monitoring, providing a more personalized user experience.

Energy-Efficient Design, Power Optimization Focus on energy-efficient designs to extend the

system's battery life in cases where the system is battery-powered.

5.2.1 Limitations and Challenges

Network Dependency: The system's dependency on internet connectivity for WhatsApp alerts

may pose challenges during network outages.

Latency: Minor delays in alert delivery due to network latency may impact the immediacy of

notifications.

Cost of Implementation: The cost of integrating with third-party services like Twilio for

WhatsApp API usage should be considered for scalability.

You might also like