0% found this document useful (0 votes)
94 views68 pages

Anurag

The document is a project report titled 'Home Automation using IoT incorporating IEEE protocols' submitted by Anurag Gaurav for the Bachelor of Technology degree in Electrical and Electronics Engineering at Birla Institute of Technology, Mesra. It outlines the design and implementation of an IoT-based home automation system that enables remote control of home appliances via Wi-Fi, focusing on user-friendliness and accessibility for the elderly and disabled. The report includes sections on motivation, project objectives, literature review, methodology, results, and future scope.

Uploaded by

nikhileshmohit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views68 pages

Anurag

The document is a project report titled 'Home Automation using IoT incorporating IEEE protocols' submitted by Anurag Gaurav for the Bachelor of Technology degree in Electrical and Electronics Engineering at Birla Institute of Technology, Mesra. It outlines the design and implementation of an IoT-based home automation system that enables remote control of home appliances via Wi-Fi, focusing on user-friendliness and accessibility for the elderly and disabled. The report includes sections on motivation, project objectives, literature review, methodology, results, and future scope.

Uploaded by

nikhileshmohit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

HOME AUTOMATION USING

SELECTION OF IoT INCORPORATING


CHARGER FOR EV USING IEEE
FUZZYPROTOCOLS
LOGIC

A project
A project
Reportsubmitted
Report submittedininpartial
fulfilment of the of the
fulfilment
requirements for for
requirements thethe
award
awardof the degree
of the of of
degree

BACHLEOR OFOF
BACHLEOR TECHNOLOGY
TECHNOLOGY
IN IN
ELECTRICAL AND
ELECTRICAL ELECTRONICS
AND ELECTRONICS

BYBY

ANURAG GAURAV
ANURAG GAURAV
(BTECH/15168/19)
(BTECH/15168/19)

Under the Guidance of : Dr. Mayank Singh

DEPARTMENT OFOF
DEPARTMENT ELECTRICAL AND
ELECTRICAL ELECTRONICS
AND ENGINEERING
ELECTRONICS ENGINEERING
BIRLA INSTITUTE
BIRLA OFOF
INSTITUTE TECHNOLOGY
TECHNOLOGY
MESRA, OFF
MESRA, CAMPUS
OFF PATNA
CAMPUS PATNA
PATNA-800014
PATNA-800014
2023
HOME AUTOMATION USING IoT INCORPORATING IEEE PROTOCOLS

A project
Report submitted in fulfilment of the
requirements for the award of the degree of

BACHLEOR OF TECHNOLOGY
IN
ELECTRICAL AND ELECTRONICS

BY

ANURAG GAURAV
(BTECH/15168/19)

Under the Guidance of : Dr. Mayank Singh

DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING

BIRLA INSTITUTE OF TECHNOLOGY

MESRA, OFF CAMPUS PATNA

PATNA-800014

2023

ii
STUDENT DECLARATION

a. The work contained in the project report titled “Home Automation using IoT
incorporating IEEE protocols” is original and has been done under the
general supervision of my supervisor/guide “Dr. Mayank Singh”.
b. The work has not been submitted to any other Institute for any degree or
diploma.
c. I have followed the guidelines provided by the Institute in writing the project
report.
d. I have conformed to the norms and guidelines given in the Ethical Code of
Conduct of the Institute.
e. Whenever I have used materials (data, theoretical analysis, and text) from other
sources, I have given due credit to them by citing them in the text of the project
report and giving their details in the references.
f. Whenever I have quoted written materials from other sources, I have put them
under quotation marks and given due credit to the sources by citing them and
giving the required details in the references.

S.No. Student Name Student Roll no. Signature of the Student


1. Anurag Gaurav BTECH/15168/19

iii
DECLARATION CERTIFICATE

This is to certify that the work presented in the project report entitled
“Home Automation using IoT incorporating IEEE protocols” in partial
fulfilment of the requirement for the award of Degree of Bachelor of Engineering
in Electrical and Electronics Engineering of Birla Institute of Technology Mesra,
Ranchi is an authentic work carried out under my supervision and guidance.

To the best of my knowledge, the content of this project does not


form a basis for the award of any previous Degree to anyone else.

Date:

(Dr. Mayank Singh)


Department of Electrical & Electronics Engineering
Birla Institute of Technology
Mesra, off Campus Patna
Patna-800014

iv
CERTIFICATE OF APPROVAL

The foregoing project entitled “Home Automation using IoT incorporating


IEEE protocols”, is hereby approved as a creditable study of the research topic
and has been presented satisfactorily to warrant its acceptance as a prerequisite to
the degree for which it has been submitted.

It is understood that by this approval, the undersigned does not necessarily endorse
any conclusion drawn or opinion expressed therein, but approves the project for
the purpose for which it is submitted.

(Internal Examiner) (External Examiner)

(Chairman)

Head of the Department

Department of Electrical & Electronics Engineering

Birla Institute of Technology

Mesra, off Campus Patna

Patna-800014

v
ACKNOWLEDGMENT

First, I would like to express my gratitude to the almighty. I have taken an effort in
this major project. However, this would not have been possible without the kind
support and help of many individuals. I would like to express my deepest
appreciation to all those who provided me with the possibility to complete this
project.

Special gratitude to my final year project guide Dr. Mayank Singh, for his,
continued encouragement, support, guidance, and constant supervision as well as
for providing necessary information regarding the completion of the project. I am
eternally grateful for the things- both academic and non-academic that I have
learned from him. His encouragement helped me to complete this project.

Date:

Anurag Gaurav (BTECH/15168/19)

vi
ABSTRACT

This project shows the design and pilot execution of an innovative, inexpensive
home control system that uses Wi-Fi technology to link its component
components.

It concentrates particularly on the creation of an IoT-based house automation


system capable of remotely controlling multiple components or being
automatically set up to function based on environmental factors.

The suggested system has two major parts; the first is the cloud server, which
provides the management and control system core.

Users and system administrators can handle and control system code directly
(LAN) or remotely (internet). The second component is the hardware interface
module, which offers the sensors and actuators of the home automation system
with the proper interface.

To carry out the automated process, we used Node MCU and a variety of devices.

Wireless technology is used by the primary management system to enable distant


entry via sensors and a smart phone. It provides users with unfettered access to the
equipment, regardless of distance.

The system's user-friendly interface, comparatively cheap cost, and simplicity of


installation were designed to manage electrical gadgets and appliances in homes.

This method is intended to help and offer assistance so that the requirements of the
elderly and disabled can be met at home. The system's smart home idea also raises
standards of life in homes.

vii
TABLE OF CONTENT

Chapter no. Content Page No.


Student declaration iii
Declaration Certificate vi
Certificate of Approval v

Acknowledgement vi
Abstract vii
List of Figures ix
List of Tables xi
List of Abbreviations xii
Chapter 1 INTRODUCTION 1
1.1 Motivation 1
1.2 Project Objective 2
1.3 Organization of report 2
Chapter II LITERATURE REVIEW 3
2.1 Research papers 3
2.2 About IoT 8
2.3 IoT protocols 14
2.4 IEEE standards for an IoT 16
2.5 Components description 18
Chapter III PROBLEM FORMULATION 32
3.1 Problem definition 32
3.2 Existing model 32
3.3 Proposed model 33
3.4 Main features of the prototype 34
3.5 Block diagram & Flowchart 34
3.6 Circuit diagram 37
3.7 Project layout 37
3.8 Setting up the system 38
3.9 Hardware assembly 39
Chapter IV RESULTS 41
Chapter V CONCLUSION AND FUTURE SCOPE 44
REFERENCES 45
APPENDIX A(DATASHEETS & CODE) 46
PUBLICATION & CERTIFICATION 56
viii
LIST OF FIGURES

Figure No. Figure Name Page No.


1.1 Theoretical model for IoT showing home automation 1
2.1 Features of IoT 8
2.2 Advantages of IoT 10
2.3 Disadvantages of IoT 11
2.4 Applications of IoT 12
2.5 IoT protocols 14
2.6 Arduino Mega 2560 18
2.7 Pin configuration of Arduino Mega 19
2.8 Node MCU ESP8266 module 21
3.9 Pin configuration of ESP8266 22
2.10 4 Channel relay board 23
2.11 Schematic for 4 channel relay module 24
2.12 IR sensor 25
2.13 Schematic of IR sensor 26
2.14 LDR sensor 27
2.15 DHT11 sensor 29
3.1 Block diagram of the proposed system 34
3.2 Flowchart of the proposed system 36
3.3 Circuit diagram of the proposed system 37
3.4 Project layout 37
3.5 Power circuit 40
4.1 Simulation model of the proposed model 41
4.2 Designed PCB for the prototype 41
4.3 Web dashboard laptop view 42
4.4 Web dashboard phone view 42
4.5 Hardware module 43
A.1 Node MCU upper & lower view 51

ix
A.2 4 Channel relay 53
A.3 Arduino mega 54
A.4 Block diagram of Arduino mega 55
A.5 Power tree of Arduino mega 55

x
LIST OF TABLES

Table No. Name of Table Page No.

2.1 Previous work done till now 3

2.2 Pin number of Rx & Tx for serial communication 19

2.3 Pin configuration for interrupts 20

2.4 Pin configuration of ESP8266 21

2.5 IR sensor pin configuration 26

2.6 DHT11 pin configuration 29

3.1 Comparison with the existing models 33

A.1 Pin description of 4 channel relay 53

A.2 Technical specifications of Arduino mega 54

xi
LIST OF ABBREVIATION

1. IoT Internet of Things


2. Wi-Fi Wireless Fidelity
3. LAN Local Area Network
4. AI Artificial Intelligence
5. HAS Home Automation System
6. WSN Wireless Sensor Network
7. M2M Machine to Machine
8. GSM Global System for Mobile communication
9. NFC Near Field Communication
10. WAN Wide Area Network
11. Lora WAN Long Range Wide Area Network
12. UART Universal Asynchronous Receiver Transmitter
13. RST Reset
14. PWM Pulse Width Modulation
15. AREF Analogue Reference
16. GPIO General Purpose Input / Output
17. SPI Serial Peripheral Interface
18. VCC Voltage Common Collector
19. IR Infrared Radiation
20. LDR Light Dependent Resistor
21. ICSP In Circuit Serial Programming
22. TCP Transmission Control Protocol
23. P2P Peer to Peer
24. DHT Digital Humidity & Temperature
25. GND Ground
26. GPRS General Packet Radio Service
27. SRAM Static Random Access Memory
28. EEPROM Electrically Erasable Programmable Read Only Memory

xii
CHAPTER I
INTRODUCTION
With a network of tangible things linked to the internet, enabling them to communicate
with one another and share data, we are experiencing the AI, 5G & IoT phase of the
computing technology transformation.
Using a variety of tangible components that are interconnected to generate wireless
sensor connectivity for data transfer.
With the help of the fundamental elements—hardware, data, software, and connectivity
which make it possible to join digital atoms with physical ones, data will actually make
sense thanks to the work of physical entities, software will regulate analysis and enable
actions, and connectivity will link all available resources.

Figure 1.1 Theoretical model for IoT showing home automation

1.1. Motivation

Home computerization creates a smarter home and is used to provide a better and more
advantageous way of living. The beauty of a house computerization structure is that it is
extremely adaptable, flexible, and its capabilities are only limited by our imagination.
[1] It's time to progress towards limitless choices of such a prototype as the IoT unrest is
just around the corner.

1|P a ge
1.2. Project objective

 Appliance control using wireless technology (through manual control via phone
and through sensors).
 Sensors should be able to communicate to each other.
 Channels for safe communication between the application and the Node MCU
using secure Wi-Fi protocols to prevent other devices from taking control of the
HAS. [2]
 To make sure it follows the IEEE protocols which are necessary for a device to
be called an IoT device.

1.3. Organization of report

The remaining sections of the study are divided into distinct parts. IoT and its protocols
are discussed in depth in Chapter II, along with the standards established by the IEEE
that must be met for a device to be referred to as IoT and a short overview of the
components used. The next chapter in the document, Chapter III, describes the
methodology used to create the suggested system and the steps necessary to make it.
Chapter IV, our final chapter, contains all the findings. Last but not least, Chapter V
summarizes this work's main contributions and offers some suggestions for its potential
future applications.

The datasheets for the component parts and the necessary codes are both included in the
two appendices at the conclusion.

2|P a ge
CHAPTER II
LITERATURE REVIEW

In this chapter we are going to review about the previous papers published and what work
is done till now. And we are also going to discuss about the IoT, its protocols and what
are the standards for an IoT device set the IEEE. And lastly we are going to have a brief
discussion about the components that we are going to use while making this prototype.

2.1. Research papers

Some research papers used IoT based home automation systems are:

S.no. Reference No. Publication Summary


Year
1. [10] 2016 In order to make house energy consumption more
accessible, in this paper it suggests an
optimisation of power for home usage which is
based on PLC. [10] For tracking the energy
output of renewable energies, it also suggests a
PLC-based and Zigbee renewable energy site. For
the creation of an intelligent distribution of power
management system to ensure the continuous
power supply of residential networks, the DDEM
and ACS algorithms are advised. Home sensing
network power supply types are divided into four
categories for effective power management: main
supply only, main supply plus reserve battery,
rechargeable battery power, and non-rechargeable
battery power. [10] These categories are given to
devices based on their characteristics. It aims to
set up a real-time processing system to deal with
different sensing network configurations.

3|P a ge
2. [2] 2017 This study presents a way for creating a Home
Automation System (HAS) at a low expense
using Wi-Fi. It makes the idea of gadgets
communicating with one another clear. A smart,
linked home's environmental, safety, and energy
factors can be monitored and controlled using a
Wireless Sensor Network (WSN) that is Wi-Fi
based. The HAS is divided into various parts,
including sensors for temperature and humidity,
gas leak detection, fire and burglar alarms,
regulation of load and switching and current and
voltage monitoring, and rain sensing. A
smartphone application is used to fulfil the main
HAS requirement to watch and manage devices.
The programme is created with Android Studio
using the JAVA framework, and the user
interface is demonstrated. The main goal of this
article is to create a flexible, cost-effective device
management system that uses a variety of sensors
to record different parameters.
3. [3] 2017 This paper focuses on developing a voice-based
home automation system that is fully functional
and uses the IoT, AI, & NLP to provide a useful,
affordable way to work with home appliances that
use various technologies like GSM, NFC, etc.
The tools are all seamlessly integrated into one
main interface, which is the mobile device.
Genuino MK1000, also known as Arduino
MK1000, is used in the prototype. Instead of
using complex computer instructions, the user in
this initiative is free to communicate with the
household equipment using his or her own speech
and everyday English. The Internet of Things is

4|P a ge
established when the products are linked to the
mobile using an Arduino. The Arduino Boards
are connected to the utilities and designed to react
to inputs from mobile devices.
4. [7] 2018 This study centres on a system that offers easy-to-
use home automation features that also includes a
video module and offers protection for the house.
In essence, the Android software turns a
smartphone into a remote control for all
household equipment. With motion sensors,
security is accomplished if movement is detected
at the home's entryway; a notification is sent that
includes a real-time picture of the front door. The
owner of the home will receive this notice online,
enabling the programme to start sending
notifications. Therefore, the proprietor can
activate the alert system in the event of an
intrusion or switch on the utilities, such as
opening the entrance if a visitor. The system
makes use of a Raspberry Pi, a diminutive device
that serves as the system's host.
5. [6] 2019 This article details a smart house management
controller's step-by-step process. With the aid of
design management, it employs IoT to transform
household tools into smart and intelligent
gadgets. An energy-efficient device is created that
uses IoT connectivity to directly reach the smart
home. The suggested system primarily needs the
Node MCU microcontroller device, IFTTT to
understand voice instructions, Adafruit, a MQTT-
compatible library acting as a “MQTT broker”, &
Arduino IDE to programme the microcontroller.
To manage the smart house, this multimodal

5|P a ge
system combines Google Assistant with an online
application. The primary controller unit for the
smart house is linked to a Wi-Fi network that is
always accessible. In order to avoid the Wi-Fi
connection from disconnecting, the primary
controller is built to automatically join the best
network and be connected to the auto power
backup.
6. [9] 2019 This article suggests a method for reducing
computation overhead in current smart house
systems that use a variety of encryption
technologies, such as AES, ECHD, hybrid, etc.
These systems link different sensor devices using
an intermediary gateway. A technique for
automation with sensor-based learning is offered
by the suggested model. The device was
developed using a temperature monitor, though
other sensors could be used depending on the
situation. These sensor-equipped smart household
appliances can work and configure themselves
without human assistance. This research
minimises crypto decryption and concentrates on
smart home device identification and automation
using learning. The system avoids the local
gateway that is stated in the current system in
order to improve sensing data protection for smart
home devices and reduce processing overhead.
Real-time broker cloud controls all inbound and
outbound requests between users and devices and
is directly linked to smart homes. Real-time
broker cloud usage is primarily done to speed up
encryption processes.

6|P a ge
7. [8] 2019 The paper describes an artificial intelligence
system that uses vision to detect the on/off status
of popular household appliances. A novel house
automation system is produced as a consequence
of the suggested way of detecting the status of
appliances. The IP Addressing techniques used in
the IoT make it easier to reach the home's
collection of devices over a distance network.
Two devices, the Intel Galileo Gen 2 and
Raspberry Pi, are utilised in this undertaking. A
wireless network is used for contact between the
user devices, Intel Galileo Gen 2, and Raspberry
Pi. The UDP protocol is used to make it easier for
the components in the home control network to
communicate wirelessly. [8] Images are taken
using a Pi Cam and a USB Logitech camera
placed to the rotating shafts of two different servo
motors in order to use dlib-C++ to build machine
learning models that may be used to simulate the
status of various appliances' operations. The
recommended remedy automates the appliances
using visual modality because utilising photos
from specific places may raise privacy issues.
The Raspberry Pi now has an SPDT switch that,
ensures that, when turned off even then webcam
images are captured, they are only used as inputs
when visitors browse the website using the
Raspberry Pi's server IP, machine learning
models and other content are not shown. [8]

TABLE 2.1 Previous work done till now

7|P a ge
2.2. About IoT

2.2.1. Internet of Things

As a consequence of the fusion of embedded systems, common sensors, several


technologies, machine learning, the word "IoT" has gone across a long way. [4] IoT
is a network of connected objects with UIDSs that enables network-based data
transfer and object control. It reduced the requirement for direct interaction when
using through device. IoT be a complex analytics and automation system that offers
complete systems for a good or service by using big data, artificial intelligence,
networking, sensing, and sensing technologies. Every industry or system may use
these solutions to achieve improved transparency, control, and performance. [7]

2.2.2. Features of IoT

Figure 2.1 Features of IoT

i. Intelligence:
IoT is intelligent because it combines computer, hardware, and software
with algorithms. IoT ambient intelligence improves its functionality,
enabling the objects to react in a intelligent way to a given circumstance &
assisting them in performing specified tasks. [6] Despite the widespread use
of smart technologies, IoT primarily considers intelligence as a way for
devices to communicate with one another; user and device interaction is
instead accomplished through graphical user interfaces and traditional input
methods.

8|P a ge
ii. Connectivity:
By connecting common things, connectivity strengthens the Internet of
Things. The crucial role of these items' connectivity is due to the IoT
network's collective intelligence being boosted by straightforward object-
level interactions. It makes things compatible with and accessible via
networks. With this connection, the networking of smart devices and apps
can open up new commercial prospects for the Internet of things. [5]

iii. Dynamic nature:


The most important function of the IoT is data collection from its
surroundings, which is made possible by the changes that dynamically occur
around the devices. These devices' states fluctuate dynamically, for instance
whether they are sleeping or waking up, connected or not, and in various
contexts that include temperature, location, and speed. The quantity of
devices fluctuates dynamically with a person, place, and time in addition to
the status of each individual gadget.

iv. Sensing:
IoT wouldn't be able to report on its state or even interact with the
environment without sensors that can measure or detect environmental
changes. Sensing provide us the tools we need to develop skills that really
represent our knowledge of the real world & the people who inhabit it. [2]
Even while the sensing data is only an analogue input from the physical
world, it nonetheless has the potential to provide us a profound
understanding of our complex environment.

v. Heterogeneity:
Heterogeneity is a key component of IoT. IoT have devices that are based
on networks and multiple hardware platforms and may connect with other
IoT devices across a variety of networks. [4] IoT architecture should enable
direct network connections between various networks. Main considerations
for designing heterogeneous items and for their environments in the Internet
of Things include scalabilities, modularity, extensibility, and
interoperability. [3]

9|P a ge
vi. Security:
IoT devices are prone to security risks by nature. It would be a mistake to
ignore the security issues raised by the IoT while we gain efficiency, fresh
experiences, and other advantages from it. IoT has significant transparency
and privacy problems. The creation of a security paradigm is necessary in
order to safeguard networks, the data transported, and endpoints across all
of them.

2.2.3. Advantages of IoT

Figure 2.2 Advantages of IoT

i. Communication:
IoT promotes device communication, sometimes referred to as M2M
communication. Due to the physical equipment' ability to remain linked,
absolute transparency is made possible with fewer inefficiencies and higher
quality. [1]

ii. Monitoring:
The 2nd most evident advantage of IoT is monitoring. The IoT enables you
to automate and regulate daily processes while preventing human
interference. Communication between machines aids in keeping processes
transparent. It also results in task homogeneity. Also, it can keep up the
level of service. In an emergency, we can also behave as is required. [2]

iii. Automation & Control:


There is a significant level of automation and control in operation as a result
of physical items becoming connected and controlled digitally and
centralized via wireless infrastructure. Without human involvement, the
machines can interact with one another, producing output more quickly and
on schedule.
10 | P a g e
iv. Save time:
As machine-to-machine communication is more efficient, correct results
may be attained quickly. By doing this, considerable time is saved. It allows
people to perform other creative projects rather of repeating the same chores
every day. [5]
v. Save money:
Saving money is IoT's major benefit. If the cost of monitoring and tagging
hardware is less than the money saved, the IoT will be extensively adopted.
IoT essentially demonstrates to be highly beneficial to individuals in their
everyday routines by allowing the appliances to effectively interact with one
another, saving energy and money. Our systems are more effective when
data can be transmitted and exchanged across devices and then translated
into the format we need.

2.2.4. Disadvantages of IoT

Figure 2.3 Disadvantages of IoT

i. Compatibility:
There isn't currently a global standard for labeling and tracking device
compatibility. This drawback, in my opinion, is the most manageable. These
equipment's manufacturers simply have to accept a standard, like Bluetooth,
USB, etc. Nothing novel or creative is required here. [3]

ii. Complexity:
There are more chances for failure, just as there are with all complicated

11 | P a g e
processes. With the Internet of Things, errors could increase dramatically.
Let's assume, for example, that you and your partner both receive
notifications that your milk has run out and that you both decide to stop at a
store on the way home to buy milk. As a consequence, you and your partner
have spent twice as much as is necessary. [7]

iii. Security & Safety:


The chance of anonymity being compromised rises with the transmission of
so much IoT data. For instance, how secure will the data transmission and
storage be? Do you want your neighbors, coworkers, or bosses to know
what medicines you take or how much money you have?

iv. Lesser employment of menial staff:


The automation of everyday tasks may result in the loss of employment for
unskilled employees and assistants. This may cause problems with jobs in
the community. Any new device will cause problems like this, but they can
be solved with instruction. Naturally, as everyday tasks become more
automated, there will be less of a need for human resources, especially
employees and less-educated staff. This could lead to a problem with
unemployment in society. [4]

v. Lives becomes technology dependent:


Technology will become more and more integral to how we conduct our
lives. The younger population is already dependent on technology in all
spheres of life. We must determine how much of our everyday lives we are
prepared to automate and subjugate to technological management.

2.2.5. Application of IoT

Figure 2.4 Applications of IoT


12 | P a g e
i. Wearable:
One of the first sectors to implement IoT at its services is the wearable
technology sector, which is a defining characteristic of IoT apps. Fit Bits,
heart rate monitors, smart watches, and glucose tracking equipment are
examples of IoT uses that have been effective.

ii. Smart home:


This endeavor specifically relates to this field of application, so a thorough
application is discussed further. Jarvis, a Mark Zuckerberg-used AI
household automation, is a striking illustration of this type of use. [6]

iii. Health care:


IoT apps have transformed medical systems that are reactive into systems
that are proactive about wellbeing. Instead of creating equipment, IoT
concentrates on establishing systems. A highly interconnected network of
advanced medical equipment is exploited in the future of medicine and
healthcare thanks to IoT. While lowering the normal overhead of medical
research and groups, the integration of all aspects leads to greater accuracy,
greater attention to detail, quicker responses to events, and continuous
development. [7]

iv. Agriculture:
By regulating environmental factors, a greenhouse farming method
increases food output. However, manual handling reduces the process's
effectiveness by causing output losses, energy waste, and wage costs. In
addition to making a greenhouse simpler to watch, embedded devices allow
us to regulate the greenhouse's temperature. [1] Different factors are
measured by sensors and send to cloud which is based on the needs of the
facility. The input is then processed, and a control step is applied.

v. Government & Safety:


Improved law enforcement, defense, municipal planning, and financial
administration are made possible by the application of IoT to government
and safety. [2] The technology broadens the scope of these endeavors and
closes many current defects and gaps. IoT, for instance, can assist
13 | P a g e
governments in getting a better understanding of the regional economy and
assist city designers in seeing the effects of their designs more clearly.

2.3. IoT Protocols

Figure 2.5 IoT Protocols

i. Bluetooth:
The electronics and consumer products sectors make extensive use of the
Bluetooth short-range IoT communication protocol and technology.
According to predictions, it will be crucial for linking wearable items to the
IoT once more, although frequently via a smartphone. [3] A crucial
interface for IoT programs is the new BLE standard, sometimes referred to
as Bluetooth Smart. It's important to note that although having a range
similar to Bluetooth; it was designed to use far less power.

ii. Zigbee:
Like Bluetooth, ZigBee is mostly utilized in corporate settings. It is well
positioned to gain from wireless management and sensor networks in IoT
applications and allows low-power operation, high security, robustness, and
high performance in complex systems. The most recent ZigBee version is
3.0, which was just published and essentially unifies all of the individual
ZigBee wireless protocols.

iii. Z-Wave:
Z-Wave happens to be RF communications of low-power IoT technology
that includes, among other things, sensor and light processors and was
primarily developed for home automation. Z-Wave uses easy protocols than
compared to other wireless automation like ZigBee and others, which can
accelerate and simplify development. Sigma Designs is the only business
that makes Z-Wave circuits, though. [4]

14 | P a g e
iv. Wi-Fi:
For many developers, choosing Wi-Fi networking—one of the most widely
used IoT communication protocols—is normally straightforward, especially
given its availability inside LANs and in homes. A substantial infrastructure
is presently in place, offering quick data transport and the capacity to handle
massive amounts of data. [1] The Wi-Fi standard that is now most generally
used is 802.11n. Although it can transport files at speeds of hundreds of
megabits per second, many IoT applications may find it to be too power-
hungry. Currently, many businesses and houses are using 802.11n.

v. Cellular:
Any IoT application that has to run over long distances may leverage
GSM/3G/4G cellular connection capabilities. Even with cellular technology,
particularly 4G is capable of carrying enormous amounts of data, the cost
and energy usage will make it unworkable for many applications. However,
it could be perfect for sensor-based low-bandwidth data projects that send
relatively little data over the Internet. [6]

vi. NFC:
An IoT device is NFC (Near Field Communication). It makes it possible for
customers to conduct transactions where one does not need to be physically
present by enabling quick and secure interactions between electronic
devices, particularly smartphones. User can connect their electronic gadgets
and view digital material with its assistance. In essence, it expands the
functionality of RFID card technology and makes it possible for devices to
communicate with one another at a distance of less than 4 centimeters.

vii. Lora WAN:


Lora WAN, one of the most popular IoT technologies, focuses on
applications for wide-area networks (WAN). [2] For industrial applications,
smart city, and low-cost mobile secure communication in IoT the Lora
WAN architecture was developed. With data rates changing from 0.3 kbps -
50 kbps, huge networks with millions of devices may be supported while
also satisfying standards for low power consumption.

15 | P a g e
2.3.1. Why Wi-Fi is better than previous wireless technologies

Bluetooth is primarily used for point-to-point networks, as opposed to Wi-Fi, which


has a bandwidth of up to 150Mbps and is perfect for video transmission. When it
comes to transporting huge amounts of data, such as the picture from a camera, or
videos, Bluetooth's operating speed of 720 Kbps is just too sluggish. Bluetooth is a
much less safe form of contact than Wi-Fi.
Wi-Fi link for data, video, and audio transmission while taking remote control input
from a user almost anywhere in the world.

2.4. IEEE standards for an IoT

As evidenced by the numerous ongoing actions of the IEEE IoT Initiative, IEEE
functions as the meeting spot for the international technical community working on the
Internet of Things (IoT). The sweeping convergence of technologies, markets,
applications, and the Internet offers a venue for pros to learn, exchange knowledge, and
cooperate through the IEEE IoT Initiative. Standardization, which offers
interoperability, compatibility, dependability, and efficient operations on a worldwide
scale, is crucial to the success of the Internet of Things. [1]

In recognition of the importance of the IoT to business and the advantages this
technological innovation brings to the general public, IEEE has a number of extant
standards (current and in creation), activities, and events that are directly related to
fostering the environment required for a thriving IoT. The following are some crucial
tasks related to standards:

i. Architectural framework:
The goal of IEEE P2413-2019 is to create a standard for the Internet of
Things' architectural structure, which includes explanations of various IoT
domains, specifications of IoT domain abstractions, and the discovery of
shared characteristics among various IoT domains. The design structure
outlined in this standard will support functional compatibility, cross-domain
contact, and system interoperability. [4]

16 | P a g e
ii. Harmonization of IoT:
The IEEE 1451-99 is concentrated on creating a standard for Internet of
Things (IoT) networks and device harmonization. Regardless of the
underlying communication technology, this standard specifies a way for
data exchange, compatibility, and security of communications over a
network, allowing sensors, actuators, and other devices to work together.

iii. Security of IoT:


To safeguard user privacy, secure data, and stop unauthorized entry, an IoT
device should have the necessary security features. This can include secure
data transmission methods, authentication, and encryption. [7]

iv. Sensor performance and Quality:


The IoT environment relies heavily on sensors, with a wide variety of them
incorporated into a sophisticated structure. The IEEE 2700 standard
provides a uniform structure for terminology, units, conditions, and
boundaries for sensor performance specifications. Measures, controls,
parameters, and standards for sensor data quality linked to Internet of
Things (IoT) applications are provided in IEEE P2510.
A sensor or integrated technology that allows data collection, analysis, and
transmission over the internet should be present in an IoT device. This can
involve webcams, motion monitors, temperature sensors, and pressure
sensors. [3]

v. Connectivity:
The ability to link to the internet or other devices via cable or wireless
technologies like Wi-Fi, Bluetooth, NFC, or cellular networks is a
requirement for an IoT device.

vi. Power:
A battery, solar cell, or other energy source could be the dependable and
sustainable power source for an IoT gadget.

17 | P a g e
2.5. Components description

2.5.1. Arduino Mega 2560


An open source programming device called the Arduino Mega 2560 is built around
the Atmega2560 AVR microcontroller. An 8-bit microprocessor, such as this one.
It makes use of microchip technology ATmega16U2. Programming for this device
is possible using the processing language.

Figure 2.6 Arduino mega 2560

2.5.1.1. Pin configuration and description:

i. Digital Input/ Output Pins: It is utilised for both sending and receiving
digital signals.
ii. PWM Outputs: To regulate the signals, a PWM (Pulse Width Modulation)
pin is employed. Controlling the actuators' pace or the LEDs' brightness, for
instance.
iii. Analog Pins: It reads analogue signals as part of its job. Taking the info from
the sensors as an illustration.
iv. UART: Also known as Universal Asynchronous Receiver/Transmitter. It
is utilised in serial communication.
v. USB: It can link your Mega 2560 board to your PC so you can programme it,
and it could also be used to provide power into the Arduino board.
vi. Power Jack: It is used to externally power the Arduino board.
vii. ICSP Header: The Arduino Board may be programmed via in-circuit serial
programming (ICSP). Typically, it is employed to replace an Arduino boot
loader that has been lost or destroyed.
18 | P a g e
viii. Pin 3.3V & 5V: The Mega 2560 board receives a regulated power supply
through the usage of these pins.
ix. GND Pin: There are a total of 5 gnd pins available on the board.
x. Reset (RST) Pin: It is used to reorganise the Arduino board's functionality.
xi. Vin Pin: It’s function is to supply the board with input voltage. Remember!
The input voltage range through this pin should be between 7V and 12V. The
board will adjust the voltage to 5V automatically if you accept output from
this pin.
xii. Serial Communication: The serial pins on this board, TXD and RXD, are
used to send and receive serial data, respectively. The four serial pin
combinations are:

Pin No. for Tx Pin No. for Rx


Serial 0 1 0
Serial 1 18 19
Serial 2 16 17
tttttt
Serial 3 14 15

Table 2.2 Pin number of Rx & Tx for serial communication

Figure 2.7 Pin Configuration of Arduino mega 2560


19 | P a g e
xiii. AREF (Analog Reference Voltage): As a reference voltage for analogue
inputs, this pin is utilised.
xiv. Analog Pins: There are 16 analogue pins in all, numbered A0 to A15. The
AREF pin can be used to change the high values of these pins.

xv. External Interrupts: These six pins provide for a variety of interrupt
triggers, such as providing a rising or falling edge ,a altering the value of the
interrupt pin or LOW value. The following pin number are utilised for the
interrupt:

Interrupts Pin No.


Interrupt 0 2
Interrupt 1 3
Interrupt 2 21
Interrupt 3 20
Interrupt 4 19
Interrupt 5 18

Table 2.3 Pin configuration for interrupts

xvi. Digital Pins: It has 54 digital I/O pins, ranging in number from 0 to 53. 15 of
the 54 pins—D2 through D13 & D44 through D46—are PWM pins.
xvii. I2C: Using pin numbers 20 and 21, it is one method of communicating with
the board.
xviii. SPI (Serial Peripheral Interface) Communication: Microcontrollers
frequently utilise it to interact with a few different peripheral devices.

2.5.1.2. Advantages:

i. It has more RAM, is larger, and has more I/O ports.


ii. Four hardware serial ports and a restart switch allow for quick
communication.
iii. There are three different methods to charge the board: a USB
connection, the board's Vin pin, or the power jack.
iv. This board has a resetting polyfuse that keeps your computer's USB port
from overheating when there is a lot of power running through the

20 | P a g e
board.
v. It has 2 voltage regulators, a 5V & a 3.3V one, giving you the freedom
to control the voltage however you see fit.
2.5.1.3. Disadvantages:

i. Only 8-bits, not 32-bits, are supported by it.


ii. The maximum clock frequency is 20 MHz

2.5.2. Nodemcu ESP8266

An open-source Lua-based programming platform called NodeMCU is made


primarily for IOT applications. It consists of ESP-12 module-based parts and
ESP8266 Wi-Fi SoC-based software from Espressif Systems. [2]

Figure 2.8 Nodemcu ESP8266 module

NodeMCU may be charged via a Micro USB port and VIN pin. (Pin from External
Supply). Support is provided for the interfaces UART, SPI, and I2C.

2.5.1.1. Pin configuration:


Table 2.4 Pin configuration of ESP 8266

Pin Category Name Description

Control Pins EN, RST It is used to reset the microcontroller

Analog Pin A0 Used to monitor analog voltage between 0


and 3.3V

GPIO Pins GPIO1 - It has 16 input-output pins


21 | P a g e
GPIO16

SPI Pins SD1, CMD, It has four pins for SPI communication.
SD0, CLK

UART Pins TXD0, RXD0, It has two UART interfaces, UART0


TXD2, RXD2 (RXD0 & TXD0) and UART1 (RXD1 &
TXD1). UART1 is used to upload the
program.

Power Micro USB, Power can be supplied via USB port or


3.3V, GND,Vin through Vin & Gnd.

Figure 2.9 Pin configuration of ESP8266

2.5.1.2. Applications:

i. IoT gadget prototyping


ii. Battery-powered apps with low electricity
iii. Network initiatives
iv. Projects needing numerous I/O ports with Bluetooth and Wi-Fi
capabilities

22 | P a g e
2.5.3. 4 channel relay board

This LOW Level 5V 4-channel relay interface board needs a 15-20mA controller
current for each channel. It may be utilized to run several high-current machinery
and gadgets.

The four 5V relays of the four-channel relay module and the associated switching
and isolating elements may be readily interfaced with a microcontroller or sensor
with the minimum number of parts and connections. The two terminal parts, each
with six connections, are shared by two relays. The screw style connections make it
easy and versatile to connect to mains cabling.

Figure 2.10 4 channel relay board

It has high-current switches that operate at either DC30V or AC250V 10A. A


microcontroller can easily control it thanks to its shared interface. For safety
reasons, the module is optically separated from the HV side to avoid ground loops
when connected to a microprocessor.

Switching transistors in relay systems serve as a buffer between the high-current


relay circuits and the low-current inputs. To activate the coils and switch on the
relays, they amplify the incoming signal. Because the coils act as an inductive load
while the switch is off, the freewheeling diodes prevent voltage peaks across the
transistors. The indication LEDs glow to demonstrate that a certain relay is active
when its coil is turned on. The optocouplers add an additional layer of protection
between the inputs and the switched load. It is possible to choose the isolation,

23 | P a g e
which is a purely optional feature, using the VCC selection jumper. The input
jumper has the principal V-CC, GND, and input lines for straightforward
connection using female jumper wires.

2.5.1.3. Schematic

The input ground is shared by all four channels and the circuit for each switch
on the board is identical.

Due to the possible extra layer of isolation, the driver circuit for this relay
module differs slightly from conventional relay driving circuits. When the
jumper is open, a different power source must be used to power the JD-VCC
jumper in order to power the relay coil and optocoupler output. When the
jumper is shorted, the relay and the input share the same VCC.

Figure 2.11 Schematic for 4 channel relay module

The inputs for this module are active low, which means that when the signal
on the input port is low, the relay is turned on. This is due to the series
connection of the optocoupler's input and the indicator LED to the VCC port
on one end, necessitating the connection of the other end to ground to allow
current to flow. The PCF817 optocouplers, which are widely used and are also
available in through-hole packing, were used in this application.

24 | P a g e
2.5.4. IR sensor

The majority of the IR Sensor Module is made up of the Variable Resistor


(Trimmer pot), Op-amp, a few resistors and Output LED.
IR LED transmitter:

This frequency range is illuminated by infrared LEDs. Since infrared light has a
wavelength between 700 nanometers and one millimetre, it is invisible to the
human eye. IR LED’s have an approximate 20 to 60 degree light-producing angle
and a range of up to a few centimeters to several feet, depending on the brand and
kind of IR emitter. Some emitters measure their range in km. In order to emit as
much light as possible, IR LED’s are made transparent or white.
Variable resistor
Here, a fixed changeable resistor is utilized. It is employed to adjust the distance
threshold for object detection.

Figure 2.12 IR sensor


Photodiode receiver
Since the photodiode conducts when exposed to light, it works as an IR detector.
Light output is inversely correlated with current flow. A photodiode is a
semiconductor with a P-N junction that operates in reverse bias, meaning that when
25 | P a g e
Light shines on it, current starts flowing in the opposite direction. It is practical for
IR sensing because of this characteristic. A photodiode is a gadget that resembles
an LED and has a dark exterior. The most light is absorbed by black.
LM358OpAmp
The Op-Amp, LM358 is used in the IR sensor as a voltage comparison device. The
comparator will compare the photodiode's pin 3 series resistor voltage with pin 2's
preset-specified cutoff voltage.
If (Photodiode’s series resistor voltage < Threshold voltage); that means Op-amp
output is Low.
Or, if (Photodiode’s series resistor voltage > Threshold voltage); that means Op-
amp output is High.
The LED at the Op-amp output port goes ON when the Op-amp's output is high.
(Indicating detection of Object).

2.5.4.1. Schematic

Figure 2.13 Schematic of IR sensors

2.5.4.2. Pin out configuration

Pin Name Pin description

OUT Digital output pin

VCC Power supply

GND Ground

Table 2.5 IR sensor pin out configuration


26 | P a g e
2.5.4.3. Features

i. Range is up to 20cm
ii. 5V DC Operating voltage
iii. Sensing range adjustment
iv. Built-in Ambient Light Sensor
v. 20mA supply current
vi. I/O pins that are compatible with 5V and 3.3V
vii. Hole for mounting
2.5.5. LDR sensor

Light Dependent Resistor is known by the abbreviation LDR. LDRs, often referred
to as photo resistors, are minuscule light-sensing components. A resistor known as
an LDR changes in resistance in response to fluctuations in the amount of light it
receives. Light intensity increases are accompanied by a decrease in LDR
resistance, and vice versa. We may utilize them to create circuits for light detection
thanks to this characteristic.

We must always create a voltage divider circuit in order to use an LDR. The
voltage across an LDR grows when its value of resistance rises relative to its fixed
resistance.

Figure 2.14 LDR sensor

It operates according to the principle of photoconductivity, whereby when light


strikes a photoconductive material, the conductivity rises in direct proportion to the

27 | P a g e
increase in light intensity as it absorbs the energy and causes the electrons there to
become excited and shift from the valence band to the conduction band.

Additionally, for the valence band electrons to be activated and flow into the
conduction band, the incident light energy must be greater than the band gap
energy.

The LDR's resistance is 1012 Ohm at its greatest in the dark, and it drops as light
levels rise.

2.5.5.1. Applications:

i. The photo resistor is frequently used to gauge the presence and strength of
light.
ii. Used in automated lights that come on and go off dependent on light
iii. A straightforward smoke detector alarm with an automatic lighting clock
iv. Optical circuit design
v. A proximity switch for pictures
vi. Laser security measures
vii. Solar-powered street lights
viii. Camera light metres
ix. Radio timers
x. Can be used in dynamic compressors; certain compressors allow you to
change the gain of the signal by attaching an LED and an LDR to the signal
source.

2.5.5.2. Limitations:

i. LDRs take a few milliseconds or longer to fully react to changes in


light intensity; if the light source is turned off, it takes them a few
seconds to restore to their typical resistance.
ii. A light-dependent resistor's sensitivity varies depending on the light's
wavelength. The resistance won't be impacted at all if the wavelength
falls outside of a specified range.

28 | P a g e
iii. Photodiodes and phototransistors are more sensitive than light-
dependent resistors.

2.5.6. DHT11 sensor

A digital sensor which is cheap used for detecting temperature and humidity is the
DHT11. To instantly detect humidity and temperature, it may be simply interfaced
with any micro-controller, including Raspberry Pi, Arduino, etc.

There is a sensor and a module available for the DHT11 humidity and temperature
sensor. A pull-up resistor and an LED that turns on might help you tell this sensor
apart from the module. A relative humidity sensor is the DHT11. This sensor
employs a capacitive humidity sensor and a thermistor to detect the ambient air.

Figure 2.15 A DHT11 sensor

2.5.6.1. Pin out description:

Pin Name Pin Description


DATA Digital output pin
VCC Power supply
GND Ground

Table 2.6 DHT11 pin description

2.5.6.2. Working principle:

The DHT11 sensor consists of a capacitive humidity detecting device and a


thermistor for measuring temperature. The humidity detecting capacitor
29 | P a g e
consists of two electrodes separated by a substrate that may store moisture as a
dielectric. The capacitance value changes as the humidity levels fluctuate. The
IC interprets, calculates, and converts the modified resistance values into
digital form.
The resistance value of this sensor decreases as temperature rises because it
utilizes a thermistor with a negative temperature coefficient to measure
temperature. Semiconductor ceramics or polymers are typically employed in
this sensor's design to provide it higher resistance values even for the tiniest
temperature change.

The DHT11 provides a temperature range of 0 to 50 degrees Celsius with a 2-


degree accuracy. With a 5% accuracy, this sensor provides a humidity range
of 20 to 80%. This sensor has a 1Hz sampling rate. In other words, it provides
one reading per second. DHT11 is a tiny device with a 3 to 5 volt operational
range. 2.5mA is the maximum current that may be utilized for measuring.

The DHT11 sensor has four pins: Data, GND, VCC, and a Not Connected Pin.
A pull-up resistor between 5k and 10k ohms is provided to enable
communication between the sensor and microprocessor.

2.5.6.3. Specifications:

 Power source: DC 3.3 to 5V


 Maximum current usage is 2.5mA.
 Operating range: 0-50°C, 20-80% RH.
 Range of humidity measurements: 20 to 90% RH
 Accuracy of humidity measurements: 5% RH
 Range of temperature measurement: 0 to 50 °C
 Accuracy of temperature measurements: 2°C
 1sec Response time
 1Hz sampling rate (1 sample per second)
 Digital signal output in single-bus format
 Distance for data transmission: 20–30 m (at open air)
 15 x 12 x 5.5 mm in size
30 | P a g e
 Size: 2.5 g

2.5.6.4. Applications:

This sensor is employed in a number of applications, including the


measurement of temperature and humidity levels in HVAC systems. These
sensors are also used by weather stations to forecast the weather. In houses
where residents are susceptible to the effects of humidity, the humidity sensor
is employed as a preventative measure. This sensor is used in offices,
vehicles, museums, greenhouses, and businesses to detect humidity levels and
as a safety precaution.

31 | P a g e
CHAPTER III
PROBLEM FORMULATION

We'll talk about the prior model in this chapter, as well as how my model differs from
the others. The block diagram, flowchart, features, and circuit diagram will all be
covered. Finally, we'll talk about how we built the hardware and set up the system.

3.1. Problem definition

Home automation systems face four main challenges: high ownership costs, difficulty
achieving security, sub systems not integrating and bad sensitivity. [6]

3.2. Existing model

The writing associated with the examination topic has been examined for the most
recent 25 years in an effort to uncover work produced by various experts. There are
many remote checking and controlling structures that are described as business products
or trial investigation phases.

i. It can be seen that the bulk of the finished research fits in with the related
classes.
ii. Internet-based checking using different methods and servers, GPRS modems,
etc.
iii. GSM-SMS protocols using a GSM modem alone or in conjunction with Web
advances.
iv. Using remote sensor systems for monitoring.
v. Wireless monitoring using RF, Zigbee, Bluetooth, and Wi-Fi.

While Bluetooth and Zigbee provide lesser information rates, Wi-Fi provides a better
one. Both the 2.4GHz and 5GHz recurrence bands are used by Wi-Fi and it enables
devices with a sizable power source.

32 | P a g e
3.3. Proposed model

The suggested system's remarkable adaptability is enabled by the use of Wi-Fi


technology to link its distributed devices to a server for house automation.

As a result, the expense of the organization will go down and the capacity for
overhauling and framework change will increase. Additionally, we are using Google
Login Access to further enhance protection. Although the concept of home
computerization has been around for a while and products have been readily accessible
for a while, no system has yet reached the benchmark. For the aged and disabled, home
computerization can increase personal happiness for those who may otherwise need
parental figures or institutional care. [3]

Additionally, it can provide a remote interface for giving management and viewing via a
computer programe. This article will outline the method we are using to manage various
household appliances via an online interface using a cell phone, iPad, PC, or other Wi-
Fi capable device. It can also be controlled via sensors, giving us the option of
automated switching.

3.3.1. Comparison

By comparing the updating data time, cost, regulating techniques, circuit


complexity, and integration of appliances with many existing ways, our
recommended methodology showed that our proposed system has a superior
outcome than the present systems. Table 2 contrasts new and old systems.
S.No. Parameters Existing system Proposed system
1. Data update time Didn’t mention Only 1 sec
2. Control method Internet, electrical Internet, Electrical switch,
switch, GUI Smart phone app, Automatic
through sensors
3. Circuit Complex Convenient
complication
4. Integration of Less High
appliances
Table 3.1 Comparison with the existing models

33 | P a g e
3.4. Features of the prototype

The created prototype has the following features:

i. The prototype builds wireless system for controlling home appliance from a
distance.
ii. The system's sensors have the ability to interact with one another and make
independent decisions on which gadget to turn on or off.
iii. One may use the radio buttons on the application on their smartphone to turn on
and off appliances.
iv. The prototype may be controlled by any device with Wi-Fi access. Using secure
connectivity, household appliances may be controlled.
v. Simple designs are simple to incorporate into a variety of appliances and
expand on.
vi. Displays each appliance's status via a smartphone application.
vii. It's economical.

3.5. Block diagram & Flowchart

Figure 3.1 Block representation of the suggested system

The arduino mega is first provided a 7V DC power supply in the block diagram above.
This device also powers the nodemcu, which in turn powers the relay module.

34 | P a g e
Now that various sensors are linked to Arduino, which is connected to a relay, we can
operate the relay using a mobile application by connecting a nodemcu, which is then
connected to the loads.

Firstly the power is supplied to the arduino board then it will gather data from various
sensors then send it to the node mcu then the gathered data will check if there is a
person in the room or not. If yes then it will check for temperature & light intensity and
then both types of sensors will communicate in each other and then decide if the led
should turn on or off.

If there are no persons in the room then all lights will automatically be turned off. But
you can re operate on those by using manual control through your smart devices. And
that way also you can decide if it should turn on or off.

35 | P a g e
Figure 3.2 Flow chart of the proposed system

36 | P a g e
3.6. Circuit diagram

Figure 3.3 Circuit diagram of the proposed system

3.7. Project layout

Figure 3.4 Project layout

The prototype's microcontroller is called Node MCU. It features the ESP8266 Wi-Fi
module, which enables wireless remote switching of household appliances. The Node
MCU is physically connected to the household appliances using a four channel relay
37 | P a g e
module, which consists of 4 individual relays. When necessary, it connects or
disconnects domestic appliances from the supply after receiving signals from the GPIO
pins of the Node MCU. They serve as the switch [4]. In this prototype, LED and
resistors are utilized in place of actual appliances. They show when the electricity to the
appliances is turned on and off. In practical use, genuine household appliances would
take their place. [3]

3.8. Setting up the system

3.8.1. Downloading and setting up Arduino IoT cloud application

i. Arduino IoT cloud can be downloaded and installed from the play store for
smartphone and for laptop we can also download it from the site or can
access it through Google also.
ii. Once the application is installed in phone, you can log in in to it by signing
in via your Google account.
iii. After log in a new project has to be created. It can be named home
automation or anything you want.
iv. Then switch to your laptop for the dashboard setup and to upload your code
to node mcu.
v. Once you sign in through same Google account from laptop you can see a
project named home automation.
vi. Then go to the things section and create the variables that are needed to
operate the relay.
vii. And it will automatically create the functions for those variables and you
have to just put in the conditions for your system.
viii. Then after creating the variables you will see network option, click on it
type your network id and password and a security key will be asked you
will get it via mail when you have created your account.
ix. In the things>setup there will be an associated device when you will
connect the node mcu to your laptop it will show online, if not then connect
it properly.
x. Then type the code in the sketch section and upload it to node mcu.
xi. Finally go to dashboards section and make your own dashboard as per
requirement and save it.
38 | P a g e
3.8.2. Downloading and installing Arduino IDE for arduino

i. Go to Google and type arduino download then you will see its official
website.
ii. You can download it for free from there and install it.
iii. Then when you will connect your arduino to your laptop then you have to
select the proper board and port number from which your board is
connected.
iv. After all this you can type your code and upload it to your board.

3.8.3. Installing drivers for hardware interface

Nowadays, the majority of devices automatically downloads and installs drivers.


Windows is unable to identify the board as a Node MCU and proceed normally
since it doesn't know how to interface with the Node MCU's USB driver.

i. A development board using the ESP8266 Wi-Fi module is called Node


MCU Amica. The computer or other USB host devices can be directly
linked to it using the Micro USB slot. The Micro USB slot and 15X2 header
pins on Ti may be put on breadboard & the Micro USB slot can be used to
connect to a USB host device. The USB to serial converter is CP2120.
ii. The driver for the CP2120 (USB to serial converter) must be downloaded
by the user before it can be installed.
iii. The system connects to the Node MCU when the user downloads the
required drivers for their operating system.
iv. Then the freshly connected USB device (Node MCU) has to be node down
the COM post from the system's device management. When utilizing Node
MCU Amica, you'll need to use this com port number.

3.9. Hardware assembly

Hardware assembly largely entails connecting particular digital and analogue Arduino
pins to various sensors, such as ir, dht, and ldr sensors, as well as to leds for
identification and nodemcu for serial communication.

39 | P a g e
The four relays on the relay module are now linked to the nodemcu, along with the
supply and ground pins. This prototype's core functional assembly is straightforward.
Any device that needs to be regulated can be linked to the additional 4 relays.
The most important step in hardware construction is remembering which digital pin
belongs to which relay. The Arduino IoT cloud application is configured for this
connection. The application's radio buttons are programmed to toggle a specific digital
pin in the Node MCU. It was ensured that relay connection is actually formed in
accordance with this configuration.

A 12V AC to DC adapter is used to deliver power to the prototype. A LM317 voltage


regulator is then used to scale down the 12V DC to 7V DC.

3.9.1. Power Circuit

The LM317 is a variable voltage regulator that accepts input voltages between 3
and 40 volts and outputs a fixed value between 1.25 and 37 volts. To change the
output voltage, two external resistors are necessary.

Figure3.5 Power circuit


The external resistor values R1 and R2 affect the output voltage Vout, as shown by
the equation below:
𝑅2
𝑉𝑂𝑈𝑇 = 1.25 ∗ (1 + )
𝑅1
Now taking R1 as 220 ohm then we get R2 as approximately 1kΩ from the above
equation.
When the regulator is placed a significant distance from the power supply filter, C1
is necessary. Although C2 does not increase stability, it does improve transient
reaction.

40 | P a g e
CHAPTER IV
RESULTS
The circuit schematic was followed when building the trial model, and the outcomes were as
anticipated. Over a Wi-Fi network, the house utilities could be remotely switched. The
switch mode and the automated control mode through sensing were both accomplished
effectively. The Arduino IoT cloud application was effective in showing each application's
state.
The comprehensive findings from this study are listed below:

4.1. Simulation model

Figure 4.1 Simulation model of the proposed system


4.2. PCB design

Figure 4.2 Designed PCB for the prototype


41 | P a g e
4.3. Web dashboard

Figure 4.3 Web dashboard laptop view

Figure 4.4 Web dashboard phone view

42 | P a g e
4.4. Hardware prototype

Figure 4.5 (a) Hardwarre module, (b) when someone enters the room two led turns on
due to temperature, (c) all led turns on due to temperature & ldr sensor

As you can see in the above figure 4.5(a) the circuit is mounted on a plastic cardboard box
which all components intact. In figure 4.5 (b) whenever someone enters the room the fan will
automatically turned on due to temperature sensors and fig 4.5 (c) all lights will also turn on
when the intensity of the light exceeds the fixed value.

43 | P a g e
CHAPTER V
CONCLUSION AND FUTURE SCOPE

 This project's work makes it clear that a home automation system for individual
control can be easily built from affordable cheap components & can be used to
control a variety of appliances, including lamps, televisions, air conditioners, & even
the whole home lighting.

 Better yet, the few and small number of components needed allow them to be packed
into a discrete, small receptacle. The designed home automation system has
undergone numerous tests that allow it to manage a variety of household appliances
used in the home theatre, air conditioning, lighting and many more. As a result, this
method is adaptable & extensible

 Given the scenario, we could create a system that can be used on different operating
systems, including iOS and Windows. By automating all other household appliances,
the restriction of being able to manage only a few devices can be lifted.

 We can see that it can also assist us in power conservation because it can even be
used in conjunction with an energy monitoring device. The project's scope can be
broadened by including tiny workplaces in addition to just homes.

44 | P a g e
REFERENCES

[1] N. Stalin and N. Shobanadevi, “Wireless home automation system using Wi-Fi and GSM,”
2021.
[2] N. Vikram, K. S. Harish, M. S. Nihaal, R. Umesh, and S. A. Kumar, “A low cost home
automation system using Wi-Fi based wireless sensor network incorporating internet of
things (IOT),” 2017 IEEE 7th International Advance Computing Conference (IACC), 2017.
[3] P. J. Rani, J. Bakthakumar, B. P. Kumaar, U. P. Kumaar, and S. Kumar, “Voice controlled
home automation system using Natural Language Processing (NLP) and internet of things
(IOT),” 2017 Third International Conference on Science Technology Engineering &
Management (ICONSTEM), 2017.
[4] P. Kaur and K. Arora, “Internet of things-based Economical Smart Home Automation
System,” Industrial Internet of Things, pp. 129–142, 2022.
[5] S. H. Shehab, M. L. Rahman, M. H. Hasan, M. I. Uddin, S. A. Mahmood, and A. Z. M. E.
Chowdhury, “Home Automation System using gesture Pattern & voice recognition for
paralyzed people,” 2020 11th International Conference on Electrical and Computer
Engineering (ICECE), 2020.
[6] S. K. Vishwakarma, P. Upadhyaya, B. Kumari, and A. K. Mishra, “Smart Energy Efficient
Home Automation System using IOT,” 2019 4th International Conference on Internet of
Things: Smart Innovation and Usages (IoT-SIU), 2019.
[7] S. Somani, P. Solunke, S. Oke, P. Medhi, and P. P. Laturkar, “IOT based Smart Security and
Home Automation,” 2018 Fourth International Conference on Computing Communication
Control and Automation (ICCUBEA), 2018.
[8] Suraj, I. Kool, D. Kumar, and S. Barma, “Visual Machine Intelligence for Home
Automation,” 2018 3rd International Conference On Internet of Things: Smart Innovation
and Usages (IoT-SIU), 2018.
[9] T. Chaurasia and P. K. Jain, “Enhanced Smart Home Automation System based on internet of
things,” 2019 Third International conference on I-SMAC (IoT in Social, Mobile, Analytics
and Cloud) (I-SMAC), 2019.
[10] T.-Y. Yang, C.-S. Yang, and T.-W. Sung, “A Dynamic Distributed Energy
Management Algorithm of Home Sensor Network for Home Automation System,” 2016
Third International Conference on Computing Measurement Control and Sensor Network
(CMCSN), 2016.
[11] J. Han, C.-S. Choi, W.-K. Park, I. Lee, and S.-H. Kim, “Smart Home Energy
Management System including renewable energy based on Zigbee and PLC,” 2014 IEEE
International Conference on Consumer Electronics (ICCE), 2014.
[12] N. Mohd Yusof, A. Z. Jidin, and L. M. Sze, “Web Based Home Security and
automation system,” International Journal of Reconfigurable and Embedded Systems
(IJRES), vol. 5, no. 2, p. 92, 2016.
[13] A. Dasgupta, A. Qumer Gill, and F. Hussain, “Privacy of IOT-enabled Smart Home
Systems,” IoT and Smart Home Automation [Working Title], 2019.
[14] F. Al-Turjman and M. Sanwal, “Home automation in cloud-based IOT,” The Cloud in
IoT-enabled Spaces, pp. 169–207, 2019.
[15] K. Agarwal, A. Agarwal, and G. Misra, “Review and performance analysis on
wireless smart home and home automation using IOT,” 2019 Third International conference
on I-SMAC (IoT in Social, Mobile, Analytics and Cloud) (I-SMAC), 2019.

45 | P a g e
APPENDIX A
DATASHEETS & CODE

I. Code of Arduino
#include <DHT.h> boolean state1 = true;

#include <SoftwareSerial.h> boolean state2 = true;

#define DHTTYPE DHT11 // DHT 11 boolean insideState = false;

#define DHTPIN0 A2 boolean outsideIr=false;

#define DHTPIN1 A3 boolean isPeopleExiting=false;

DHT dht0(DHTPIN0, DHTTYPE); int i=1;

DHT dht1(DHTPIN1, DHTTYPE); void setup() {

int irPin1=7; Serial.begin(9600);

int irPin2=6; espSerial.begin(9600);

int LDR1 = A0; pinMode(relay_1, OUTPUT);

int LDR2 = A1; // LDR input at A0 pin. pinMode(relay_2, OUTPUT);

int LDRReading1 = 0; // to store input value of LDR pinMode(relay_3, OUTPUT);

int lEDBrightness1 = 0; // to store the value of LED Brightness pinMode(relay_4, OUTPUT);

int threshold_val1 = 800; // Check your threshold and modify it. pinMode(irPin1, INPUT);

int LDRReading2 = 0; // to store input value of LDR pinMode(irPin2, INPUT);

int lEDBrightness2 = 0; // to store the value of LED Brightness dht0.begin();

int threshold_val2 = 850; // Check your threshold and modify it. dht1.begin();

const int relay_1 = 2; }

const int relay_2 = 3; void relayOnOff(int relay){

const int relay_3 = 4; switch(relay)

const int relay_4 = 5; {

int toggleState_1 = 1; //Define integer to remember the toggle state case 1:


for relay 1
if(toggleState_1 == 0){
int toggleState_2 = 1; //Define integer to remember the toggle state
for relay 2 digitalWrite(relay_1, HIGH); // turn on relay 1

int toggleState_3 = 1; //Define integer to remember the toggle state toggleState_1 = 1;


for relay 3
}
int toggleState_4 = 1; //Define integer to remember the toggle state
for relay 4 else{

SoftwareSerial espSerial(5,6); digitalWrite(relay_1, LOW); // turn off relay 1

int count=0; toggleState_1 = 0;

46 | P a g e
} break;

delay(100); default : break;

break; }

case 2:

if(toggleState_2 == 0){ }

digitalWrite(relay_2, HIGH); // turn on relay 2 void loop() {

toggleState_2 = 1;

} LDRReading1 = analogRead(LDR1); // Reading LDR Input.

else{ Serial.println(LDRReading1); // Printing LDR input value.

digitalWrite(relay_2, LOW); // turn off relay 2

toggleState_2 = 0; LDRReading2 = analogRead(LDR2); // Reading LDR Input.

} Serial.println(LDRReading2); // Printing LDR input value.

delay(100);

break; if (!digitalRead(irPin1) && i==1 && state1){

case 3: outsideIr=true;

if(toggleState_3 == 0){ delay(100);

digitalWrite(relay_3, HIGH); // turn on relay 3 i++;

toggleState_3 = 1; state1 = false;

}else{ }

digitalWrite(relay_3, LOW); // turn off relay 3 else if (!digitalRead(irPin2) && i==2 && state2){

toggleState_3 = 0; Serial.println("Entering inside the room");

} outsideIr=true;

delay(100); delay(100);

break; i=1;

case 4: count++;

if(toggleState_4 == 0){ Serial.print("No. of people inside room: ");

digitalWrite(relay_4, HIGH); // turn on relay 4 Serial.println(count);

toggleState_4 = 1; state2 = false;

} }

else{ else if (!digitalRead(irPin2) && i==1 && state2 ){

digitalWrite(relay_4, LOW); // turn off relay 4 outsideIr=true;

toggleState_4 = 0; delay(100);

} i=2;

delay(100); state2 = false;

47 | P a g e
} Serial.println(h2);

else if (!digitalRead(irPin1) && i==2 && state1 ){

Serial.println("Exiting from room"); if(count>=1)

outsideIr=true; {

delay(100); if (LDRReading2> threshold_val2)

count--; { // Condition to make LED ON.

Serial.print("No. of people inside room: "); if(toggleState_1 == 1){

Serial.println(count); digitalWrite(relay_1,LOW);

i = 1; digitalWrite(22,HIGH);

state1 = false; toggleState_1=0;

} }

if (digitalRead(irPin1)){ else if(toggleState_2==1){

state1 = true; digitalWrite(relay_2,LOW);

} digitalWrite(13,HIGH);

if (digitalRead(irPin2)){ toggleState_2==0;

state2 = true; }

} }

else if(LDRReading1> threshold_val1)

float h1 = dht0.readHumidity(); {

float t1 = dht0.readTemperature(); if(toggleState_2==1){

// float h1 = 36.00; digitalWrite(relay_2,LOW);

// float t1 = 18.00; digitalWrite(13,HIGH);

toggleState_2==0;

Serial.print("Sensor 1 temperature: "); }

Serial.println(t1); }

Serial.print("Sensor 1 Humidity: ");

Serial.println(h1); else if(LDRReading1==0)

float h2 = dht1.readHumidity(); if(LDRReading2> threshold_val2)

float t2 = dht1.readTemperature(); { // Condition to make LED ON.

if(toggleState_1 == 1){

Serial.print("Sensor 2 temperature: "); digitalWrite(relay_1,LOW);

Serial.println(t2); digitalWrite(22,HIGH);

Serial.print("Sensor 2 Humidity: "); toggleState_1=0;

48 | P a g e
} if(toggleState_2==1){

else if(toggleState_2==1){ digitalWrite(relay_2,LOW);

digitalWrite(relay_2,LOW); digitalWrite(13,HIGH);

digitalWrite(13,HIGH); toggleState_2==0;

toggleState_2==0; }

} }

} else

else if(LDRReading2> threshold_val1) {

{ digitalWrite(relay_1,HIGH);

if(toggleState_2==1){ toggleState_1=1;

digitalWrite(relay_2,LOW); digitalWrite(22,LOW);

digitalWrite(13,HIGH); digitalWrite(relay_2,HIGH);

toggleState_2==0; toggleState_2=1;

} digitalWrite(13,LOW);

} }

else if(LDRReading2==0) if(t2>30 || t1>30)

{ {

if(LDRReading1> threshold_val2) if(toggleState_3 == 1){

{ // Condition to make LED ON. digitalWrite(relay_3,LOW);

if(toggleState_1 == 1){ digitalWrite(26,HIGH);

digitalWrite(relay_1,LOW); toggleState_3=0;

digitalWrite(22,HIGH); }

toggleState_1=0; else if(toggleState_4==1){

} digitalWrite(relay_4,LOW);

else if(toggleState_2==1){ digitalWrite(12,HIGH);

digitalWrite(relay_2,LOW); toggleState_4==0;

digitalWrite(13,HIGH); }

toggleState_2==0;

} }

else if(t1<30 || t2<30)

} {

else if(LDRReading1> threshold_val1){ if(toggleState_3 == 1){

49 | P a g e
digitalWrite(relay_3,LOW); if(t2>30)

digitalWrite(26,HIGH); {

toggleState_3=0; if(toggleState_3 == 1){

} digitalWrite(relay_3,LOW);

digitalWrite(26,HIGH);

toggleState_3=0;

} }

else if(t1==0) else if(toggleState_4==1){

{ digitalWrite(relay_4,LOW);

if(t2>30) digitalWrite(12,HIGH);

{ toggleState_4==0;

if(toggleState_3 == 1){ }

digitalWrite(relay_3,LOW);

digitalWrite(26,HIGH); }

toggleState_3=0; else if(t2<30)

} {

else if(toggleState_4==1){ if(toggleState_3 == 1){

digitalWrite(relay_4,LOW); digitalWrite(relay_3,LOW);

digitalWrite(12,HIGH); digitalWrite(26,HIGH);

toggleState_4==0; toggleState_3=0;

} }

} }

else if(t2<30) else

{ {

if(toggleState_3 == 1){ digitalWrite(relay_3,HIGH);

digitalWrite(relay_3,LOW); toggleState_3=1;

digitalWrite(26,HIGH); digitalWrite(26,LOW);

toggleState_3=0; digitalWrite(relay_4,HIGH);

} digitalWrite(12,LOW);

} toggleState_4=1;

} }

else if(t2==0)

{ }

50 | P a g e
digitalWrite(26,LOW);

else{ digitalWrite(12,LOW);

digitalWrite(relay_1, HIGH); digitalWrite(13,LOW);

digitalWrite(relay_2,HIGH); }

digitalWrite(relay_3,HIGH);

digitalWrite(relay_4,HIGH); delay(300); // delay to make output readable on serial


monitor.
toggleState_1=1;

toggleState_2=1;

toggleState_3=1;

toggleState_4=1;
}
digitalWrite(22, LOW);

II. Nodemcu ESP8266 Wi-Fi board

Figure A.1 Nodemcu upper & lower view

The microcontroller known as the ESP8266 was created by Espressif Systems. The
ESP8266 is a self-contained WiFi networking system that can execute standalone
programmes and serves as a gateway between Wi-Fi and current micro controllers. This
gadget includes a built-in USB connection as well as a wide range of pin-outs. Similar to
Arduino, you can easily flash the NodeMCU devkit by connecting it to your PC with a
micro USB connection. Additionally, it is right away breadboard compatible.

The NodeMCU ESP8266 prototype board comes with the ESP-12E module, which
houses the ESP8266 chip and Tensilica Xtensa 32-bit LX106 RISC CPU. This

51 | P a g e
microprocessor supports RTOS and has a customizable base frequency range of 80 MHz -
160 MHz. NodeMCU features 128 KB RAM & 4 MB Flash memory to store files and
programs. Thanks to its powerful processing power, integrated Wi-Fi and Bluetooth, and
Deep Sleep Operating capabilities, it is ideal for IOT applications.

 Technical specifications:

 Voltage: 3.3V.
 Soft-AP and Wi-Fi Direct (P2P).
 Current use ranges from 10 uA to 170 mA.
 16MB maximum flash memory attachable (512K normal).
 TCP/IP protocol stacks integration.
 Tensilica L106 32-bit processor.
 Processor clocked at 80–160MHz.
 RAM: 32K + 80K.
 GPIOs: 17 (multiplexed with other functions).
 One input from analogue to digital with a resolution of 1024 steps.
 +19.5dBm is the 802.11b mode output power.
 IEEE 802.11 b/g/n is the wireless standard.
 Maximum concurrent TCP connections: 5.
 Frequency range: 2.412-2.484 GHz
III. 4 channel relay

A microprocessor or sensor can be easily interfaced with using the four-channel relay
module's four 5V relays and the related switching and isolating components with the
fewest possible parts and contacts. Each relay's contacts are marked on the body with the
specifications for 250VAC, 30VDC, and 10A in each case.

52 | P a g e
Figure A.2 4 channel relay

Pin Number Pin Name Description

1 GND Ground reference for the module

2 IN1 Input to activate relay 1

3 IN2 Input to activate relay 2

4 IN3 Input to activate relay 3

5 IN4 Input to activate relay 4

6 VCC Power supply for the relay module

7 VCC Power supply selection jumper

8 JD-VCC Alternate power pin for the relay module


Table A.1 Pin description of 4 channel relay

 Technical specifications

 3.75 to 6 volts for supply


 5mA is the trigger current
 Relay current while in use: 70 mA (single), 300 mA (all four)
 Maximum contact voltage for a relay is 250VAC and 30VDC.
 10A is the maximum relay current.

IV. Arduino mega 2560

A microcontroller board based on the ATmega2560 is called the Arduino Mega 2560. It
contains 16 analogue inputs, 4 hardware serial ports (UARTs), a 16 MHz crystal
oscillator, 54 digital input/output pins (of which 15 may be used as PWM outputs), a USB

53 | P a g e
connector, a power jack, an ICSP header, and a reset button.

Figure A.3 Arduino mega

 Technical specifications

Microcontroller ATmega2560
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limit) 6-20V
Digital I/O Pins 54 (of which 15 provide PWM output)
Analog Input Pins 16
DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 256 KB of which 8 KB used by boot
loader
SRAM 8 KB
EEPROM 4 KB
Clock Speed 16 MHz
LED_BUILTIN 13
Length 101.52 mm
Width 53.3 mm
Weight 37 g
Table A.2 Technical specifications of Arduino mega

54 | P a g e
 Block diagram

Figure A.4 Block diagram of Arduino mega

 Power tree

Figure A.5 Power tree of Arduino mega

Atmega2560 chip, the main processor of the Arduino Mega 2560 Rev3 board,
runs at a frequency of 16 MHz. It can interface with many external devices
because to the numerous input and output lines it can support. The operations and
processing are not slowed at the same time because of its much more RAM than
the other CPUs. The board also has an ATmega16U2 USB serial processor, which
serves as a conduit between the main CPU and the USB input signals. This
extends the Arduino Mega 2560 Rev 3 board's versatility when it comes to
interacting with and attaching peripherals.

55 | P a g e
PUBLICATION AND CERTIFICATION
Related attainment

1. Poster presentation - Secured 3rd position in Abhivyakti (IEEE event BIP Patna) poster
presentation competition
2. Conference paper – Communicated conference paper in ICCPCT 2023

56 | P a g e

You might also like