0% found this document useful (0 votes)
3 views53 pages

Smart Switch: National University of Computer and Emerging Sciences, Lahore

The document presents a final year project titled 'Smart Switch' by students from the National University of Computer and Emerging Sciences, aimed at enabling Internet of Things (IoT) devices to function without internet access. This innovative solution addresses the limitations of conventional IoT systems, particularly for elderly and disabled individuals, by establishing a local area network for reliable communication and automation. The project seeks to enhance accessibility, security, and efficiency of IoT devices, thereby making smart home technology available to users in areas with poor internet connectivity.

Uploaded by

hassanamin.6007
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)
3 views53 pages

Smart Switch: National University of Computer and Emerging Sciences, Lahore

The document presents a final year project titled 'Smart Switch' by students from the National University of Computer and Emerging Sciences, aimed at enabling Internet of Things (IoT) devices to function without internet access. This innovative solution addresses the limitations of conventional IoT systems, particularly for elderly and disabled individuals, by establishing a local area network for reliable communication and automation. The project seeks to enhance accessibility, security, and efficiency of IoT devices, thereby making smart home technology available to users in areas with poor internet connectivity.

Uploaded by

hassanamin.6007
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/ 53

National University of Computer and Emerging Sciences, Lahore

Smart Switch

Zain Gardezi 19L-1166 BS(CS)


Abu Bakar Ahmad 21L-6039 BS(CS)
Hassan Amin 21L-6181 BS(CS)

Supervisor: Ms. Aqsa Khalid

Final Year Project


March 12, 2025
Anti-Plagiarism Declaration

This is to declare that the above publication was produced under the:

Title: Smart Switch

is the sole contribution of the author(s), and no part hereof has been reproduced as it is the basis (cut
and paste) that can be considered Plagiarism. All referenced parts have been used to argue the idea
and cited properly. I/We will be responsible and liable for any consequence if a violation of this
declaration is determined.

Date: February 27, 2025

Name: Zain Gardezi

Signature:

Name: Abu Bakar

Ahmad Signature:

Name: Hassan Amin

Signature:

Author’s Declaration

This states Authors’ declaration that the work presented in the report is their own and has not been
submitted/presented previously to any other institution or organization.
Abstract

IoT (Internet of Things) devices are vulnerable to connectivity problems and external dependencies
because they heavily rely on internet access in today’s networked world. We present a unique method
for allowing IoT devices to carry on operations without the internet access, acknowledging the need
for a more robust and self-sufficient solution. To ensure dependable communication and automation
within a localized network, our solution focuses on building a strong local area connection. Our goal
is to improve accessibility and efficiency by removing the limitations of continuous internet
dependence, giving users a seamless IoT experience.
Executive Summary

Our project” Smart Switch” offers a more reliable and a much less dependent solution. It counters the
issues faced by Internet of Things (IoT) devices that depend on continuous internet connectivity for
their bare functionality. Conventional IoT systems are powerless to connectivity problems and
external dependencies because they majorly rely on internet access. Their functionality and efficiency
are entirely dependent on this reliance and without it they cannot be used to any extent. There are
many areas and places which still don’t have proper internet access, the IoT devices cannot function
there and would be termed useless, but our “Smart Switch” would bypass this disability and would
make those devices work without internet. Apart from this, the disabled people need to control the
devices by sitting or lying at their places without going near the switch boards physically, so they just
basically need to control the appliances within the house from their places. The already existing IoT
devices can help them do so after having proper internet access. This means that if the internet is not
available, the disabled people wont be able to turn on and off appliances. These IoT devices would
become useless for them as they would have to reach the switch boards physically in order to turn
appliances on or off. The same scenario can be observed for elderly people. Some have their children
and grandchildren taking care for them but some don’t, they have to do work by themselves. These
IoT devices without internet access can cause great help for them as their work would be done without
the use of internet. They would not have to get up every time to turn appliances on and off, it could
be done through ”Smart Switch” without internet access. The people living in areas where internet
access is still an issue would also want to make their homes smart. “ Smart Switch” would help them
in doing so by overcoming the internet access vulnerability of IoT devices. Lastly, removing Internet
access as a requirement will reduce the vulnerability of IoT devices, also reduce lag due to latency
problems, and also reduce the exposure of these home devices to cyber-attacks. So, eliminating the
Internet not only reduces disability but also increases the security and privacy of IoT devices. There
are some offline solutions available which are using Bluetooth which has some drawbacks. Firstly,
only one device can be connected to the system at once. Secondly, the short-range connection causes
issues even within the entire home, Bluetooth range is not sufficient. The others are using internet
access which we are trying to replace. So our project will overcome this issue, and it has not been
implemented yet.

Our project deploys a router-based Local Area Network (LAN) that allows IoT devices to operate
with- out internet access acting as a key factor. Local connectivity between IoT devices will allow
them to communicate even when there is no internet access through the creation of dedicated LAN
communication channels.
Thus, improving functionality and user experience even more.

To sum up, our project seeks to strengthen IoT devices by separating them from internet dependence
so local networks can achieve effective and secure communication. “ Smart Switch” aims to create a
reliable IoT operational experience that carries on smoothly with enhanced reliability and security.
Thus, overcoming the main vulnerability of IoT devices i.e Internet access.
TABLE OF CONTENTS vi

Table of Contents

List of Figures ix

List of Tables x

1 Introduction 1
1.1 Purpose of this Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Intended Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Definitions, Acronyms, and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Project Vision 3
2.1 Problem Domain Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Problem Elaboration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4 Goals and Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.5 Project Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.6 Sustainable Development Goal (SDG) . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.7 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.8 Business Opportunity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.9 Stakeholders Description/ User Characteristics . . . . . . . . . . . . . . . . . . . . . . . 6
2.9.1 Stakeholders Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.9.2 Key High-Level Goals and Problems of Stakeholders . . . . . . . . . . . . . . . 7

3 Literature Review / Related Work 8


3.1 Definitions, Acronyms, and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Detailed Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.1 Local Network Communication (LAN) . . . . . . . . . . . . . . . . . . . . . . 9
3.2.2 Related Research Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 Literature Review Summary Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
LIST OF FIGURES vii

3.4 Conclusion...............................................................................................................................11

4 Software Requirement Specifications 12


4.1 List of Features........................................................................................................................12
4.2 Functional Requirements.........................................................................................................12
4.3 Quality Attributes....................................................................................................................13
4.4 Non-Functional Requirements.................................................................................................14
4.5 Assumptions............................................................................................................................15
4.6 Use Cases................................................................................................................................16
4.7 Hardware and Software Requirements....................................................................................20
4.7.1 Hardware Requirements.............................................................................................20
4.7.2 Software Requirements...............................................................................................20
4.8 Graphical User Interface.........................................................................................................20
4.9 Database Design......................................................................................................................24
4.9.1 ER Diagram................................................................................................................25
4.9.2 Data Dictionary...........................................................................................................25
4.10 Risk Analysis..........................................................................................................................28
4.11 Conclusions............................................................................................................................28

5 High-Level and Low-Level Design 29


5.1 System Overview....................................................................................................................29
5.2 Design Considerations.............................................................................................................30
5.2.1 Assumptions and Dependencies.................................................................................30
5.2.2 General Constraints....................................................................................................31
5.2.3 Goals and Guidelines..................................................................................................33
5.2.4 Development Methods...............................................................................................33
5.3 System Architecture................................................................................................................33
5.3.1 Subsystem Architecture..............................................................................................19
5.4 Architectural Strategies...........................................................................................................35
5.5 Domain Model/Class Diagram................................................................................................38
5.6 Sequence Diagram...................................................................................................................38
5.7 Policies and Tactics.................................................................................................................41
5.7.1 Coding Standards and Convections............................................................................41
5.7.2 Test Strategies............................................................................................................41
5.7.3 Continuous Integration and Deployment...................................................................41
5.7.4 Source Code Organization.........................................................................................41
5.8 Conclusion..............................................................................................................................42
LIST OF FIGURES vii
i

List of Figures

2.1 Industry, Innovation and Infrastructure..............................................................................5

4.1 Cover Page.............................................................................................................................21

4.2 Home Screen..........................................................................................................................21

4.3 Bedroom Control..................................................................................................................22

4.4 Kitchen Control.....................................................................................................................22

4.5 Drying Room Control...........................................................................................................23

4.6 Schedule Overview................................................................................................................23

4.7 Set Time Interface.................................................................................................................24

4.8 Entity Relationship Diagram...............................................................................................25

5.1 Architecture Diagram of Smart System Switch.................................................................35

5.2 Class Diagram.......................................................................................................................38

5.3 Turn on Appliance Diagram................................................................................................39

5.4 Add new Appliance Diagram...............................................................................................39

5.5 Generate Log Report Diagram............................................................................................39

5.6 Assign Appliance to the User Diagram...............................................................................40

5.7 View Appliance Status Diagram..........................................................................................40

5.8 Delete Appliance Diagram...................................................................................................40


LIST OF TABLES ix

List of Tables
2.1 This summary Table is for Smart Switch11

4.6.1 Login …………………………………………………………………………………… 15


4.6.2 Control Appliances……………………………………………………………………. 16
4.6.3 Add New Appliance………………………………………………………………….... 16
4.6.4 View Appliance Status………………………………………………………………… 17
4.6.5 Edit Appliance Settings……………………………………………………………….. 17
4.6.6 Delete Appliances…………………………………………………………………….... 17
4.6.7 Schedule Appliances Control……………………………………………………….… 18
4.6.8 View Usage History…………………………………………………………………….18
4.6.9 Reset System…………………………………………………………………………… 18
4.6.10 View Control Appliance………………………………………………………….… 19
4.6.11 Data Dictionary……………………………………………………………………… 25
CHAPTER 1. INTRODUCTION 1

Chapter 1 Introduction

The traditional IoT devices are useful but they have a big limitation which is Internet access. Unfortu-
nately Internet is not available in all areas due to which the IoT devices cannot be used there. This can
be a major problem for elderly and disabled people who use them for their convenience. The people
who want to make their homes smart also face this issue due to internet availability issues they are
unable to use IoT devices and make their homes smart.

To overcome this issue and limitation of IoT devices our project (Smart Switch) will bypass the
internet access and make the IoT devices available for use without it. This will remove the biggest
limitation of IoT devices and people all over the World would be able to use IoT devices without
worrying about internet. This would further enhance the smooth operations of IoT devices as the lag
would be removed and the devices would become less prone to cyber attacks.

1.1 Purpose of this Document

This document provides a detailed technical and general overview of our FYP, Smart Switch. It will
provide details about every corner of our project, including analysis, objectives, design, implementation,
and testing as well as limitations of our project. Smart Switch aims to make IoT devices available for
all the people with and without internet access. Both these options will be available along with the
application which will provide user friendly interface and seamless experience to the user.

1.2 Intended Audience

The intended audience for this document are academic audience which is mainly composed of a panel
of professors or educationalists looking to understand and evaluate this project. In addition to this,
any concerned person who wants to comprehend the system’s operations can review certain parts of
this report. For the general non-technical audience seeking to use the platform, a simpler version will
be released which will somewhat act as a user guide.

1.3 Definitions, Acronyms, and Abbreviations

List all important definitions, acronyms, and abbreviations used in this document. For example:

SDG: Sustainable Development Goal


FYP: Final Year Project
CHAPTER 1. INTRODUCTION 2

MVP: Minimum Viable Product


UI: User Interface
UX: User Experience
LAN: Local Area Network
IoT: Internet of Things
DHCP: Dynamic Host Configuration Protocol

1.4 Conclusion

To conclude, IoT devices are helpful but there are limitations to them which we will be trying to
remove. Our project “Smart Switch” will provide IoT devices a way to work without internet access
making them safer, more reliable and faster. This will help many people in using IoT devices who are
currently unable to do so or are facing interruptions and problems using them due to internet issues.
We will not only make such system but also provide users with more features like an application to
control IoT devices with ease. Our aim is to make every home smarter.
CHAPTER 2. PROJECT VISION 3

Chapter 2 Project Vision

Smart Switch emerges as a visionary initiative set to transform the way IoT devices work. It aims to
help remove some vulnerabilities of IoT devices and make them better in terms of reliability, security
and performance. Our concept envisions a future in which majority of people will get access to IoT
devices and they will be able to make their homes smarter even without proper internet access.

2.1 Problem Domain Overview

With the ongoing advancements in the world, the IoT devices are still lagging behind due to the major
issue which is internet availability. To overcome this issue, our project’s domain focuses on helping
the IoT devices to bypass this vulnerability and helps them to operate without internet access making
them more powerful( less vulnerable), safer and faster. Our goal is to make every home smarter.

2.2 Problem Statement

When IoT devices came and revolutionized the world, the homes became smarter. This advancement
kept on increasing until a brick wall was hit which made their use limited. This was the major
problem and still is for some areas which is internet access. The areas with such issues could not use
IoT devices and still cant because of the existing solutions. To overcome this problem Smart Switch
will be bypassing this vulnerability and providing everyone a chance to use IoT devices with or
without internet access.

2.3 Problem Elaboration

Smart Switch aims to reshape the world of IoT devices by overcoming their short comings. The in-
tegration of electrical circuits with routers will bypass the internet access requirement of IoT devices.
Through this, we will be able to make sure that people from any area can use IoT devices to make
their homes smarter. The current solutions are depending on internet access heavily and some are
using Bluetooth which has proximity and efficiency issues. Smart Switch comes with a better solution
of com- bining micro-controllers and routers to bypass internet access as a requirement to provide a
seamless experience to IoT device users. Through our application, the users will be able to control
appliances easily and without any interruption.
CHAPTER 2. PROJECT VISION 4

2.4 Goals and Objectives

The list of goals and objectives decided keeping in mind Smart Switch are listed below. These goals
will serve as a foundation for developing an IoT devices controlling application. The goals and
objectives are as follows:

• Establish a Local Network: Develop a system that allows IoT devices to communicate effectively
without requiring internet access.

• Enhance Connectivity and Automation: Ensure seamless data exchange and automation within a
localized environment.

• Improve Security and Reliability: Reduce reliance on external networks, minimizing security risks
and connectivity failures.

• Develop a User-Friendly Solution: Create an intuitive and accessible platform for users to set up and
manage their IoT networks easily.

• Innovate IoT Communication: Provide a modern alternative to traditional IoT systems by enabling
efficient offline functionality.

2.5 Project Scope

Smart Switch aims to establish a mobile application for people with multiple advanced features as
enlisted in our goals. The scope of our project will include the following phases.

• Establishing Local Connectivity: We will design a network architecture that allows IoT devices
to communicate efficiently without requiring an internet connection.

• Developing a User-Friendly Interface: Users will have an intuitive interface to configure and
manage IoT devices within the local network easily.

• Ensuring Scalability and Compatibility: Our system will be designed to support a growing
number of devices and adapt to various IoT applications without major modifications.

• Enhancing Security and Reliability: By eliminating dependence on external networks, our so-
lution will offer improved data privacy and uninterrupted functionality.

• Optimizing Performance: We will refine our communication protocols to ensure low-latency,


efficient data transfer within the local network.
CHAPTER 2. PROJECT VISION 5

Overall, our project aims to provide a robust and reliable solution for IoT connectivity, ensuring
seamless device communication without the limitations of internet dependency.

2.6 Sustainable Development Goal (SDG)

2.6.0.1 SDG-9 (Industry, Innovation, and Infrastructure)

Our project aligns with Sustainable Development Goal 9 (SDG-9) by fostering innovation in IoT in-
frastructure. We aim to create a sustainable and resilient local network that enables IoT devices to
function efficiently without internet dependency.

• Enhancing Infrastructure: Our solution provides a reliable and scalable local connectivity
framework for IoT devices, reducing reliance on external networks.

• Promoting Innovation: By enabling IoT communication without internet access, we introduce a


novel approach to IoT networking, making it more accessible and efficient.

• Sustainability and Efficiency: By minimizing unnecessary internet usage, our project contributes
to energy efficiency and reduces network congestion, leading to a more sustainable IoT
ecosystem.

Our commitment to SDG-9 ensures that our technological advancements contribute to a robust, inno-
vative, and future-ready infrastructure that empowers industries and individuals alike.

Figure 2.1: Industry, Innovation and


Infrastructure
The figure represents SGD-9

2.7 Constraints

We must take into account a number of practical and technical limitations when creating our internet-
independent IoT solution, as they could affect the project’s scalability and implementation:
CHAPTER 2. PROJECT VISION 6

 Hardware Compatibility: Different manufacturers’ IoT devices employ different communication


proto- cols (such as Bluetooth, Zigbee, and Wi-Fi), which could make integration difficult.

 Restricted Communication Range: Local area networks (LAN’s) have a limited communication
range, which may necessitate additional infrastructure for larger environments, in contrast to
cloud-based solutions.

 Data Processing and Storage: In the absence of cloud services, data must be processed and stored
locally, which calls for effective resource management.

 Security Issues: Although reducing reliance on the internet improves security, internal network
weak- nesses (such as illegal access and local attacks) still require attention.

 Scalability Issues: To maintain low latency and efficiency when adding more devices to the
network, optimized network protocols may be needed.

2.8 Business Opportunity

Our project presents a unique business opportunity by addressing the increasing demand for internet-
independent IoT solutions. As industries and individuals seek reliable, secure, and cost-effective IoT
connectivity, our solution provides multiple revenue streams, including:

• Licensing & Enterprise Solutions: Offering businesses and industries a scalable IoT connectiv-
ity framework that eliminates internet dependency.

• Hardware Integration & Partnerships: Collaborating with IoT device manufacturers to embed
our solution into their products for seamless offline communication.

• Consultation & Custom Implementation: Assisting businesses and smart home users in setting
up tailored local IoT networks based on their specific needs.

As IoT adoption continues to grow, our project taps into a vast and evolving market, catering to
industries, smart homes, and research communities looking for efficient, secure, and independent IoT
infrastructure.

2.9 Stakeholders Description/ User Characteristics

The stakeholders for our internet independent IoT solution include end-users, businesses, and
adminis- trators who interact with the system.
CHAPTER 2. PROJECT VISION 7

2.9.1 Stakeholders Summary

 End Users (Smart Home Users & General Consumers): people who wish to allow IoT devices to
communicate locally without using the internet. They will be able to control automation within
their local network, monitor status, and set up and manage their devices using an easy-to-use
interface.

 Companies & Sectors: businesses seeking dependable and safe IoT connectivity without relying
on ex- ternal networks. To guarantee continuous operations, they can incorporate this solution
into automation, security, and manufacturing systems.

 Administrators of systems: In charge of overseeing, setting up, and maintaining the Internet of
Things network in a commercial or industrial environment. They will have sophisticated control
over things like security enforcement, device authentication, and network configuration.

Our system ensures smooth IoT communication without reliance on the internet by offering a flexible
solution that serves both individual users and industries.

2.9.2 Key High-Level Goals and Problems of Stakeholders

Efficiency Goal: Ensure seamless local communication between IoT devices without internet
depen- dency, reducing downtime and improving automation.

Problem: Traditional IoT devices rely heavily on internet access. Users may struggle with device
disconnection issues in remote areas or during network failures.

Automating Processes Goal: Automate IoT device communication within a local area network,
min- imizing the need for constant manual control.

Problem: Many IoT devices are not designed for offline operation, requiring custom configurations
or modifications to enable local automation. Users with limited technical expertise may find setup
challenging.

Ensuring Reliable & Secure Connectivity Goal: Provide secure and private IoT communication
without reliance on external networks.

Problem: Local networks can still be vulnerable to unauthorized access if security measures are not
properly implemented.
CHAPTER 3. LITERATURE REVIEW / RELATED 8
WORK
Chapter 3 Literature Review / Related Work

Details of the relevant work completed are provided in the section that follows. It contains details on
a few of the IoT devices that have been produced in the past that are related to our Smart Switch.
Examining and comparing those creations is our main reason to include this section. It will give the
readers an understanding of the unique features of our Smart Switch that are not present in those
devices which makes our Smart Switch superior.

3.1 Definitions, Acronyms, and Abbreviations

Some of the important acronyms, abbreviations, and definitions are given below:

IoT (Internet of Things) – A network of interconnected devices that communicate and exchange data.

LAN (Local Area Network) – A network that connects devices within a limited area, such as a home or
office, without requiring internet access.

Router – A networking device that directs data between devices within a network and can function as a
central hub for a LAN.

Wi-Fi – A wireless networking technology that allows devices to communicate over a local net- work.

Gateway – A device that acts as a bridge between different networks or protocols, enabling com-
munication between devices.

SSID (Service Set Identifier) – The name of a Wi-Fi network used to identify it for device
connections.

MAC Address (Media Access Control Address) – A unique identifier assigned to network in- terfaces
for communication within a LAN.

DHCP (Dynamic Host Configuration Protocol) – A network protocol that assigns IP addresses to
devices dynamically.

Encryption – A method of securing communication by converting data into a secure format.


dynamic IP – A dynamic IP address assigned to a device, ensuring consistent network access within a
LAN.
CHAPTER 3. LITERATURE REVIEW / RELATED 9
WORK

3.2 Detailed Literature Review

The strategies for improving IoT device automation and communication - local network communication
(LAN), alternative IoT protocols, and security considerations are examined in the next subsections.
Then, to obtain knowledge about the world applications relevant to our problem domain, we examine
the current commercial IoT solutions, and finally we compare them to our solution, the Smart Switch,
to show what is different, unique, and better about our project.

3.2.1 Local Network Communication (LAN)

In this part, four articles are covered on IoT communication research, which showcase various strate-
gies to improve device automation and connectivity. These studies examine the difficulties of
internet- dependent systems and serve as the basis for our project’s focus on enhancing IoT
automation within a LAN-based system.

3.2.2 Related Research Work

3.2.2.1 Summary of the research item

1. Internet-Based Automation for Smart Homes (Study 1: 2017) The 2017.pdf study introduces an
Internet of Things (IoT)-based smart home automation system that requires internet access to allow
for remote access. The system incorporates multiple sensors and Raspberry Pi to operate smart home
equip- ment, enabling capabilities like remote control, security monitoring, and energy conservation.
However, the dependence on an internet connection introduces potential risks such as network
failures, latency issues, and data privacy concern

2. Bluetooth-Based Home Automation (Study 2) The study ”Bluetooth Home Automation System”
by Priyanka Sharma et al. (2021) proposes a Bluetooth-based home automation system using Arduino
and mobile applications. It provides cost-effective, low-power local control, but its short range (10–
100m) restricts scalability. The system allows users to operate appliances such as lights, fans, and
other elec- tronic devices remotely via a smartphone.

3. Bluetooth-Based Home Automation (Study 3) Aryan Singh et al.’s paper ”Arduino-Based Home
Au- tomation Using Bluetooth and Android Smartphone” (2021) examines a comparable Bluetooth-
based Internet of Things automation system with an emphasis on energy economy and ease of use.
While it provides dependable short-range automation by enabling device management via Bluetooth
communi- cation with an Arduino microcontroller, its lack of long-range connectivity restricts its
applicability in more expansive smart home settings.
CHAPTER 3. LITERATURE REVIEW / RELATED 10
WORK
4. Internet-Dependent IoT Smart Home System (Study 4 - 2021) A cloud-based IoT automation
system that depends on internet connectivity for remote control is the subject of the study ”Internet-
of-Things Based Smart Home Automation System Using Android Phone” by Salman Iqbal et al.
(2021). To control smart home appliances, em combines a Raspberry Pi, multiple sensors, and an
Android app. Although this method provides flexibility and remote access, it also raises privacy
concerns due to latency, security risks, and reliance on network availability. Additionally, because the
system is cloud- based, user data is stored externally.

3.2.2.2 Critical analysis of the research item (Strengths and Weaknesses)

• Strengths:

– Internet-based IoT automation enables remote access, allowing users to control devices
from anywhere.

– Cloud connectivity in internet-based systems enhances scalability, integrating multiple


devices seamlessly.

– Bluetooth-based automation is cost-effective and easy to implement using smartphones


and microcontrollers.

– Bluetooth-based systems provide secure local control without requiring an internet con-
nection.

• Weaknesses:

– Internet-based IoT systems depend on external networks, making them vulnerable to


latency, outages, and security risks.

– Cloud-based systems store user data externally, raising privacy concerns.

– Bluetooth has a short range, requiring proximity between devices for reliable communica-
tion.

3.2.2.3 Relationship to the proposed research work

The research offers important insights on IoT communication tactics that are specifically pertinent to
our project. Remote access is made possible by internet-based IoT automation, however there are
security and network dependency issues as well.

Through LAN-based connection, our Smart Switch project seeks to enhance IoT automation,
guaranteeing:
CHAPTER 3. LITERATURE REVIEW / RELATED 11
WORK
• Seamless device control without internet dependency, using Wi-Fi-based LAN

• Enhanced security and privacy, as data remains within the local network instead of being stored
on cloud servers.

• Reduced latency and improved reliability, ensuring uninterrupted operation even during net-
work failures.

By eliminating cloud-based, internet, and Bluetooth reliance, our system will provide a more secure,
reliable, and efficient IoT automation solution, overcoming the key challenges identified in all these
articles.

3.3 Literature Review Summary Table

Table 3.1: This summary Table is for Smart Switch

Article Method Results Limitations


IoT Smart Experimental Developed cloud-based High internet dependency, secu-
Home prototype home automation using rity risks
(2017) [1] Raspberry Pi
IoT Smart Case study Integrated mobile app for Requires continuous internet,
Home controlling IoT devices raises data privacy concerns
(2021) [2] remotely
Bluetooth- Prototype Achieved cost-effective Limited range (10-100m), no re-
Based Home implementa- local IoT control using mote access
Automation tion Bluetooth
[3]
Wi-Fi-Based Literature Discussed IoT communi- Requires dynamic IP and local
IoT Systems review cation using Wi-Fi network configuration.Total de-
[4] pendence on internet access.

3.4 Conclusion

It can be clearly seen that improvements were made in IoT devices, but there is still a clear
vulnerability that has not been removed yet. This weakness is the dependence of IoT devices on the
internet, and without Internet access, IoT devices are powerless. To overcome this weakness, some
solutions were introduced, like converting all this dependence on Bluetooth but it was not successful
due to range issues and connectivity issues of Bluetooth as only one device can be connected at a time.
The smart switch is introduced, which will make IoT devices work on the Internet and also without
the internet. This will eliminate the vulnerability of IoT devices and make them stronger, faster, and
safer.
CHAPTER 4. SOFTWARE REQUIREMENT 12
SPECIFICATIONS
Chapter 4 Software Requirement Specifications

This chapter provides a detailed description of the software requirements for our Project (Smart
Switch). It includes the list of features, the functional requirements, the quality attributes, the non-
functional requirements, related assumption, the hardware and software requirements, the use cases,
graphical user
interface, all necessary diagrams and figures, along with the risk analysis of our project Smart Switch.

4.1 List of Features

The following features will be available in our system.

 A simple interface for users to control home appliances (like bulbs and fans) remotely.
 Control appliances via a dynamic IP address through a mobile app.
 Only dependency on Wi-Fi, ensuring the system works in areas with limited internet connectivity.
 Real-time synchronization between the app and appliance states.
 Support for multiple appliances to be controlled simultaneously.
 Easy-to-use mobile app for controlling devices without manually entering IP addresses.

4.2 Functional Requirements

This section describes the functional requirements for Users and the System.

4.2.1 Functional Requirements for Users

 The system shall allow users to log into the mobile app using their credentials.
 The system shall allow users to control home appliances (e.g., bulbs, fans) remotely via a
dynamic IP address.
 The system shall allow users to tum appliances on/off using the mobile app.
 The system shall allow users to adjust fan speed using the mobile app.
 The system shall allow users to view the real-time status of appliances (on/off) on the mobile app.
 The system shall allow users to add or remove appliances from the system.
 The system shall allow users to access the system without requiring an internet connection (local
control only).
CHAPTER 4. SOFTWARE REQUIREMENT 13
SPECIFICATIONS

4.2.2 Functional Requirements for System

 The system shall assign a dynamic IP address to the ESPS266 microcontroller for
communication.
 The system shall allow multiple appliances to be controlled simultaneously.
 The system shall synchronize the status of appliances between the mobile app, and physical
devices.
 The system shall ensure safe operation of appliances using relays.
 The system shall provide a user-friendly interface for elderly and disabled users.
 The system shall work with a variety of appliances (e.g., bulbs, fans) and voltage configurations.
.
4.3 Quality Attributes

The project aims to incorporate the following fundamental quality attributes in order to ensure the
prevention of application defects. Each attribute Shall be used to evaluate the application quality and
performance during operation.

4.3.1 Reliability

It is important to ensure the reliability of the project. The system has to work independently; that is,
ensure uninterrupted control over the appliances. It has to keep track of their working state and
recover from disturbances within a short time.

4.3.2 Flexibility

The system must be capable of accommodating new appliances or new methods of controlling them in
the future. It has to permit individual users to alter the parameters, such as appliance titles or
preferences.

4.3.3 Security

The system needs to guarantee the privacy of the user and make sure that only authorized persons can
operate the appliances. Access to the dynamic IP address and control interfaces should be blocked for
non-approved users.

4.3.4 Maintainability

The system ought to be maintained easily: the code should be clear and modular. It should also enable
withdrawing some features and replacing them with new ones.
CHAPTER 4. SOFTWARE REQUIREMENT 14
SPECIFICATIONS

4.3.5 Usability

The system should have a friendly user interface for the mobile. It should allow elderly and disabled
people to easy navigate while providing helpful instructions.

4.3.6 Performance

The system needs to react to user requests without lag, supporting multiple appliances at once. It
needs to support stand-alone operation at busy times.

4.3.7 Efficiency

The system needs to react to user requests without lag, supporting multiple appliances at once. It
needs to support stand-alone operation at busy times.

4.4 Non-Functional Requirements

This part describes the non-functional requirements to make the system performant, usable, and
dependable.

4.4.1 Performance

 The system shall load the appliance control interface in under 3 seconds.
 The system shall ensure a response time of less than 2 seconds for user commands.
 The system shall handle up to 10 connected appliances simultaneously without performance
degradation.

4.4.2 Usability

 The system should enable users to manage appliances in not more than 3 steps through the
mobile app.
 The system will have an easy-to-use and simple interface for users of all technical
proficiency.
 The system will ensure compatibility with varying screen sizes and devices.

4.4.3 Scalability

 The system shall support the addition of up to 20 appliances in the future.


 The system shall accommodate multiple users accessing the system simultaneously.
CHAPTER 4. SOFTWARE REQUIREMENT 15
SPECIFICATIONS
 The system shall provide a consistent and unified platform for controlling all connected
appliances.

4.4.4 Security

 The system will protect all data exchange between the mobile app, and ESP8266
microcontroller.
 The system shall encrypt user credentials and ensure only authorized users can access the
system.
 The system shall prevent unauthorized access to the dynamic IP address and control
interfaces.

4.5 Assumptions

The following assumptions have been made for the system.


 Users will have access to a smartphone or computer to control the system.
 Appliances like bulbs and fans will be compatible with the relay used in the system.
 Users will have basic knowledge of how to use a mobile app.
 The system will operate in an environment with a stable electrical power supply.

4.6 Use Cases

Following are the use cases identified in our mobile application.

4.6.1 Login

Name Login
Actors User
Summary The user shall provide their credentials on the login form, and after
successful verification, they shall be redirected to the control interface.
Pre-Conditions The user must be registered in the system and not already logged in.
Post-Conditions The user's session is successfully established, and they are redirected
to the control interface.
Special Requirement None
Basic Flow
Actor Action System Response
1 The user opens the login page. 2 The login page is displayed, asking for
username and password.
3 The user enters valid credentials. 4 The system verifies the credentials,
establishes a session, and redirects the user
to the control interface.
Alternate Flow
3 The user enters invalid credentials. 4-A The system responds with an error
message: "Incorrect username or password.
"

4.6.2 Control Appliances


CHAPTER 4. SOFTWARE REQUIREMENT 16
SPECIFICATIONS

Name Control Appliances


Actors User
Summary The user controls appliances via the mobile app.
Pre-Conditions The user must be logged in, and appliances must be connected.
Post-Conditions The appliance turns on/off or adjusts settings as requested.
Special Requirement The system shall ensure that only one user can control an
appliance at a time to avoid conflicts.
Basic Flow
Actor Action System Response
1 Selects an appliance. 2 Displays the appliance’s current status.
3 Turns it on/off or adjusts settings. 4 Updates the appliance state and confirms
the change.
Alternate Flow
3 Selects an appliance that is not connected. 4-A Displays error message: "Appliance not
connected."

4.6.3 Add New Appliance

Name Add New Appliance


Actors User
Summary The user adds a new appliance to the system.
Pre-Conditions The user must be logged in, and the appliance must be compatible.
Post-Conditions The appliance is added and can be controlled.
Special Requirement None
Basic Flow
Actor Action System Response
1 Opens the "Add Appliance" section. 2 Displays a form to enter appliance details.
3 Enters appliance details and confirms. 4 Adds the appliance and confirms success.
Alternate Flow
3 Enters invalid details. 4-A Displays error message: "Invalid appliance
details."

4.6.4 View Appliance Status

Name View Appliance Status


Actors User
Summary The user views the real-time status of connected appliances.
Pre-Conditions The user must be logged in, and appliances must be connected.
Post-Conditions The system shows the current status of all appliances.
Special Requirement None
Basic Flow
Actor Action System Response
1 Opens the "Appliance Status" section. 2 Displays the status of all connected
appliances.
Alternate Flow
1 No appliances are connected. 2-A Displays message: "No appliances
connected."

4.6.5 Edit Appliance Settings

Name Edit Appliance Settings


Actors User
Summary The user edits the name or preferences of a connected appliance.
Pre-Conditions The user must be logged in, and the appliance must be connected.
Post-Conditions The appliance settings are updated.
Special Requirement None
Basic Flow
CHAPTER 4. SOFTWARE REQUIREMENT 17
SPECIFICATIONS
Actor Action System Response
1 Selects an appliance to edit. 2 Displays current settings.
3 Changes the settings and confirms. 4 Updates settings and confirms success.
Alternate Flow
3 Enters invalid settings. 4-A Displays error message: "Invalid settings
entered."

4.6.6 Delete Appliance

Name Delete Appliance


Actors User
Summary The user removes an appliance from the system.
Pre-Conditions The user must be logged in, and the appliance must be connected.
Post-Conditions The appliance is deleted and can no longer be controlled.
Special Requirement The system shall require a confirmation step before deleting an
appliance to prevent accidental deletion.
Basic Flow
Actor Action System Response
1 Selects an appliance to delete. 2 Displays a confirmation message.
3 Confirms deletion. 4 Deletes the appliance and confirms success.
Alternate Flow
3 Cancels the deletion. 4-A Returns to appliance list without deleting.
CHAPTER 4. SOFTWARE REQUIREMENT 18
SPECIFICATIONS
4.6.7 Schedule Appliance Control

Name Schedule Appliance Control


Actors User
Summary The user schedules an appliance to turn on/off at a specific time.
Pre-Conditions The user must be logged in, and the appliance must be connected.
Post-Conditions The schedule is saved, and the appliance operates automatically at the set
time.
Special Requirement None
Basic Flow
Actor Action System Response
1 Selects an appliance to schedule. 2 Displays scheduling form.
3 Sets schedule and confirms. 4 Saves schedule and confirms success.
Alternate Flow
3 Enters an invalid schedule. 4-A Displays error message: "Invalid schedule
entered."

4.6.8 View Usage History

Name View Usage History


Actors User
Summary The user views past activity of connected appliances.
Pre-Conditions The user must be logged in, and appliances must be connected.
Post-Conditions The system displays appliance usage history.
Special Requirement The system shall store usage history for up to 30 days.
Basic Flow
Actor Action System Response
1 Selects an appliance to view history. 3 Displays the appliance’s past activity.
Alternate Flow
1 No history available. 2-A Displays message: "No usage history
available."

4.6.9 Reset System

Name Reset System


Actors User
Summary The user resets the system to default settings.
Pre-Conditions The user must be logged in.
Post-Conditions The system resets, disconnecting all appliances.
Special Requirement The system shall require a confirmation step before resetting to
prevent accidental resets.
Basic Flow
Actor Action System Response
1 Opens "Reset System" section. 2 Displays a confirmation message.
3 Confirms reset. 4 Resets system and confirms success.
Alternate Flow
3 Cancels reset. 4-A Returns to main menu without resetting.

4.6.10 View Connected Appliances

Name View Connected Appliances


Actors User
Summary The user shall view a list of all connected appliances.
Pre-Conditions The user must be logged in.
Post-Conditions The system displays the list of connected appliances.
Special Requirement None
Basic Flow
Actor Action System Response
CHAPTER 4. SOFTWARE REQUIREMENT 19
SPECIFICATIONS
1 The user navigates to the "Connected 2 The system displays the list of connected
Appliances" section. appliances.
Alternate Flow
1 No appliances are connected. 2-A The system responds with a message: "No
appliances connected."
CHAPTER 4. SOFTWARE REQUIREMENT 20
SPECIFICATIONS
4.7 Hardware and Software Requirements

This section outlines the hardware and software requirements for the development and operation of the
Smart Switch system.

4.7.1 Hardware Requirements

The following hardware components are required for the development and operation of the
system.
 ESP8266 Microcontroller: For controlling appliances and communication with the
mobile
 app.
 Relays: For switching and controlling AC appliances like bulbs and fans.
 Router: For assigning dynamic IP addresses to the ESP8266 and enabling local
communication.
 Computer System: For development and testing.
 Smartphone or Tablet: For accessing the mobile app to control appliances.
 Power Supply: Stable electrical power supply for the ESP8266 and connected appliances.

4.7.2 Software Requirements

The following software components are required for the development and operation of the
system.
 Arduino IDE: For programming the ESP8266 microcontroller.
 Mobile App Development Framework: Flutter or React Native for developing the mobile
app.
 Version Control System: Git for managing the codebase.
 Code Editor: Visual Studio Code or any other IDE for development.

4.8 Graphical User Interface

Here, we present corresponding screenshots of the graphical user interface (GUI) of the Smart Switch
system using Figma. The Smart Switch appliance screens are designed primarily for ease of use while
operating household appliances.
CHAPTER 4. SOFTWARE REQUIREMENT 21
SPECIFICATIONS

Figure 4.1: Cover Page


This figure represents the cover page of our system

Figure 4.2: Home Screen


The figure represents the home screen of our system
CHAPTER 4. SOFTWARE REQUIREMENT 22
SPECIFICATIONS

Figure 4.3: Bedroom Control


This figure represents the control setups in bedroom

Figure 4.4: Kitchen Control


This figure represents the control setups in kitchen
CHAPTER 4. SOFTWARE REQUIREMENT 23
SPECIFICATIONS

Figure 4.5: Drying Room Control


This figure represents the control setups in drying room

Figure 4.6: Schedule Overview


This figure represents the schedule overview
CHAPTER 4. SOFTWARE REQUIREMENT 24
SPECIFICATIONS

Figure 4.7: Set Time Interface


This figure represents the time setting interface for daily tasks

4.9 Database Design

This section provides an overview of our database design. We have included an ER diagram and Data
dictionary to show different classes, their attributes and relationships among them.
CHAPTER 4. SOFTWARE REQUIREMENT 25
SPECIFICATIONS

4.9.1 ER Diagram

Figure 4.8: Entity Relationship Diagram


This figure represents all the entities and their relationship for the project in the form of an ER diagram

4.9.2 Data Dictionary

Table 4.13: Data Dictionary

This table represents the data dictionary of our system


Nullabl Relationsh Relationsh
Entity Attribute Data Type Description
e ip To ip Type
User Unique ID of
Number(P the user
user_id No - -
K) (Primary
Key).
Unique
Varchar(10
username No - - username of
0)
the user.
Password Varchar(10 No - - Password of
0) the user
CHAPTER 4. SOFTWARE REQUIREMENT 26
SPECIFICATIONS
(hashed).
Varchar(10 Email address
Email No - -
0) of the user.
Varchar(10 Full name of
Full_name No - -
0) the user.
Unique ID of
the
Number(P
Appliance_id No - - appliance
K)
(Primary
Key).
Name of the
appliance
Varchar(10 (e.g.,
Name No - -
0) "Living
Room
Bulb").
Appliance
Type of the
appliance
Varchar(50
Type No - - (e.g.,
)
"Bulb",
"Fan").
Current status
of
Varchar(10 the appliance
status No - -
) (e.g.,
"ON",
"OFF").
Unique ID of
Number(P the relay
Relay_id No - -
K) (Primary
Key).
Relay ID of the
connected
Number(P
Appliance_id No Appliance 1 to 1 appliance
K)
(Foreign
Key).
Unique ID of
the
Microcontroller Number(P
No - - microcontroll
_id K)
er (Primary
Key).
IP address
assigned to
ESP8266 Varchar(15
Ip_address No - - the
Microcontroll )
microcontroll
er
er.
Current status
of the
Varchar(10 microcontroll
status No - -
) er (e.g.,
"Active",
"Inactive").
Router Unique ID of
Number(P the router
Router_id No - -
K) (Primary
Key).
Varchar(50 SSID of the
Ssid No - -
) router.
Password Varchar(10 No - - Password of
CHAPTER 4. SOFTWARE REQUIREMENT 27
SPECIFICATIONS
) the router.
Current status
of the router
Varchar(10
status No - - (e.g.,
)
"Active",
"Inactive").
Unique ID of
Number(P the log
Log_id No - -
K) (Primary
Key).
ID of the
appliance
Number(P associated
Appliance_id No Appliance 1 to N
K) with the log
(Foreign
Key).
Log ID of the user
who
Number(P performed the
User_id No User 1 to N
K) action
(Foreign
Key).
Action
performed
Varchar(50
action No - - (e.g., "Turned
)
ON", "Turned
OFF").

4.10 Risk Analysis

They are risks associated with the development, maintenance, and scalability of the Smart Switch
project. They are categorized into technical, business, and ethical/privacy risks.

4.10.1 Technical Risks

 Hardware Compatibility: The system is founded on the ESP8266 microcontroller and relays to
 switch appliances. If they become obsolete or no longer supported in the future, it can interfere
the operation of the system.
 Scalability Issues: With more devices being connected, the system may experience performance
 problems, i.e., lag in functioning devices or handling multiple requests at once.

4.10.2 Business Risks

 Financing Needs: Running the system locally or in the cloud may require future funding.
 Expanding the size of the system to support more users or appliances may also require
additional funding.
 Market Competition: The home automation market is competitive. New entrants or new
technologies can emerge, and it might be challenging to alter the system.
CHAPTER 4. SOFTWARE REQUIREMENT 28
SPECIFICATIONS
 User Adoption: The system will be used by disabled and elderly users, who might not easily
adopt new technology. User adoption problems may detract from the project's success.
 Maintenance Costs: Periodically maintenance, upgrade, and patching must be done, which may
need extra resources and developers and therefore contributes to operation costs.

4.11 Conclusion
In short, this chapter gives a detailed description of the Software Requirement Specifications of the
Smart Switch project. The chapter contains the key features, functional and non-functional
requirements, and quality attributes needed to make the system an efficient and user-friendly solution
for home automation. The chapter gives added emphasis to usability, flexibility, and security when
designing the system to support aged, disabled users and low internet connectivity regions.
Use case and use case description tables define system functionality and user interaction, providing us
with a clear picture of how the system is going to be. Hardware and software requirements provide a
development and deployment plan for the system, whereas the risk analysis defines potential
problems and controls to ensure that the project becomes successful.
This chapter gives an ultimate guide on how to use and design the Smart Switch system, which can be
a firm foundation for producing a stable, cost-effective, and accessible home automation solution.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 29

Chapter 5: High-Level and Low-Level Design

This chapter contains the High- and Low-level design of the system using various methods. This
includes diagrammatic representations of the system through Sequence and Architecture Diagrams. It
will also include an overview of the system and its different components.

5.1 System Overview

Smart Switch system is intended to provide an inexpensive, Wi-Fi-free-based remote control device
for home electronics. It utilizes the ESP8266 microcontroller to enable control through a fixed IP
address so that it would be accessible in areas with minimal internet coverage.

5.1.1 Interactive User Interface

The system shall possess an interactive and intuitive interface for the mobile application. The
interface will show the status of the plugged-in appliances, e.g., whether they are on or off, and will
allow users to switch them off or on using a single touch. The user interface shall be responsive so
that it can adapt to various devices, e.g., smartphones, tablets, and desktops.

5.1.2 Appliance Control Module

This module provides remote control of appliances such as bulbs and fans via the mobile app. For
fans, the module will support speed control via Pulse Width Modulation (PWM) or triac-based phase
control. The system will offer real-time synchronization between the app and the actual appliance
state with adequate feedback to the user.

5.1.3 Safety and Security Module

The system will incorporate safety features such as fuses and insulation to prevent electrical hazards.
The user credentials and appliance control data will be encrypted to secure data. The system will
prevent unauthorized use by requiring login credentials for control, meaning the system will ensure
that only registered users can operate the appliances.

5.1.4 Local Network Communication

The system will use the local router to provide dynamic IP addresses to devices and also to the
ESP8266 microcontroller. The ESP8266, and the mobile app will be talking on the local network, and
therefore there will be no Wi-Fi or internet connection required. This makes the system operational
even in places with weak or no internet connectivity.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 30

5.2 Design Considerations

This chapter describes the significant issues that should be addressed or resolved before taking a final
decision on a full design solution to the Smart Switch system.

5.2.1 Assumptions and Dependencies

Design of the Smart Switch system has been based upon several assumptions and dependencies that
will need to be considered in its development.

5.2.1.1 Related Software or Hardware

It is assumed that users possess common hardware pieces, i.e., a smartphone or computer, and a stable
local network. The system relies on the ESP8266 microcontroller, triacs, and relays to control
appliances. Users must have devices capable of running the mobile app.

5.2.1.2 Operating Systems

The mobile app will be supported on top operating systems such as Android and iOS.

5.2.1.3 End-User Traits

End-users are most likely to have little knowledge about the use of mobile apps. The system is
designed to assist disabled and aged users by making the interface easy and intuitive.

5.2.1.4 Possible and/or Probable Changes in Functionality

Home automation technology continues to develop with each new control technology and user
demand emerging from time to time. The Smart Switch system is easily adaptable to future changes,
i.e., integration of new devices or more advanced control techniques.

5.2.2 General Restrictions

There are some limitations and constraints across the world which play a key role in developing the
Smart Switch system.

5.2.2.1 Hardware or Software Environment

The system requires a stable local area network connection and the suitable hardware parts, such as
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 31

the ESP8266 microcontroller and relays. Modification in the network or in the performance of the
hardware may affect the operational capability of the system.

5.2.2.2 End-User Environment

The usability of the system comes from the end-user's knowledge of standard mobile applications.
The interface is intuitive and easy to use so that users with any level of technical expertise can operate
the system effectively.

5.2.2.3 Availability or Volatility of Resources

The system is dependent on the presence of hardware resources and local network resources. Any
interference in these resources may affect the performance of the system.

5.2.2.4 Standards Compliance

The system is compatible with common communication protocols, i.e., HTTP for data exchange
between the mobile application and microcontroller. The interface should be responsive and
accessible in order to allow compatibility with various devices.

5.2.2.5 Interoperability Requirements

The system should be fully compatible with the ESP8266 microcontroller and devices attached to it.
The mobile app, and microcontroller should communicate effectively and reliably.

5.2.2.6 Interface/Protocol Requirements

The system is based on common communication standards, including HTTP for data communication
between the mobile application and microcontroller. The system is responsive and accessible to allow
for compatibility with devices.

5.2.2.7 Data Repository and Distribution Requirements

The system uses a local database to store appliance control data and user credentials. The database
needs to be secure, efficient, and scalable enough to accommodate the data needs of the system.

5.2.2.8 Security Requirements

The system should provide data security by encrypting control data of appliances and passwords of
users. The system should not be accessed by any unauthorized user through secure login mechanisms.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 32

5.2.2.9 Memory and Other Capacity Limitations

The system has to work within the limitations of the memory and processing capacity of the ESP8266
microcontroller. Resourceful utilization will avoid frictional impacts on system operation.

5.2.2.10 Performance Requirements

The system should also ensure timely response to the input from the user, with no lag in the control of
the appliances. The system should also have the capability to control the appliances in groups without
degrading its performance.

5.2.2.11 Network Communications

The system utilizes a continuous local network to allow communication among the mobile
application, and the microcontroller. Network interference will cause the performance of the system to
be weakened.

5.2.2.12 Verification and Validation Requirements

There should be extensive testing to validate the efficacy and reliability of the system. This includes
testing the hardware components, the software functionalities, and the user interface to provide a
smooth user experience.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 33

5.2.3 Goals and Guidelines

Designing and developing the Smart Switch system follow certain objectives and principles in
succeeding in this task. The system is created upon the principle of KISS (Keep It Simple, Stupid).
This is to ensure that the system's interface and functionality are not overly complex and are
simplified. This keeps the complexity level low and raises the usability level of the system. The
system is also scalable, and as a result the system can introduce new users and appliances in the
future. This allows the system to grow and evolve with evolving user needs. The system is simple to
use, and the interface is designed simple and intuitive. This is particularly required for disabled and
elderly users, who may not necessarily be very technologically literate.

5.2.4 Development Methods

The Smart Switch system is designed with the Agile method, which allows flexibility, responsiveness,
and product quality. The Agile process provides for iterative development, where the feedback is
collected, and changes are made in the development process on the way. The system remains user-
requirement-compliant and is made flexible to evolving requirements. The development process is
handled through the Scrum process with regular sprints and progress meetings. Teamwork becomes
possible through this process and the project continues to move as per the schedule. Continuous
deployment and integration are followed by the system so that the improvements and updates can be
deployed effectively and in a way that the user experience is not hampered.

5.3 System Architecture

This chapter provides a general overview of the internal and external system structure of the Smart
Switch system. It describes the segmentation of the system function and responsibility into
subsystems or components and how the components cooperate in order to accomplish the intended
function. A diagrammatic system structure is also presented to provide a visual impression.

5.3.1 Subsystem Architecture

Smart Switch system is segregated into various top-level modules and each module performs pre-
defined operations and tasks. The modules interact with each other to deliver a seamless user
experience in remote controlling home appliances. The system design is in a manner that it is
modularity-friendly, scalable, and maintainable.

5.3.1.1 Major Responsibilities and Roles


CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 34

The fundamental activities of the system are user interaction, appliance control, scheduling, and safety
and security. The user interaction module gives the users a platform whereby they can command
appliances, and the appliance control module manages on/off status of the devices connected. The
scheduling module enables the users to schedule appliance operation, and the safety and security
module prevents unsafe operation.

5.3.1.2 Top-Level Components

The system is comprised of the following high-level modules: the User Interface (Mobile App), the
ESP8266 Microcontroller, Relays, and the Local Router. The User Interface gives a user an
interactive interface to manage appliances, monitor their status, and schedule them. It sends data to
and from the ESP8266 Microcontroller via the Local Router, which dynamically allocates dynamic IP
addresses and provides error-free data transfer in the local network.

5.3.1.3 Component Interaction

The components in conjunction provide instant control. For instance, if you switch a bulb on using the
mobile app, the instruction is relayed to the ESP8266 Microcontroller via the Local Router. The
microcontroller energizes the relevant relay, and the relay switches on the bulb. The user interface
allows users to control devices in a very efficient and effective manner.

5.3.1.4 Reasons for System Decomposition

The system is divided into module units to facilitate scalability, maintenance, and flexibility. This
division allows each module to be developed, tested, and serviced separately. This facilitates future
expansion, for example, adding new appliances or advanced control methods.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 35

5.3.2 Diagrammatic Representation

The architecture of the system is depicted graphically below:

Figure 5.1: Architecture Diagram of Smart Switch System

This is the architecture diagram of the system

5.3.3 External Architecture

The Smart Switch system communicates with outside systems in the following way. The system uses
a local router to provide an interface for the ESP8266 Microcontroller and the user interface to
communicate. The external communications are kept to a minimum because the system is intended to
run mostly in a local network.

5.3.4 Existing Components

The Smart Switch system employs no existing parts. The components, ranging from the User
Interface to the ESP8266 Microcontroller to the Relays, are all custom-built to fulfill the particular
requirements of the project. This makes the system bespoke for the particular requirements of its
prospective user and readily modifiable in the future as requirements evolve.

5.4 Architectural Strategies

This section documents the steps that have been utilized in designing the Smart Switch system. It
tracks the most crucial design choices and their rationale so that the structure of the whole system and
top-level abstractions suit the system's purpose and demands.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 36

5.4.1 Choice of Technologies

The choice of technology for the Smart Switch system was based on efficiency, scalability, and ease
of development. The board was selected because it is compatible with the ESP8266 for Wi-Fi
communication support and appliance control in an efficient manner. Its microcontroller and low
price make it an ideal choice for the needs of the system. Arduino IDE was used during ESP8266
coding because it is microcontroller friendly, has a wide library of resources, and is easy to use.
Flutter was used during mobile app development because it is cross-platform compatible so that the
app would be ideally suited for Android and iOS. A local database was used compared to cloud
technology so that the system would run without the use of the internet, thus making it an ideal choice
for low-connectivity regions.

5.4.2 Reuse of Existing Software Components

To speed up development and make it reliable, some of the existing software modules were reused.
Pre-built libraries for Arduino for the ESP8266 were employed to manage Wi-Fi communication and
relay control to save development time and provide stable functionality. Reusable Flutter packages,
including those for UI composition and state management, were utilized in the mobile app to optimize
development.

5.4.3 Extension or Enhancement Future Plans

The Smart Switch system architecture is built to be scalable and modular so that future development
can be carried out. Among the key plans are adding new relay modules for integrating other
appliances, like smart plugs or air conditioners, and modifying the control logic. Though the system at
present works on a local network, in future versions there can be incorporation of cloud services to
provide remote access and also more features such as energy monitoring. The mobile app can also be
enriched with some extra features, like energy usage reports and scheduling features, to enhance user
experience.

5.4.4 Paradigms for User Interface

The interface has been created to focus on accessibility and simplicity in usage, primarily targeting
elderly and disabled users. The interface implements consistent design patterns across the entire
mobile application for enhancing user friendliness. The interface is also optimized for variable screen
sizes and devices for seamless use on smartphones, tablets, and computers. The system provides real-
time feedback regarding the status of the appliances so that users are always connected to the status of
their appliances.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 37

5.4.5 Hardware and Software Interface Paradigms

Hardware and software interface systems were utilized for effective communication and control. A
local router provides dynamic IP addresses and provides communication between the mobile
application, and ESP8266 microcontroller. Relays are utilized to switch appliances on/off to provide
secure and effective switching of high-power appliances.

5.4.6 Error Recovery and Detection

The system also incorporates error detection and recovery for fault-free operation. The ESP8266
microcontroller also incorporates error detection and recovery to detect and recover from errors like
communication or relay failure. The mobile application notify users of errors like appliance
disconnection or control failure so that they can step in to correct them.

5.4.7 Memory Management Policies

System memory management policy is employed to provide maximum performance and resource
utilization. The native firmware of ESP8266 is low memory-intensive, and no interference occurs
even with many appliances working. The mobile app store user preference and appliance setting
through local storage, eliminating data access.

5.4.8 Distributed Data and Control

The architecture of the system accommodates distributed data and control within a local network. A
dynamic IP address is allocated to every ESP8266 microcontroller for facilitating predictable
communication with the mobile application. Distributed architecture of the system guarantees that the
control commands are executed locally in order to minimize latency and enhance responsiveness.

5.4.9 Concurrency and Synchronization

The system has concurrency and synchronization to provide ease of use. The mobile application
provide real-time appliance status to keep users updated about correct information at all times. The
ESP8266 microcontroller handles various control commands at the same time to enable proper
performance even with many appliances in connection.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 38

5.5 Domain Model/ Class Diagram

Figure 5.2: Class Diagram

This figure represents all the entities and their relations

5.6 Sequence Diagram

The following Sequence Diagrams will display the different objects in the system and how they
exchange information between them.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 39

Figure 5.3: Turn On Appliance Diagram


User wants to turn on an appliance (e.g., a bulb or fan)

Figure 5.4: Add New Appliance Diagram


Admin wants to add a new appliance to the system

Figure 5.5: Generate Log Report Diagram


User wants to generate a log report of appliance activities
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 40

Figure 5.6: Assign Appliance to User Diagram


Admin wants to assign an appliance to a user

Figure 5.7: View Appliance Status Diagram


User wants to view the status of an appliance

Figure 5.8: Delete Appliance Diagram


Admin wants to delete an appliance from the system
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 41

5.7 Policies and Tactics

To ensure that the Smart Switch system is stable and efficient, the project benefits from some industry
standards and policies. The policies are applied during the development, testing, and implementation
of the system during its life cycle.

5.7.1 Coding Standards and Conventions

The project is also compatible with maintainability, readability, and consistency coding code
standards. Arduino's code standards are used for the ESP8266 microcontroller with emphasis on
modular and good code development. For the mobile application, the Dart programming language by
Flutter is compatible with the official Dart style guide to ensure efficient and clean code. The selected
IDE is Visual Studio Code due to its cross-platform support, light runtime, and extensive collection of
plugins.

5.7.2 Test Strategies

The system has reliability and functional verification test plans as a whole. Unit testing is used for
individual components, i.e., ESP8266 firmware and mobile app modules. Integration testing is used to
prevent any disruption of interaction among the mobile app, and ESP8266 microcontroller. End-to-
end testing affirms end-to-end system flow from user input to appliance control. White-box and black-
box testing techniques are applied but decision tables in black-box testing and API/UI testing are
highlighted for white-box testing.

5.7.3 Continuous Integration and Deployment

The CI/CD pipelines are employed to automate the development process. GitHub is the repository for
the code, and there are repeated code integrations and auto testing. The changes are reviewed prior to
being merged into the primary branch so as to achieve quality and bug-free code. Through this
process, development becomes efficient, and the new features keep getting incorporated in the system
perpetually.

5.7.4 Source Code Organization

The source code is functionally organized in a hierarchical structure of modules and directories.
ESP8266 firmware, and mobile app all are assigned unique directories, and they each contain
subdirectories for specific functions such as relay control, user login, and scheduling. This will
improve the code handleability and make it more readable and easy to maintain by developers.
CHAPTER 5. HIGH-LEVEL AND LOW-LEVEL DESIGN 42

5.8 Conclusion

Smart Switch system is a strong and easy-to-use system that is used to control domestic appliances
remotely in the absence of Wi-Fi. The architecture of the system is specifically designed as modular,
scalable, and easy to maintain and hence can be used by many users, e.g., disabled and aged persons.
The system also sticks to conventions and practices used within the industry, and it presents high
reliability, efficiency, and security. Incorporation of innovative technologies like ESP8266 as a
microcontroller, Flutter mobile app development technology, which reacts to its interface ensures a
good user experience of smooth and straightforward interfaces. The modularity of the system makes
future upgrades simple, e.g., including additional appliances and cloud functionality. In total, the
Smart Switch system is a major step forward in home automation with a cheap and cost-saving
solution for the control of household appliances.

You might also like