Smart Switch: National University of Computer and Emerging Sciences, Lahore
Smart Switch: National University of Computer and Emerging Sciences, Lahore
Smart Switch
This is to declare that the above publication was produced under the:
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.
Signature:
Ahmad Signature:
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.4 Conclusion...............................................................................................................................11
List of Figures
List of Tables
2.1 This summary Table is for Smart Switch11
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.
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.
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.
List all important definitions, acronyms, and abbreviations used in this document. For example:
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
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.
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.
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.
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
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.
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.
Overall, our project aims to provide a robust and reliable solution for IoT connectivity, ensuring
seamless device communication without the limitations of internet dependency.
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.
• 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.
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
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.
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.
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
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.
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.
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.
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.
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.
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.
• Strengths:
– Internet-based IoT automation enables remote access, allowing users to control devices
from anywhere.
– Bluetooth-based systems provide secure local control without requiring an internet con-
nection.
• Weaknesses:
– Bluetooth has a short range, requiring proximity between devices for reliable communica-
tion.
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.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.
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.
This section describes the functional requirements for Users and the System.
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
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.
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
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
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.
"
This section outlines the hardware and software requirements for the development and operation of the
Smart Switch system.
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.
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.
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
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
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.
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.
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
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.
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.
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.
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.
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.
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
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.
Design of the Smart Switch system has been based upon several assumptions and dependencies that
will need to be considered in its development.
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.
The mobile app will be supported on top operating systems such as Android and iOS.
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.
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.
There are some limitations and constraints across the world which play a key role in developing the
Smart Switch system.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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
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.
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.
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.
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
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.
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.
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.
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.
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
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
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.
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.
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.
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.
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.