Smart Home Report
Smart Home Report
Project Report
Smart Home
Names:
Alina Nasir [342350]
Faiq Jamal [344994]
Misbah Noor Awan [333811]
Mydah Nasir [333191]
Muhammad Ali Usman [332608]
Section: BESE-11 A
Contents
Project Description:...............................................................................................................................2
Introduction.......................................................................................................................................2
Problem statement:...........................................................................................................................2
Interoperability Challenges:...........................................................................................................2
User Interface and Analytics:.........................................................................................................2
Energy Efficiency Optimization:.....................................................................................................2
Objectives:.........................................................................................................................................2
Application Requirements.....................................................................................................................3
Hardware Components.........................................................................................................................3
Sensors..............................................................................................................................................3
Supporting Equipment.......................................................................................................................4
More Power Optimization Techniques..............................................................................................5
1. Sleep Mode............................................................................................................................5
2. Interrupt-Driven Operation....................................................................................................5
3. Duty Cycling...........................................................................................................................5
Practical Considerations....................................................................................................................5
Circuit Diagram..................................................................................................................................6
Tinkercad Simulation.............................................................................................................................7
Features and Logic Guide......................................................................................................................8
1. Proximity Sensing......................................................................................................................8
Threshold Distance........................................................................................................................8
2. Ambient Temperature Monitoring............................................................................................8
Threshold Temperature:................................................................................................................8
3. Motion Sensing..........................................................................................................................9
Threshold for Detection.................................................................................................................9
4. Smoke Detector using Gas Concentration Detection.................................................................9
Threshold Gas Concentration:.......................................................................................................9
5. Street Light using Light Intensity Measurement........................................................................9
Threshold Light Level:..................................................................................................................10
6. Automatic Door and Remoted Control Lights using Infrared Remote-Control Interaction......10
Suitable Communication Technology:.................................................................................................10
Individual Components:...................................................................................................................10
Automatic Doors:.........................................................................................................................10
Automatic Light Control:..............................................................................................................11
Automatic Temperature Control:................................................................................................11
Fire Alarm:...................................................................................................................................11
Network Topology:..........................................................................................................................11
2|Page`
Mesh Topology:...........................................................................................................................11
Physical Layer:.................................................................................................................................12
Zigbee (Local Communication):...................................................................................................12
Wi-Fi or Ethernet (Internet Connectivity):...................................................................................12
Internet Layer:.................................................................................................................................12
Internet Protocol (IP):..................................................................................................................12
Application Layer:............................................................................................................................12
MQTT (Message Queuing Telemetry Transport):........................................................................12
HTTPS (Hypertext Transfer Protocol Secure):..............................................................................12
Tools and technologies:.......................................................................................................................12
Data Visualization/Analysis and system interface:..............................................................................13
Dashboard of System:......................................................................................................................13
Humidity......................................................................................................................................13
Temperature................................................................................................................................13
Raw Ethanol.................................................................................................................................14
Pressure:......................................................................................................................................14
Average CO2:................................................................................................................................15
Fire Incidents:..............................................................................................................................15
Predictive Analysis:..........................................................................................................................16
Heat Map:....................................................................................................................................16
Data Pre-processing:....................................................................................................................17
Data Splitting:..............................................................................................................................17
Model Training and Hyper parameter tuning:.............................................................................17
Model Testing and Evaluation:....................................................................................................18
Expected Impact:.................................................................................................................................18
Automation and Convenience:........................................................................................................19
Remote Access and Monitoring:......................................................................................................19
Energy Efficiency:.............................................................................................................................19
Cost Savings:....................................................................................................................................19
Improved Quality of Life:.................................................................................................................19
Environmental Impact:....................................................................................................................19
3|Page`
Project Description:
Introduction
In the era of technological advancements, the concept of smart homes has gained
significant popularity. Smart homes leverage Internet of Things (IoT) technology to
automate and control various aspects of daily living, offering increased convenience, energy
efficiency, and security. However, there remains a need for further innovation and
integration to address existing challenges and provide a seamless, intelligent, and user-
friendly smart home experience.
Problem statement:
While existing smart home systems offer a range of functionalities such as remote control,
energy management, and security, there are still notable limitations and challenges that
hinder the widespread adoption and optimal performance of smart homes. The current
landscape presents the following issues:
Interoperability Challenges:
Many smart home devices and platforms operate in isolation, lacking standardized
communication protocols. This results in compatibility issues and limits the ability to create
a unified, interoperable ecosystem.
User Interface and Analytics:
The user interfaces of existing smart home applications are often complex and fragmented
without much dashboards.
Energy Efficiency Optimization:
Although smart homes aim to enhance energy efficiency, there is room for improvement.
The lack of intelligent algorithms to analyse usage patterns and optimize energy
consumption remains a challenge.
Objectives:
The objective of this project is to develop an integrated, user-friendly, and secure IoT-based
solution that addresses the aforementioned challenges in smart homes. The proposed
solution should focus on:
1. Interoperability: Establishing a standardized communication protocol for seamless
integration of diverse smart home devices and platforms.
2. Clean Circuit Design: To build a clean working circuit that would enable the user to
control the features of home automation
3. Analytics: Creating an intuitive dashboard displaying the analytics of data to the
users
4. Energy Optimization: Developing intelligent algorithms to analyse user behaviour,
device usage patterns, and environmental factors to optimize energy consumption
within the smart home environment.
4|Page`
Application Requirements
The following are the requirements for the of the project
1. Automatic Doors and Lights using Remote Control
2. Ambient Temperature Monitoring
3. Fire Alarm/Smoke Detector
4. Motion Sensing
5. Proximity Sensing
6. Analytics Dashboard
7. Machine Learning Model
Hardware Components
Sensors
Gas Sensor Detects specific gases in Varies significantly Power the sensor
the environment. based on the type selectively and
and model of the periodically for
sensor, typically measurements,
ranging from a few employing calibration and
milliwatts to a few using low-power modes if
watts during active available.
5|Page`
sensing.
IR Sensor and IR Detects and transmits Varies but generally Use power-down modes
Remote infrared signals used for low, a few milliamps when not actively
communication or during operation. receiving or transmitting
remote-control IR signals, activate the
applications. sensor only during
specific events or
commands.
Supporting Equipment
1. Arduino Uno R3: Functions as the main control unit, managing input/output from
various sensors and controlling connected devices like lights, door locks, or displays.
2. Breadboard: Provides a platform for creating and testing circuits without soldering.
It allows for quick prototyping and connecting various components for testing before
final integration.
3. LCD (16x2): Displays information such as temperature readings, system status, or
messages from the smart home system. It provides a visual interface for users to
interact with the system.
4. Micro Servo: Employed to automate the opening and closing of doors or gates
within the smart home. For example, it could control a door lock to grant access
based on authorized inputs.
5. Light Bulbs: Controlled by the Arduino to provide lighting automation in different
rooms. They can be turned on, off, or dimmed based on sensor inputs or
programmed schedules.
6. Piezo: Used for generating audible alerts or notifications. For example, it can sound
an alarm when a motion sensor detects movement in a secured area.
7. LEDs (Light-Emitting Diodes): Used as visual indicators for different statuses or
alarms. For instance, they can indicate the system's operational status or signal
when a specific condition is met.
8. Resistors: Essential in LED circuits to limit current and prevent LED damage. They
are used in series with LEDs to control the current passing through them.
6|Page`
These components collectively contribute to the functionality and automation of a smart
home system, allowing for control, monitoring, and automation of various aspects like
lighting, security, and user interfaces.
7|Page`
Circuit Diagram
8|Page`
TinkerCad Simulation
9|Page`
Features and Logic Guide
1. Proximity Sensing
Utilizing an "Ultrasonic Distance Sensor" for proximity detection, this gadget sends
out ultrasonic waves and measures how long they take to bounce back. By
calculating this time, it figures out how far something is from the door.
This can be useful for security and monitoring. The measurement of distance from
objects (parcels, unknown objects etc) or individuals using ultrasonic waves to
determine their closeness to a designated area or door. In this project:
10 | P a g e `
3. Motion Sensing
The "Passive Infrared (PIR) Motion Sensor" is used for motion detection. This device
detects changes in heat emitted by objects in its field of view, noticing when
someone moves.
MOTION LED
Detected ✓
Not Detected ✘
Gas levels are monitored in the environment and alerts or notifications raised if gas
concentrations exceed safe predefined limits. In this project, a notification is
generated and the gas concentration is constantly updated on the LCD screen.
Threshold Gas Concentration: If the sensor detects a concentration higher
than a specific level (gasThreshold), it signals a potential gas leak or presence of
harmful gases.
Gas Threshold=10 %
GAS CONCENTRATION BUZZER LCD
< 10 ✘ Low
> 10 ✓ High
A "Light Dependent Resistor (LDR)" is used to measure light intensity. This sensor
changes its resistance based on the amount of light falling on it. In this feature there
is Assessment of ambient light levels and adjusting outputs or notifications based on
predefined brightness thresholds.
Threshold Light Level: If the room/street becomes darker than a particular level
(lightThreshold), it triggers the activation of lights to improve visibility.
11 | P a g e `
Light Intensity Threshold=30 %
LIGHT INTENSITY LED
> 30 ✘
< 30 ✓
This feature uses interaction with an "Infrared (IR) Remote Control" for external
command reception.
Individual Components:
Automatic Doors:
Physical Layer: RFID (Radio-Frequency Identification) technology can be used for
communication between the door and the control system.
Internet Layer: For internet connectivity, protocols such as Wi-Fi or Ethernet may
be employed.
Application Layer: MQTT (Message Queuing Telemetry Transport) or CoAP
(Constrained Application Protocol) can be used for communication between the
door control unit and the central application.
Automatic Light Control:
Physical Layer: Zigbee or Z-Wave for communication between light switches,
sensors, and the central control unit.
12 | P a g e `
Internet Layer: Wi-Fi or Ethernet for connecting the central control unit to the
internet.
Application Layer: MQTT or CoAP for communication between the light control
devices and the central application.
Automatic Temperature Control:
Physical Layer: Z-Wave or Zigbee for communication between temperature
sensors, thermostats, and the central control unit.
Internet Layer: Wi-Fi or Ethernet for internet connectivity.
Application Layer: MQTT or CoAP for communication between temperature
control devices and the central application.
Fire Alarm:
Physical Layer: Wired or wireless communication protocols for smoke detectors,
heat sensors, and the central control unit.
Internet Layer: Wi-Fi or Ethernet for internet connectivity.
Application Layer: MQTT or CoAP for communication between fire alarm devices
and the central application.
Network Topology:
Mesh Topology:
The sensors in our network such as temperature sensors, humidity sensors and motion
sensors will be connected to ZigBee routers. These routers will in turn be connected to a
ZigBee coordinator that in turn will be connected to the internet using Wi-Fi. The Zigbee
coordinator can then send data to cloud for further processing. Below is the detail of how
this can be achieved:
The Zigbee coordinator collects temperature readings and door status information
from Zigbee-enabled sensors within the home.
Using MQTT, the coordinator publishes this data to specific topics on the cloud
MQTT broker.
The cloud platform's IoT service subscribes to these topics and receives the data in
real-time.
The cloud platform processes and stores the data, allowing users to remotely
monitor and control their smart home through a web or mobile application.
The following application protocols can be used at each layer:
13 | P a g e `
Physical Layer:
Zigbee (Local Communication):
Zigbee operates on the IEEE 802.15.4 standard, providing a low-power, short-range wireless
communication protocol. It is suitable for connecting devices within a smart home, forming
a mesh network.
Wi-Fi or Ethernet (Internet Connectivity):
For connecting the Zigbee coordinator to the internet, standard technologies like Wi-Fi or
Ethernet can be employed. This allows the coordinator to communicate with cloud services
over the internet.
Internet Layer:
Internet Protocol (IP):
IP operates at the network layer and is used for routing data between devices on the
internet. The Zigbee coordinator, when communicating with the cloud, will rely on IP for
routing data packets.
Application Layer:
MQTT (Message Queuing Telemetry Transport):
MQTT operates at the application layer and is a lightweight and efficient messaging protocol
used for communication between the Zigbee coordinator and the cloud.
HTTPS (Hypertext Transfer Protocol Secure):
HTTPS also operates at the application layer and is used for secure communication between
the Zigbee coordinator and the cloud platform. It is particularly relevant if the cloud
platform exposes RESTful APIs for data transmission
14 | P a g e `
Data Visualization/Analysis and system interface:
Dashboard of System:
Humidity
The following is the line graph of average humidity vs Day from the data of smoke detection
system. It shows that the maximum average humidity over the span of 5 days was recorded
on the 9th of June (~52%) while the minimum average Humidity was recorded on 10 Th June
(~23%).
Temperature
The following is the line graph of average temperature vs Day from the data of smoke
detection system. It shows that the maximum average temperature over the span of 5 days
was recorded on the 10th of June (~34 C) while the minimum average temperature was
recorded on 9Th June (~15C).
15 | P a g e `
Raw Ethanol
The following is the line graph of average Raw ethanol found in air vs Day from the data of
smoke detection system. It shows that the maximum average Raw ethanol over the span of
5 days was recorded on the 8th of June (~20157 units) while the minimum average Raw
ethanol was recorded on 9Th June (~19654 units).
Pressure:
The following is the line graph of average Pressure vs Day from the data of smoke detection
system. It shows that the maximum average Raw ethanol over the span of 5 days was
recorded on the 9th of June (~939 hPa) while the minimum average Raw ethanol was
recorded on 10Th June (~930 hPa).
16 | P a g e `
Average CO2:
The following is the line graph of average equivalent carbon dioxide vs Day from the data of
smoke detection system. It shows that the maximum average equivalent carbon dioxide
over the span of 5 days was recorded on the 10th of June (~4328 ppm) while the minimum
average equivalent carbon dioxide was recorded on 9Th June (~448 pm).
Fire Incidents:
Following is the pie chart that shows the percentage of total number fire and non-fire
incidents classified by the smoke detection system over the span of 5 days. It shows that total
28.54% of incidents were marked as not fire while rest 71.46% incidents were reported as fire
incidents.
17 | P a g e `
Predictive Analysis:
The predictive analysis of the data has been performed with the help of a machine learning
algorithm. We have used the smoke detection dataset to perform our predictive analysis
using XG Boost Model. Our trained model is capable of predicting whether smoke has been
detected or not based on different feature values. Following features are present in this
dataset:
1. Temperature
2. Humidity
3. TVOC[ppb]
4. eCO2[ppm]
5. Raw H2
6. Raw Ethanol
7. Pressure[hPa]
8. PM1.0
9. PM2.5
10. NC0.5
11. NC1.0
12. NC2.5
13. CNT
14. Fire Alarm
The Fire Alarm column represents whether fire alarm was turned on based on the detection
of smoke.
Heat Map:
Below is the heatmap that illustrates the correlation between different column values:
18 | P a g e `
Data Pre-processing:
The data was pre-processed by removing the outlier values from each column.
Data Splitting:
The data was split in 9:1 indicating that 90% was used as training data and the rest was used
as testing data.
Model Training and Hyper parameter tuning:
After the model was trained using XGBoost, hyper parameter training was performed using
RandomizedSearchCV on the following hyper parameters:
1. learning_rate
2. n_estimators
3. num_leaves
4. max_depth
19 | P a g e `
Model Testing and Evaluation:
After hyper parameter tuning the model was evaluated on the test dataset and following
confusion matrix was obtained:
Expected Impact:
The successful implementation of this project will result in a next-generation smart home
system that offers enhanced interoperability, user experience, security, and energy
efficiency. This solution has the potential to revolutionize the way residents interact with
20 | P a g e `
their living spaces, promoting the widespread adoption of smart home technology. The
following benefits will be offered to users and society:
Energy Efficiency:
Smart home technology optimizes energy consumption through intelligent systems.
Features like smart thermostats and energy-efficient appliances contribute to reduced
energy costs.
Cost Savings:
Energy-efficient devices and automated systems contribute to cost savings over time.
Monitoring and optimizing resource usage led to reduced utility bills.
Environmental Impact:
Energy-efficient practices and devices contribute to a reduced carbon footprint. Smart home
technologies promote sustainability and environmental consciousness.
21 | P a g e `