Project Report-1
Project Report-1
INTRODUCTION
1.1 DOMAIN OVERVIEW
The system logs arrival times, stores them in a database, and anomaly
detection algorithms to recognize patterns and deviations. Based on this analysis,
it intelligently controls air conditioning (AC) units turning them ON, delaying
activation, or keeping them OFF to optimize comfort and reduce energy usage.
This domain supports a wide range of applications, including climate control,
energy-efficient buildings, and elder care monitoring. Future enhancements, like
integrating calendar data and seasonal behavior changes, can make smart homes
even more intelligent, secure, and user-centric.
1
devices and promotes a smart, energy-efficient, and personalized living
environment.
1.4 MOTIVATION
2
CHAPTER 2
LITERATURE SURVEY
PAPER: 1
Year: 2024
PAPER: 2
Intelligent Living “
Year: 2024
3
Summary: This project introduces an Adaptive AI-powered Full Home
Automation System that enhances comfort and efficiency. It uses an AI-based
neural network (AIDBNN) to adjust settings based on user preferences and
environmental changes. A CNN ensures facial recognition and intruder detection
for improved security. A Decision Tree algorithm coordinates system actions for
optimal performance.
PAPER: 3
Author: Elkhalik
Year: 2024
PAPER: 4
Title: “AI big data analytics for building automation and management systems: a
survey, actual challenges and future perspectives”
Author: Himeur
Year: 2023
Summary: This paper surveys the integration of AI and big data analytics into
Building Automation and Management Systems (BAMSs). It highlights AI's role
in overcoming BAMS limitations by enabling tasks like energy anomaly detection
and performance optimization. A taxonomy-based review covers AI applications
such as load forecasting, water management, and occupancy detection.
PAPER: 5
Title: “A deep learning model for intelligent home energy management system
using renewable energy”
4
Year: 2023
PAPER: 6
Author: Alzoubi
Year: 2022
Summary: This study addresses rising residential energy demands and highlights
the role of smart homes in optimizing energy consumption. It proposes a data
fusion - based energy management approach, improving prediction accuracy to
92% over existing methods. Smart applications in asset management, automation,
and healthcare drive the need for intelligent energy solutions.
PAPER: 7
Author: Minbo
Year: 2022
Summary: This study proposes a smart home control framework using a novel
context modeling method based on object and attribute graphs. It analyzes existing
modeling strategies and designs rule, mode, and voice control for smart
interactions. An inference engine maps context-aware data to IoT services for
automation. Performance tests show faster response times and enhanced
personalization compared to traditional methods.
PAPER: 8
5
Title: “Artificial Intelligent of Things (AIoT) enabled floor monitoring system for
smart home applications”
Year: 2021
Summary: This study presents a smart floor monitoring system using reliable
tribo electric coding mats and deep-learning analytics. It addresses sensor
limitations by normalizing outputs for stability, unaffected by humidity or usage
variations. A universal electrode design allows cost-effective, scalable production
with simplified wiring and reduced complexity. The system enables accurate
tracking, identity recognition, and smart interactions, advancing floor sensing in
smart homes.
PAPER: 9
Author: Lissa
Year: 2021
Summary: This study presents a deep reinforcement learning (DRL) algorithm for
smart home energy management, focusing on heating and hot water control. The
DRL approach optimizes PV energy use, achieving up to 16% energy savings in
summer without compromising user comfort. A dynamic indoor temperature set
point method enhances flexibility and efficiency in energy usage.
PAPER: 10
Title: "Smart home security: challenges, issues and solutions at different IoT
layers"
Author: Touqeer
Year: 2021
Summary: This paper explores the role of IoT in enabling smart home
technologies like temperature control, smart locks, and smoke detection. While
6
offering convenience, IoT also introduces serious security and privacy risks,
making users hesitant to adopt smart homes. The paper analyzes the layered IoT
structure and identifies security challenges at each layer within smart home
environments. It also proposes potential solutions to mitigate these issues and
enhance the overall security of IoT - based smart homes.
CHAPTER 3
SYSTEM ANALYSIS
7
3.1.1 DISADVANTAGES OF AN EXISTING SYSTEM
● No context awareness
● Energy Efficiency
● No time based adjustment
8
Energy Efficient
3.3 ALGORITHM
9
system identifies whether the behavior falls within the expected range or deviates
significantly. If the deviation exceeds a predefined threshold typically two or three
standard deviations the entry time is marked as an anomaly. Based on this
classification, the system makes intelligent decisions regarding air conditioner
operation: it turns the AC ON immediately if the arrival is within the normal
range, gradually adjusts activation for minor delays, or keeps the AC OFF if a
significant anomaly is detected. This lightweight algorithm is effective for real-
time applications, as it requires minimal computational resources and does not
depend on large datasets. By intelligently responding to user behavior, the
anomaly detection algorithm ensures energy efficiency while maintaining user
comfort.
After completing the above six steps, the anomaly detection algorithm
effectively learns the user's behavioral patterns and dynamically adapts the air
conditioning system to respond intelligently to deviations. This behavior-based
approach ensures that the system avoids unnecessary energy usage during irregular
routines while maintaining comfort during normal patterns. By integrating
statistical analysis with real-time decision-making, the algorithm enables
predictive control rather than reactive switching. This significantly improves
overall energy efficiency and user satisfaction. The insights gathered through this
process form the basis for further system evaluation, where performance can be
measured in terms of energy savings, reduced false triggers, and improved comfort
levels. These outputs are then analyzed in the result analysis section to validate the
10
effectiveness of the proposed smart home automation system.
CHAPTER 4
SYSTEM SPECIFICATION
The system should be able to collect and store data on the user's daily home
entry times. It must analyze historical patterns to predict future home arrival
accurately. The system should adjust AC settings automatically based on predicted
arrival times to optimize comfort and energy use. Anomaly detection must be
implemented to handle deviations from normal schedules. It should turn off or
delay AC operation when unexpected late arrivals are detected. The system should
provide feedback or control access through a user interface for monitoring and
adjustments.
11
responsiveness, with minimal delay in adjusting settings based on user behavior.
Security is essential to protect user data and prevent unauthorized access to smart
devices. The system should offer high availability, operating continuously without
downtime.
4.3 HARDWARE REQUIREMENTS
1. Arduino Nano
Arduino Nano is a small and compact microcontroller board based on
the ATmega328 chip. It is similar to the Arduino Uno but smaller in size,
making it ideal for compact electronic projects. It has 14 digital input/output
pins, 8 analog inputs, a USB port for programming, and runs at 16 MHz. It is
widely used in DIY electronics, robotics, and embedded systems.
2. Relay Module
This acts as an electrical switch that allows the ESP32 microcontroller to
turn the air conditioner ON or OFF. When the AI algorithm determines that
the AC should be activated or deactivated based on user behavior, the ESP32
sends a signal to the relay module to perform the action.
12
Figure 4.3.2 Relay Module
3. Jumper Wire
A jumper wire is a short insulated wire used to connect components on
a breadboard or between devices in electronic circuits. It comes in male-to-
male, male-to-female, and female-to-female types for easy and quick
prototyping.
● Python
● Pycharm
CHAPTER 5
15
SYSTEM DESIGN AND DEVELOPMENT
5.1 INTRODUTION
The input design is the process of converting the user-oriented inputs into
the computer-based format. The goal of designing input data is to make the
automation as easy and free from errors as possible. For providing a good input
design for the application easy data input and selection features are adopted. The
input design requirements such as user friendliness, consistent format and
interactive dialogue for giving the right message and help for the user at right time
are also considered for the development of the project.
17
The system design used in the project "Energy Optimization Through
Behavior-Based Automated Control" is centered around integrating artificial
intelligence (AI), Internet of Things (IoT) devices, and behavioral pattern
recognition to optimize energy usage specifically air conditioning in smart homes.
The system starts by detecting user presence through PIR sensors or cameras,
recording entry times into a local or cloud database. AI models analyze these
historical patterns to learn the user's routine. When a user's entry time deviates
from the usual schedule, an anomaly detection algorithm evaluates whether it is a
minor or major variation. Based on this, the system dynamically adjusts or delays
air conditioning operation to save energy without sacrificing comfort.
18
5.5 USECASE DIAGRAM
19
5.6 DATAFLOW DIAGRAM
User
Dataset Collection
Preprocessing
Feature Extraction
Classification
Accuracy of result
20
5.6 CLASS DIAGRAM
21
CHAPTER 6
TECHNOLOGIES
6.1 PYTHON LANGUAGE
Python is an object-oriented programming language created by Guido
Rossum in 1989. It is ideally designed for rapid prototyping of complex
applications. It has interfaces to many OS system calls and libraries and is
extensible to C or C++. Many large companies use the Python programming
language include NASA, Google, YouTube, Bit Torrent, etc. Python
programming is widely used in Artificial Intelligence, Natural Language
Generation, Neural Networks and other advanced fields of Computer Science.
Python had deep focus on code readability & this class will teach you python
from basics.
6.2 PYTHON PROGRAMMING CHARACTERISTIC
● It provides rich data types and easier to read syntax than any other
programming languages.
● It is a platform independent scripted language with full access to
operating system API's.
● Compared to other programming languages, it allows more run-time
flexibility.
● It includes the basic text manipulation facilities of Perl and Awk.
● A module in Python may have one or more classes and free functions.
● Libraries in Pythons are cross-platform compatible with Linux,
Macintosh, and Windows.
● For building large applications, Python can be compiled to byte-code.
● Python supports functional and structured programming as well as
OOP.
● It supports interactive mode that allows interacting testing .
22
6.3 INTERNET OF THINGS
The Internet of Things (IoT) refers to a network of physical devices,
vehicles, appliances, and other physical objects that are embedded with sensors,
software, and network connectivity, allowing them to collect and share data.
Technologists are even envisioning entire “smart cities” predicated on IoT
technologies. It enables these smart devices to communicate with each other and
with other internet-enabled devices. Like smart phones and gateways, creating a
vast network of interconnected devices that can exchange data and perform
various tasks autonomously.
As the number of internet-connected devices continues to grow, IoT is
likely to play an increasingly important role in shaping our world. Transforming
the way that we live, work, and interact with each other. In an enterprise context,
IoT devices are used to monitor a wide range of parameters such as temperature,
humidity, air quality, energy consumption, and machine performance. This data
can be analyzed in real time to identify patterns, trends, and anomalies that can
help businesses optimize their operations and improve their bottom line.
6.3.1 BENEFITS OF IOT
● Improved efficiency
● Data driven decision making
● Automation
● Real time data collection
● Remote monitoring and control
● Predictive maintenance
6.3.2 KEY TECHNOLOGIES IN IOT
● Sensors and actuators
● Connectivity technologies
23
● Cloud computing
● Big data analytics
● Security and privacy technologies
6.3.3 APPLICATIONS OF IOT
● Healthcare
● Manufacturing
● Retail
● Agriculture
● Transportation
6.4 ANOMALY DETECTION ALGORITHM
An anomaly detection algorithm is a machine learning technique that
identifies data points or patterns that significantly differ from the normal
behavior within a dataset. It analyzes historical data to understand typical trends
and then monitors new data to detect any deviations from these patterns. When
such deviations are found, the algorithm flags them as anomalies. This process
helps systems become more intelligent by enabling them to respond to
unexpected or irregular conditions, thereby improving efficiency, reliability, and
decision-making.
6.4.1 BENEFITS OF ANOMALY DETECTION ALGORITHM
● Enhances Automation
● Early Problem Detection
● Supports Adaptive Systems
● Reduces Operational Costs
● Increases Reliability
● Saves Energy and Resources
24
CHAPTER 7
TEST CASES
Testing, as already explained earlier, is the process of discovering all
possible weak-points in the finalized product. Testing helps to counter the
working of sub-assemblies, components, assembly and the complete result. The
project is taken through different exercises with the main aim of making sure that
software meets the business requirement and user-expectations and doesn’t fails
abruptly. Several types of tests are used today. Each test type addresses a specific
testing requirement.
7.1 TESTING TECHNIQUES
A test plan is a document which describes approach, its scope, its resources
and the schedule of aimed testing exercises. It helps to identify almost other test
item, the features which are to be tested, its tasks, how will everyone do each
task, how much the tester is independent, the environment in which the test is
taking place, its technique of design plus the both the end criteria which is used,
also rational of choice of theirs, and whatever kind of risk which requires
emergency planning. It can be also referred to as the record of the process of test
planning. Test plans are usually prepared with signification input from test
engineer.
1. UNIT TESTING
Unit testing for this project involves verifying data collection accuracy,
ensuring the prediction algorithm correctly anticipates user arrival times, testing
anomaly detection logic for schedule deviations, and validating the automation
control that manages AC settings based on behavior insights.
2. FUNCTIONAL TESTING
Functional testing for this project involves verifying if the system accurately
25
collects and records user entry times, processes the data to predict home arrival,
and adjusts the AC accordingly. It also checks whether anomaly detection
correctly identifies schedule deviations and modifies AC settings to save energy.
3. INTEGRATION TESTING
Integration testing for this project involves verifying the interaction between
the data collection module, behavior analysis algorithms, and the AC control
system. It ensures seamless communication between the sensors, machine
learning models, and smart device controllers. Testing also validates real-time
anomaly detection and appropriate system responses.
4. SYSTEM TESTING
System testing for this project involves verifying the integration of data
collection, behavior analysis, anomaly detection, and AC automation
functionalities. It ensures the system accurately predicts user arrival times and
responds appropriately to deviations. Additionally, the system's reliability and
responsiveness in varying user behavior patterns are evaluated.
5. WHITE BOX TESTING
White box testing for this project involves verifying the internal logic of
behavior analysis algorithms, ensuring correct implementation of the schedule
prediction and anomaly detection modules. It also includes checking condition
handling in the control flow for turning the AC on or off based on user patterns.
Testing ensures accurate data parsing, learning model outputs, and response to
edge cases like missing or inconsistent data.
6. BLACK BOX TESTING
Black box testing for this project involves verifying that the system
responds correctly to different user entry times without knowing the internal
logic. It checks whether the AC pre-conditioning activates or deactivates
appropriately based on detected patterns. It also tests anomaly handling when the
user deviates from typical behavior. The focus is on input-output correctness,
26
energy-saving functionality, and system responsiveness.
CHAPTER 8
MODULES
8.1 MODULE DESCRIPTION
8.1.1 DATA COLLECTION
Data Collection Module serves as the foundation of the smart home
behavioral automation system. It is responsible for gathering real-time data from
various sensors installed within the home environment. Primarily, motion sensors
such as Passive Infrared (PIR) sensors detect the user's physical presence or
movement, while temperature and humidity sensors like DHT11 monitor
environmental conditions. In addition to sensor data, the system also logs the
exact time of user entry on a daily basis. All collected data is time-stamped and
stored systematically to facilitate accurate analysis in later stages.
8.1.2 DATA PREPROCESSING
Data Preprocessing Module plays a vital role in ensuring the quality
and usability of the raw data collected from sensors. This module performs
cleaning operations to eliminate noise, remove duplicate entries, and resolve
inconsistencies that may arise due to faulty sensor readings or data logging
errors. It also converts and formats timestamps into standardized units, enabling
accurate time-series analysis. By transforming raw data into a clean, structured
format, this module ensures the integrity and accuracy of the system’s behavioral
models.
8.1.3 BEHAVIOR PATTERN ANALYSIS
Behavior Pattern Analysis Module is responsible for identifying the
user's habitual patterns based on historical entry time data. Utilizing time-series
analysis techniques, this module detects recurring behaviors, such as typical
arrival and departure times. By clustering similar behaviors, the system can build
27
a comprehensive profile of user activity, which is crucial for forecasting future
behavior and optimizing system responses.
8.1.4 ABNORMALITY DETECTION
Abnormality Detection Module ensures that deviations from the user’s
normal routine are quickly identified and addressed. It compares real-time data
against established behavior patterns to detect anomalies, such as unexpected
delays, early arrivals, or complete absences. Upon detecting such deviations, the
module automatically triggers energy-saving actions, such as turning off air
conditioning or lighting systems to avoid unnecessary energy usage.
8.1.5 CONTROL AND AUTOMATION
Control and Automation Module acts as the execution layer of the
system, interfacing directly with IoT- based smart devices such as relays, smart
plugs, and home automation hubs. It ensures seamless and reliable device
operation, enabling automated control over environmental settings without
manual intervention. This module is essential for transforming predictive insights
into tangible actions within the smart home environment.
8.1.6 FEEDBACK AND LEARNING
The Feedback and Learning Module enhances the system’s
intelligence by continually refining behavior models using newly collected data.
As users’ routines evolve, this module updates the underlying behavioral patterns
to reflect recent changes, thus improving prediction accuracy over time. It
supports adaptive learning, enabling the system to respond to seasonal shifts,
schedule changes, or lifestyle adjustments.
8.1.7 EVALUATION AND SIMULATION
Evaluation and Simulation Module is designed to test and validate
the effectiveness of the proposed smart home automation system. It runs
simulated scenarios based on actual data to assess how well the system performs
under various conditions. It also generates detailed performance metrics and
28
visual reports that help system’s responsiveness, accuracy, and overall impact.
CHAPTER 9
CODING
Main.py
import serial
importserial.tools.list_ports
import time
import pandas as pd
importjoblib
importnumpy as np
while 1:
input_df = pd.DataFrame([{
"Time of Day Encoded": time_encoded,
"Exact Time Minutes": minutes,
"Is Home Occupied Encoded": occupied_encoded
}])
prediction = model.predict(input_df)[0]
ac_signal = le_signal.inverse_transform([prediction])[0]
Train_Model.py
import pandas as pd
fromsklearn.model_selection import train_test_split
30
fromsklearn.preprocessing import LabelEncoder
fromsklearn.ensemble import RandomForestClassifier
fromsklearn.metrics import classification_report, accuracy_score
importjoblib
# Load dataset
df = pd.read_csv("smart_ac_dataset.csv") # Replace with your actual path
# Split data
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
# Train model
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)
Generate_df.py
import pandas as pd
import random
fromdatetime import datetime, timedelta
# Configuration
num_samples = 500 # How many rows you want
# Time categories
time_categories = ["Morning", "Afternoon", "Evening", "Night"]
data.append({
"Time of Day": time_of_day,
"Exact Time": exact_time,
"Is Home Occupied": is_home_occupied,
"AC Signal": ac_signal
})
# Create DataFrame
df = pd.DataFrame(data)
CHAPTER 10
SCREENSHOTS
34
Figure 10.2 Hardware Responce to Occupancy and Time-Based AC Control
CHAPTER 11
CONCLUSION
35
show that such adaptive systems can significantly contribute to smarter, more
sustainable living.
REFERENCES
[1] Tay, S. W., Zhang, N., &AlJanah, S. (2024). A problem analysis of smart home
automation:Toward secure and usable communication-based authorization. IEEE
Access, 12, 18103-18121https://doi.org/10.1109/ACCESS.2024.3359442
[2] Dahlgren, K., Pink, S., Strengers, Y., Nicholls, L., &Sadowski, J. (2021).
Personalization and the Smart Home: Questioning techno-hedonist
imaginaries. Convergence, 27(5),1155-116https://doi.org/10.1177/13548565211036801
[3] Suman, S., Etemad, A., &Rivest, F. (2021). Potential impacts of smart homes on
human behavior: A reinforcement learning approach. IEEE Transactions on Artificial
Intelligence, 3(4), 567-580 https://doi.org/10.1109/TAI.2021.3127483
[4] Zhang, F., Pan, Z., & Lu, Y. (2023). AIoT-enabled smart surveillance for personal
data digitalization: Contextual personalization-privacy paradox in smart
home. Information & Management, 60(2), 103736
https://doi.org/10.1016/j.im.2022.103736
[5] Gladence, L. M., Anu, V. M., Rathna, R., &Brumancia, E. (2020). Recommender
system for home automation using IoT and artificial intelligence. Journal of Ambient
Intelligence and Humanized Computing,1-9 https://doi.org/10.1007/s12652-020-01968-2
[6] Reyes-Campos, J., Alor-Hernández, G., Machorro-Cano, I., Olmedo-Aguirre, J. O.,
Sánchez-Cervantes, J. L., & Rodríguez-Mazahua, L. (2021). Discovery of resident
behavior patterns using machine learning techniques and IoT
paradigm. Mathematics, 9(3), 219 https://doi.org/10.3390/math9030219
[7] Agee, P., Gao, X., Paige, F., McCoy, A., &Kleiner, B. (2021). A human-centred
approach to smart housing. Building research & information, 49(1), 84-99
https://doi.org/10.1080/09613218.2020.1808946
[8] Gøthesen, S., Haddara, M., & Kumar, K. N. (2023). Empowering homes with
intelligence: An investigation of smart home technology adoption and usage. Internet of
36
Things, 24, 100944 https://doi.org/10.1016/j.iot.2023.100944
[9] Zaidi, A., Yang, R., Koshy, V., Cobb, C., Gupta, I., &Karahalios, K. (2023). A user-
centric evaluation of smart home resolution approaches for conflicts between
routines. Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous
Technologies, 7(1), 1-35.DOI:https://doi.org/10.1145/3581997
37