0% found this document useful (0 votes)
25 views69 pages

Miniproject (B) FINAL

The document presents a mini project report on 'SIGMA HOME: An IoT-Based Home Automation Using Node MCU' submitted by P. Lahya Sai Sravya and others for their Bachelor of Technology degree in Electronics and Communication Engineering. It outlines the motivation, problem definition, and objectives of the project, emphasizing the use of Node MCU for creating an affordable and user-friendly home automation system that enhances convenience, energy efficiency, and security. The report includes acknowledgments, an abstract, and a detailed structure of the project, including hardware and software components.

Uploaded by

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

Miniproject (B) FINAL

The document presents a mini project report on 'SIGMA HOME: An IoT-Based Home Automation Using Node MCU' submitted by P. Lahya Sai Sravya and others for their Bachelor of Technology degree in Electronics and Communication Engineering. It outlines the motivation, problem definition, and objectives of the project, emphasizing the use of Node MCU for creating an affordable and user-friendly home automation system that enhances convenience, energy efficiency, and security. The report includes acknowledgments, an abstract, and a detailed structure of the project, including hardware and software components.

Uploaded by

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

A

Mini Project report


on

SIGMA HOME: AN IOT-BASED HOME AUTOMATION


USING NODE MCU

Submitted in partial fulfillment of the requirements for the award of the


degree of

BACHELOR OF TECHNOLOGY
In

ELECTRONICS AND COMMUNICATION ENGINEERING

By

P. LAHYA SAI SRAVYA (21D21A0490)

Under the Esteemed guidance of


Dr. K. SIVANAGI REDDY
Professor

SRIDEVI WOMEN’S ENGINEERING COLLEGE


ESTD:2001 | An UGC Autonomous Institution | Approved by AICTE & Govt of TS |
Affiliated to JNTUH | Accredited by NBA & NAAC with A++ Grade
An ISO 9001:2015 Certified Institution | EAMCET Code: SDEW
Vattinagulapally | Near WIPRO Gopanpally | Hyderabad-75
(2024-2025)
SRIDEVI WOMEN’S ENGINEERING COLLEGE
ESTD:2001 | An UGC Autonomous Institution | Approved by AICTE and Govt of TS |
Affiliated to JNTUH | Accredited by NBA & NAAC with A++ Grade
An ISO 9001:2015 Certified Institution |EAMCET Code: SDEW
Vattinagulapally | Near WIPRO Gopanpally | Hyderabad-75

BONAFIDE CERTIFICATE

This is to certify that the Mini Project report entitled “SIGMA HOME:AN
IOTBASED HOME AUTOMATION USING NODE MCU” being
submitted by P. LAHYA SAI SRAVYA (21D21A0490) is a Bonafide work
carried out by me under my supervision, for the partial fulfillment of the
requirements for the award of Bachelor of technology in ELECTRONICS
AND COMUNICATION ENGINEERING to Jawaharlal Nehru
Technological University, Hyderabad.

Internal Guide Head of Department


Dr. K. SIVANAGI REDDY Dr. S. JAGADEESH
Professor Professor

Dean of Academics PRINCIPAL


Dr. K. SIVANAGI REDDY Dr. A. NARMADA

EXTERNAL EXAMINER
DECLARATION

We hereby declare that the entire Mini Project work described in this report,

entitled “SIGMA HOME:AN IOT-BASED HOME AUTOMATION

USING NODE MCU” which is being submitted by us in partial fulfillment for

the award of Degree of Bachelor of Technology in the department of

ELECTRONICS AND COMMUNICATION ENGINEERING to SRIDEVI

WOMEN’S ENGINEERING COLLEGE, affiliated to Jawaharlal Nehru

Technological University, Hyderabad, Telangana and Accredited by NBA &

NAAC. The work is original and has not been submitted to any other University

or Institute for the award of any Degree/Diploma.

P. LAHYA SAI SRAYA (21D21A0490)


T. SOWMYA SRI (21D21A04A0)
K. NISHITHA (22D25A0422)

ACKNOWLEDGEMENT
i
First and foremost, our sincere thanks to our guide, Dr. K. SIVANAGI REDDY
Professor, Department of Electronics and Communication Engineering, has given full effort
in guiding the team, achieving the goals as well as his/her encouragement to maintain our
progress in track.

We are indebted to our Mini Project Coordinators Dr. P. SUNEEL KUMAR,


Professor and Dr. K. SURESH KUMAR, Professor, Department of Electronics and
Communication Engineering for their excellent guidance, and encouragement in completion
of this dissertation in our college.

Our sincere thanks to Dr. S. JAGADEESH, Head of the Department, Department


of Electronics and Communication Engineering for his valuable suggestions and advices
during the completion of this project.

We would like to thank Dr. K. SIVANAGI REDDY, Dean of Academics,


Department of Electronics and Communication Engineering for his constant inspiration,
valuable suggestions and advices during the completion of this project.

A special thanks to Dr. A. NARMADA, Principal, Sridevi Women’s Engineering


College, V.N. Pally, Hyderabad for providing this opportunity to carry out the project work
and for her encouragement and suggestions during the course of this project.

We express our sincere thanks to the management for giving us this opportunity to
work in their esteemed organization, for providing all the facilities required for completion of
this project.

We would like to express our thanks to all the Teaching and Non-teaching faculty
members of Electronics and Communication Engineering Department, Our Parents and
Friends who have rendered valuable help in making this project a successful one.

P. LAHYA SAI SRAVYA (21D21A0490)


T. SOWMYA SRI (21D21A04A0)
K. NISHITHA (22D25A0422)
SIGMA HOME: AN IOTBASED HOME AUTOMATION
USING NODE MCU
ii
ABSTRACT

IOT (Internet of Things) based home automation systems have emerged and developed in
recent years to remotely monitor and manage various appliances and gadgets. IOT can be
connected through the internet as it is a device that helps make connections and monitor
various devices and sensors. The paradigm proposed by us uses Node MCU which is an
open-source Wi-Fi-enabled micro controller based on the ESP8266 chip, with IOT because it
is simple and easy to interface with the network for home automation. To monitor various
home devices like lights, temperature, humidity, and fan, different sensors are used. The data
obtained from the sensors are then monitored through an Android application or a web-based
interface, and with this the energy efficiency can be increased by controlling electrical
fixtures through IoT. Here, the data recorded by sensors are fetched by the cloud for further
analysis, perform different commands, and obtain intended result according to the
requirement.

iii
CONTENTS
DECLARATION iii
ACKNOWLEDGEMENT iv
ABSTRACT v
LIST OF CONTENTS vi
LIST OF FIGURES viii

LIST OF CONTENTS

CHAPTER DESCRIPTION PAGE


1. INTRODUCTION 1
1.1 Motivation 2
1.2 Problem Definition 3
1.3 Objective of the project 5
1.4 Organization of the Project 6
2. LITERATURE SURVEY 9
3. PROPOSED SYSTEM 14
4. HARDWARE AND SOFTWARE 16
4.1 HARDWARE 16
4.1ESP32 16
4.2 LDR 18
4.3 DHT-22 21
4.4LCD (Liquid Cristal Display) 25
4.5 PIR SENSOR 30
4.6 ULTRASONIC SENSOR 32
4.7 BLYNK APPLICATION 33
4.2 SOFTWARE
4. RESULT AND DISCUSSION 46
5. CONCLUSION & FUTURE SCOPE 51
REFERENCES 53
APPENDIX 55

LIST OF FIGURES

iv
FIG NO FIGURE NAME PAGE NO
3.1 BLOCK DIAGRAM 18

4.1 ESP32 20

4.2 Table 22

4.3 LDR Sensor 23

4.4 Understanding LDR sensor 24

4.5 LDR symbol 25

4.6 Circuit diagram of LDR sensor 25

4.7 DHT22 sensor 26

4.8 Connecting diagram of DHT22 27

4.9 Timing diagram 28

4.10 2D-Model of the sensor 28

4.11 LCD 29

4.12 LCD -16 2-Pin diagram 31

4.13 PIR sensor module PINOUT Configuration 34

4.14 PIR sensor 35

4.15 Ultrasonic sensor 36

4.16 Ultrasonic sensor datasheet 37

4.17 Blynk appliction 37

4.18 USB mini A-cable 39

4.19 USB mini B-cable 39

v
4.20 Download Arduino IDE software 40

4.21 Launch Arduino LDE 41

4.22 Create a new project 41

4.23 Existing project 42

4.24 Uploading program 42

4.25 Serial port menu 43

4.26 Arduino IDE toolbar 43

4.27 Program structure 44

5.1 Sigma home automation systems 46

5.2 Schematic Diagram 50

vi
CHAPTER 1

INTRODUCTION
Nowadays, technology is increasing immensely to ease human efforts and make
our life swifter and easier. The regular up-gradation and development in technology help us
to dream of a world with all ease and comfort and all the work done automatically. Home
automation is a perfect example depicting the technology which helps us in running all the
household machines either simple or complex automatically. IOT, the Internet of Things, is a
platform that helps us interface physical machines with each other so that they can
communicate among themselves, and this help in the automatic working of physical items
without any direct human involvement. This does not require any human-to human or
human-to-machine communication for the transfer of data over a network.

The network consists of a microprocessor and several sensors (Ultrasonic sensor,


DHT22, Servo motor, LDR, PIR, etc.) among which the communication takes place. The
purposed system helps the user to control all of their home appliances using the mobile
application. The IOT technology is increasing immensely day by day, this helps humans with
easy automation in their homes. This technology is employed in our home for home
automation as this helps in energy as well as time conservation which are major concerns of
our generation as we are lacking both in today’s busy schedule.

The Internet of Things (IoT) is revolutionizing the way we interact with technology,
enabling devices to connect, communicate, and perform tasks autonomously. One of the most
impactful applications of IoT is in home automation, where smart systems improve
convenience, energy efficiency, and security in daily life. Home automation allows users to
control devices such as lights, fans, appliances, and security systems remotely through
smartphones, voice commands, or automated triggers.

Node MCU, a microcontroller board based on the ESP8266 Wi-Fi module, is a popular
choice for building IoT-based home automation systems. Its cost-effectiveness, compact
design, and built-in Wi-Fi capabilities make it ideal for creating scalable, smart systems.
Additionally, its compatibility with the Arduino IDE simplifies programming, making it
accessible to beginners and developers alike.

1
In an IoT-based home automation system using Node MCU, connected devices like
sensors, actuators, and relays communicate through a Wi-Fi network. The Node MCU acts as
the central hub, processing user commands and automating tasks such as turning lights on
and off, adjusting temperature settings, or securing the home. A smartphone app or web
interface serves as the primary control platform, enabling real-time monitoring and control
from anywhere in the world.

The benefits of IoT-based home automation include enhanced convenience, improved


energy efficiency, and increased security. For instance, lights and appliances can be
scheduled to operate only when needed, reducing energy wastage. Security systems with
motion sensors and cameras can send alerts directly to a user's smartphone, offering peace of
mind even when away from home. These features make IoT-based home automation a
practical solution for modern living.

Overall, using Node MCU for home automation offers an affordable, user-friendly,
and versatile way to create a smart home. By leveraging the power of IoT, users can
transform their homes into intelligent spaces that adapt to their needs, enhance daily routines,
and provide greater control over their environment. Whether for hobbyists or tech
enthusiasts, this system offers endless possibilities for innovation and customization.

1.1 MOTIVATION

The growing demand for smarter, more efficient homes drives the motivation for IoT-based
home automation. Modern households seek solutions that offer convenience, energy savings,
and enhanced security. IoT-based systems fulfill this demand by enabling remote and
automated control of devices, transforming traditional homes into intelligent living spaces.
The ease of integrating IoT devices into everyday life serves as a compelling reason to
explore this technology further.

Node MCU, with its built-in Wi-Fi and affordability, has emerged as a key enabler for IoT
applications in home automation. The microcontroller's ability to connect devices to the
internet and handle real-time communication with minimal cost motivates developers and

2
enthusiasts to create innovative solutions. By leveraging its compatibility with popular
programming environments like the Arduino IDE, even individuals with basic technical
knowledge can build sophisticated automation systems.

Energy efficiency is another critical motivator for adopting IoT-based home automation.
With global concerns about energy conservation and climate change, systems that can
monitor and control energy usage are in high demand. For example, IoT-enabled smart
devices can ensure that lights and appliances are turned off when not in use, reducing
electricity bills and environmental impact. This aligns with the growing societal emphasis on
sustainability and eco-friendly living.

Security is a significant concern in today's world, and IoT-based home automation addresses
this need effectively. Systems equipped with motion detectors, surveillance cameras, and
smart door locks provide real-time monitoring and alerts, ensuring the safety of residents and
their belongings. The ability to access these systems remotely through a smartphone or web
interface adds an extra layer of assurance, motivating more homeowners to adopt such
technologies.

Lastly, the motivation to experiment with cutting-edge technologies and customize solutions
for personal needs drives the adoption of Node MCU-based IoT projects. For tech
enthusiasts, home automation provides a hands-on opportunity to explore the potential of IoT
while creating practical and personalized solutions. The low cost and versatility of Node
MCU make it an ideal platform for hobbyists, students, and developers to bring their ideas to
life, further fueling interest in this domain.

1.2 PROBLEM DEFINITION

In today's fast-paced world, managing household devices and appliances efficiently has
become a significant challenge. Traditional home systems require manual operation, which
can be time-consuming, inconvenient, and prone to human error. Forgetting to turn off lights
or appliances is a common issue, leading to unnecessary energy consumption and higher
utility bills. A smarter, automated system is needed to address these inefficiencies and ensure
optimal energy usage.

3
Another critical issue is the lack of remote access to traditional home systems.
Conventional setups do not allow homeowners to control or monitor their appliances and
security systems while they are away. This limitation is particularly inconvenient for
individuals with busy schedules or those who frequently travel. A system that allows remote
control and monitoring via smartphones or web interfaces would provide significant value
and convenience.

Automation and personalization are becoming increasingly important in modern homes,


but traditional systems are often rigid and lack adaptability. They cannot respond
dynamically to changing conditions such as room occupancy, temperature, or lighting. This
lack of real-time adaptability results in missed opportunities for energy savings and
personalized comfort. A more intelligent solution is required to enable homes to adapt
automatically to user needs and environmental conditions.

Home security is another pressing concern, as traditional locks and standalone alarm
systems do not offer real-time monitoring or notifications. In the event of an intrusion,
homeowners may not receive timely alerts, limiting their ability to respond effectively.
Additionally, integrating various security components such as cameras, motion sensors, and
alarms into a cohesive system is often complex and expensive. A cost-effective, integrated
security solution that can be monitored and controlled remotely is needed to address these
gaps.

Affordability and accessibility are significant barriers to adopting advanced home


automation solutions. Many existing systems are expensive and require professional
installation, making them less accessible to average homeowners or hobbyists. There is a
need for a cost-effective solution that is easy to set up, program, and customize, allowing
broader adoption and empowering users to create smart home systems tailored to their needs.

Considering these challenges, the problem is to develop an IoT-based home


automation system using Node MCU that is affordable, scalable, and user-friendly.

4
The solution should enable remote control, real-time monitoring, energy-efficient
automation, and enhanced security. Leveraging the capabilities of Node MCU, the system
should integrate seamlessly with existing household devices and provide a platform for
future expansion and innovation, addressing the growing demands of modern living.

1.3 OBJECTIVE OF THE PROJECT

The primary objective of the IoT-based home automation system using Node-MCU is to
design and implement a smart, efficient, and cost-effective solution for controlling and
monitoring household devices. This system aims to enhance convenience, improve energy
efficiency, and bolster home security by leveraging the capabilities of IoT technology and the
versatile Node-MCU microcontroller.

Key Objectives:

1. Remote Accessibility: Enable users to control and monitor home appliances, lights,
and security systems from anywhere using a smartphone or web-based interface.
This ensures flexibility and convenience for users with busy lifestyles or those
frequently away from home.

2. Energy Efficiency: Develop a system that minimizes energy wastage by automating


the operation of devices based on environmental conditions, user schedules, or
occupancy. This helps reduce utility bills and supports sustainability efforts.

3. Enhanced Security: Integrate security features such as motion sensors, surveillance


cameras, and alarms to provide real-time monitoring and alerts for potential threats.
Allow users to receive instant notifications and take action remotely if needed.

4. Automation
Implement intelligent automation features to adapt device operations to user
preferences and environmental conditions. For example, adjust lighting based on
natural light levels or turn off unused devices automatically.

5. Cost-Effectiveness and Scalability: Provide a budget-friendly solution using Node


MCU, making it accessible to a wide range of users, including hobbyists and tech

5
enthusiasts. Ensure that the system is scalable and capable of integrating additional
devices or functionalities as needed.

6. User-Friendly Design: Design a system that is easy to set up, configure, and
operate. The system should require minimal technical expertise, ensuring a seamless
experience for users.

By achieving these objectives, the IoT-based home automation system using Node-MCU
aims to transform traditional homes into intelligent, energy-efficient, and secure living spaces
tailored to the needs of modern users.

1.4 ORGANIZATION OF PROJECT

An IoT-based home automation system using Node-MCU requires a well-organized structure


to ensure seamless functionality, integration, and scalability. The organization involves
multiple layers, including hardware, software, communication protocols, and user interfaces,
all working in harmony to create a smart, connected system.

1. Hardware Architecture

 Node-MCU Microcontroller: The core of the system, responsible for connecting to


Wi-Fi, processing commands, and managing communication with connected devices.

 Sensors:
Used for detecting environmental conditions such as temperature, light, motion, or
humidity. Examples include DHT11 for temperature and PIR sensors for motion
detection.

 Actuators:
Devices like relays, motors, or servos that execute actions such as turning on/off
lights, fans, or appliances based on user commands or sensor data.

 Power Supply: A reliable power source to ensure uninterrupted operation of Node-


MCU and connected devices.

6
 Other Components: Includes LEDs, resistors, push buttons, and connectors for
building and testing the system.

2. Software Infrastructure

 Firmware Programming: Node-MCU is programmed using the Arduino IDE or


similar environments to implement control logic, communication protocols, and
automation algorithms.

 Cloud Integration: Optional cloud services (e.g., Firebase, AWS IoT) for storing
data, managing device states, and enabling remote control.

 Database (Optional): Local or cloud-based databases to log sensor readings, user


preferences, and device statuses for analysis or future reference.

3. Communication Protocols

 Wi-Fi Connectivity: Node-MCU’s built-in ESP8266 module ensures seamless


communication with the home’s Wi-Fi network, enabling internet access for remote
monitoring and control.

 MQTT/HTTP Protocols: MQTT (Message Queuing Telemetry Transport) or HTTP


protocols are used for communication between devices and the server or app. MQTT
is preferred for its lightweight nature and efficiency in IoT applications.

 Inter-Device Communication: Communication between Node-MCU and


sensors/actuators is achieved using GPIO pins and protocols like I2C or SPI.

4. User Interface

 Mobile App: A smartphone app serves as the primary interface for users to control
devices, monitor sensor data, and receive notifications. Popular frameworks like
Blynk or custom apps can be used.

 Web Dashboard: An optional web interface allows users to monitor and control the
system through a browser. This can be hosted locally or on a cloud server.

7
 Voice Assistants (Optional): Integration with voice assistants like Google Assistant
or Amazon Alexa for hands-free control and enhanced user experience.

5. Automation Logic

 Scheduling: Enable scheduled operation of devices, such as turning off lights at a


specific time or activating appliances before users arrive home.

 Event-Based Triggers: Implement automation rules where devices react to sensor


inputs, such as turning on lights when motion is detected or adjusting temperature
based on room conditions.

 Custom Routines: Allow users to define custom routines and scenarios to suit their
specific needs, such as "Good Morning" routines that adjust multiple devices
simultaneously.

6. Security and Privacy

 Secure Communication: Encrypt data transmission using secure protocols (e.g.,


HTTPS, SSL/TLS) to protect user data from unauthorized access.

 Access Control: Implement authentication mechanisms, such as user login


credentials, to ensure only authorized users can control the system.

 Data Privacy: Store and process user data responsibly, ensuring compliance with
privacy standards and minimizing unnecessary data collection.

The structure of the proposed work will consist of several key chapters. The 2nd chapter will
provide an in-depth exploration of the existing literature offering a comprehensive survey of
relevant studies and research in the field. Following that the 3rd chapter will elucidate the
procedure proposed method, detailing the methodology and approach employed in this work.
Subsequently the 4th chapter will dive into the presentation of Hardware components. The
5th chapter will dive into the presentation of results. Lastly, the 6th chapter will encapsulate
the conclusion drawn from the work, summarizing the key findings, and providing insights
into potential future scope of research.

8
CHAPTER 2

2 LITRATURE SURVEY
Advancements in the technologies are higher, especially for IOT, this can be integrated well
with home automation to enhance daily lifestyle. Remote controlled automation systems are
very helpful for bedridden patients and physically handicapped persons. Here a prototype is
presented to implement the IOT based portable automation system. Google Assistant and
Blynk are available applications for voice controlling. The demonstration of this system was
performed with controlling the light. This system is simple and user friendly especially for
elders and children. Hardware system is designed with the ESP32 Micro controller which has
an inbuilt Wi-Fi module. As the Wi-Fi connectivity is provided, the system can be controlled
even from a large distance.[1]

The increasing need for remote management in home quarantine scenarios has prompted the
development of an integrated system that combines voice-controlled home automation,
security monitoring, and robotic assistance. This study presents a novel approach that utilizes
voice recognition technology to enable patients in quarantine to control their home
environment and ensure their safety. Additionally, the system incorporates a virtual joystick-
controlled robot, providing a means for interaction and support without physical contact.[2]

The Internet of Things (IoT) refers to a system of interrelated, internet-connected objects that
are able to collect and transfer data over a wireless network. It used to be controlled by
websites and smart phone applications remotely, also, to control tools and instruments by
codes and algorithms structures for artificial intelligence issues. In case we want to create
advanced systems using different algorithms, Wi-Fi or Ethernet connection is connected to
our tools, equipment, and devices controlling them by smart phone applications or internet
websites. A smart home to operate lamps or other home-use devices, it can be used as a
security system or an industrial-use system, for example, to open or close the main building
gate, to operate full automatic industrial machine, or even to control internet and
communication ports using IOT technology.[3]

One can quickly achieve automation by connecting home appliances to the Internet or cloud
storage. The cloud computing-based platform helps to connect with the things that surround

9
everyone so that they can easily access anything and everything anytime anywhere in a user-
friendly way. This IOT paper focuses on building an innovative wireless system that allows
the owner to control the appliances of the place. The most important aspect of this system is
to incorporate smooth working of the automated appliances via both the internet and the
manual control.It has 17 programmable GPIOs, enough to control all four relays, and two
servo motors for the paper. Bell types switches are used for the manual control of the
appliances. [4]

This work presents the development of Home Automation system to increase the comfort and
quality of life. In this system a smart phone is used to control and monitor the home
appliances using MQTT, Node-RED, IFTTT, Mongoose OS, Android app and Google
Assistant. This work uses a Node-MCU based Wi-Fi micro-controller which has been
connected to a MQTT broker. Mongoose OS has been made use of. This works uses Node-
RED using which flows are created to control the publishing of the data over to a MQTT
broker. Google Assistant and an android app are connected to Node-RED flows using IFTTT
platform. This system can be controlled through Google Assistant and an android app.[5]

Home automation system automates the majority of electronic and electrical tasks. This uses
a mix of hardware and software to control and manage appliances and devices inside a home.
The fundamental purpose of tracking electronic devices in the modern world through the use
of the Internet of Things (IoT) is to regulate them according to situational requirements. The
need for efficient monitoring is greater with the advancement of technology as it optimizes
efficiency and saves excessive power and resource wastage. Turning on lights during
daytime can be avoided in this way. Node-MCU is very popular in-Home Automation. It’s
Wi-Fi features and support for Arduino IDE makes it easier for IoT Applications. Home
appliances can be controlled using the Android Application which is Blynk App. [6]

In this modern era, internet connectivity is widespread and easily affordable. Therefore, it has
become an essential part of everyday life. The Internet of Things (IoT) is a network where
devices, appliances, and other items along with the sensors and software are connected to the
network via the internet. This paper presents a user-friendly and straightforward approach for
controlling and monitoring home appliances using the IoT-based smart multi-plug. This
smart multi-plug can be accessed, monitored, and controlled through a smartphone using Wi-

10
Fi via the smartphone Blynk framework. For this, it does not require any extra coding,
irrespective of the internet connection used, making this multi-plug convenient and user-
friendly. Moreover, it protects the appliances and the plugs from being damaged against
overload, over-temperature. Furthermore, it offers voice command control through Google
Assistant and timer setup for each plug, saving electricity, human energy, and effort. [7]

World live in an exciting time where more and more everyday items “things” are becoming
smart! “Things” have sensors and can communicate to other “things” and can provide control
to more “things”. The Internet of Things, IOT, is upon us in a huge way and people are
rapidly inventing new gadgets that enhance our lives. The price of microcontrollers with the
ability to talk over a network keeps dropping and developers can now tinker and build things
inexpensively. Internet of things is a growing network of everyday object-from industrial
machine to consumer goods that can share information and complete tasks while you are
busy with other activities. Wireless Home Automation system (WHAS) using IOT is a
system that uses computers or mobile devices to control basic home functions and features
automatically through internet from anywhere around the world, an automated home is
sometimes called a smart home. It is meant to save the electric power and human energy.[8]

By the virtue of blooming automation industry and wireless connectivity, all the devices
within the home can be connected. Today's World is moving to digitalization where
everything is made easy and comfortable for people i.e. young youth as well as senior citizen.
Smart Automated House Application using IOT (Internet of Thing) is a system where basic
house facility can be handled by device from any place such as ON and Off of Light, Fan,
AC, Water pump, Gardening of Water. One can handle all these things with help of device
Node-MCU ESP8266 [1], Android Application, Internet Connection. This paper include
functionality of node esp8266 are connected with either of above given house application
like fan, light, water pump, gardening with help of coding and hosting online with web
server. All the functionality is handled by Mobile App created in android application, from
which house application are controlled with help of internet. This paper is clarifying that
monitoring of circuit devices through wireless using Node MCU and controlling using App
Blynk. [9]

11
Analog switches are mounted on the walls. Operating them is a tedious task as they need to
be physically pressed each time an appliance has to be powered on or off. This hassle is
replaced by a smart technique that involves operating the switches through a Web Browser of
a Mobile phone or a PC. The present smart switches available in the market are very
expensive and also require additional devices like hubs for their working. This paper uses the
Cloud and a Web Browser to control the manually operated switches. A cloud server is
created for the environment where the switches are mounted. The switches are interfaced
with NodeMCU which has an inbuilt Wi-Fi. It can use this to enable or disable the switches.
The user communicates with the processor through the Web Browser. The processor then
controls the switches based on the commands received from the user and also updates the
user about the status of the switches after the control operation is performed to the cloud.
[10]

Home automation is a modern technology that helps to enjoy comfortable living conditions
inside the home. With home automation, data can be instantly collected and passed between
devices and analyzed simultaneously. By connecting the home appliances with the internet,
they can be easily accessed from anywhere. In the home automation system, settings are
feasible through smartphones or other remote-control devices. This paper gives the design
and implementation of a new voice-controlled home automation system that uses Google
Assistant for giving user’s voice commands as input. It is a low cost and flexible home
automation and monitoring system. It enables the user to use a home automation system
based on the Internet of Things (IoT). Home appliances like fans and lights can be controlled.
The fundamental purpose of this project is to control electronic appliances based on the
situational demands of the user. [11]

Protection of our personal properties is a key challenge and prior responsibility every time
which affects massively on a day to day life. The current system of achieving security has
plenty of drawbacks and less secure. The main goal of implementing a home security and
automation system is to achieve a powerful and more secure way to handle the day to day
stuff preventing from misuse hands and keeping track of usage of home electrical appliances
to know the necessary and unnecessary actions. The system is built on IoT (Internet of
things) to make more accurate and error-free control over the flow of the system. To make

12
the difference from the existing system, in this proposed system we built the communication
of hardware devices with a web application where devices take commands and operate it
while web application rise the commands and keeps track of each transaction made so far.
The combination of hardware and software will make life easier and safer for its users. [12]

Living in digital age, various things are getting available for us in an instant click. It has
become essential for us to conserve energy we consume on daily usage through electrical
appliances by handling it the effective way. For that purpose, we have come up with an IOT
based system to control electrical appliances with the help of various sensors and a central
microprocessor that is with a NodeMcuESP8266 or a generic Arduino-UNO. A Blynk server
has been used in the process to obtain data from the sensor and process it accordingly. It this
system we have made sure not only to control the electrical appliances based on the data
received from the sensor and acting accordingly, we have also left a scope to control it
manually as per user’s convenience for remote control access. Based on the data received
from the sensors, various actions can be taken further like emergency alerts. [13]

Monika, Vivek Kumar,Sankha Sunhra Kundu, Yash Gehlot, and Aditya Gurung, “Sigma
Home: An IOT-based Home Automation using Node MCU”,Existing IoT-based home
automation systems have transformed traditional home management by enabling smart
control and monitoring of devices through internet connectivity. These systems typically
consist of a central controller, such as a microcontroller or microprocessor, connected to
various sensors and actuators. Commonly used technologies include Wi-Fi-enabled
microcontrollers like Node-MCU or ESP32, which facilitate communication between devices
and a smartphone or web-based interface. Current systems allow users to control appliances
such as lights, fans, and security devices remotely, schedule operations, and monitor
environmental conditions like temperature or motion. Features like voice control, integration
with smart assistants (e.g., Alexa or Google Assistant), and cloud-based data storage are
increasingly popular. However, despite their growing adoption, these systems often face
challenges such as high costs, complex installations, and concerns about data security and
privacy, creating opportunities for further development and optimization.

13
In our proposed work we concentrate on reducing the drawbacks of the Existing system. The
achieved results will be discussed in chapter 3.

14
CHAPTER 3

IOT BASED HOME AUTOMATION USING NODE MCU

The first requirement is to understand the need for home automation in everyday life. We
need home automation to make people's lives comfortable, minimize the usage of energy,
and ensure safety. The proposed system consists of Node MCU and different sensors in the
hardware part and an Android application or a web server and a user-friendly web interface,
installed libraries for connecting sensors to Node MCU in the software part. We will connect
the Wi-Fi module of Node MCU with the mobile and sensors, then send the data to the cloud.
We will fetch the recorded data for further analysis and can monitor the home automatically.
By using the Blynk application we can control different appliances. Users can control the
home from their devices and ensure total security.

Mobile
App/Web

Cloud Server
(Blynk/Firebase)

Sensors (PIR, Node-MCU Actuators


Temp, Lights) (ESP8266)
(Lights, Fan)
|(Devices)

Relay Module

FIG:3.1 BLOCK DIAGRAM

15
The proposed IoT-based home automation system using Node-MCU aims to overcome the
limitations of existing systems by providing a more secure, reliable, and user-friendly
solution for controlling home appliances. This system integrates Node-MCU (ESP8266) as
the central controller due to its cost-effectiveness, built-in Wi-Fi capabilities, and ease of
programming. It allows users to remotely monitor and control home devices through a
mobile application or web interface, ensuring convenience, energy efficiency, and enhanced
security.
The system will consist of various sensors (such as temperature, motion, and
humidity sensors) and actuators (like relays for controlling lights, fans, and other appliances)
connected to the Node-MCU. Communication between devices will be secured using
lightweight protocols like MQTT with SSL/TLS encryption to prevent unauthorized access
and data breaches. Additionally, the system will support both cloud-based and local server
operations to ensure functionality even during internet outages, enhancing reliability.
To improve user experience, the system will feature voice control integration with
smart assistants like Amazon Alexa and Google Assistant. Customizable automation rules
and real-time notifications will provide personalized and responsive home management.
Furthermore, a scalable architecture will allow easy integration of additional devices without
complex configurations, ensuring long-term adaptability.
Power backup solutions, such as battery-supported modules, will be implemented to
maintain operation during power failures. The system will also include energy monitoring
features to track and optimize power consumption, promoting energy efficiency. By
addressing the shortcomings of existing systems, the proposed IoT-based home automation
system using Node-MCU offers a secure, scalable, and cost-effective solution for modern
smart home automation.

16
CHAPTER 4
HARDWARE AND SOFTWARE COMPONENTS

4.1 HARDWARE
4.1.1 ESP32

 ESP32 comes with an on-chip 32-bit microcontroller with integrated Wi-Fi +


Bluetooth + BLE features that targets a wide range of applications.
 ESP32 is a series of low-cost, low-power system on chip microcontrollers with
integrated Wi-Fi and dual-mode Bluetooth.
 The ESP32 series employs either a Ten silica Xtensa LX6 microprocessor in both
dual-core and single-core variations, an Xtensa LX7 dual-core microprocessor, or
a single-core RISC-V microprocessor and includes built-in antenna
switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power-
management modules.
 Commonly found either on device specific PCB s or on a range of development
boards with GPIO pins and various connectors depending on the model and
manufacturer of the board.
 ESP32 is created and developed by express if Systems, a Chinese company based in
Shanghai, and is manufactured by TSMC using their 40nm process.

4.1 ESP32

17
Key Component Description

ESP32-MINI-1 module or ESP32-MINI-1U module. ESP32-MINI-1 comes


with an on-board PCB antenna. ESP32-MINI-1U comes with an external
On-board module
antenna connector. The two modules both have a 4 MB flash in chip
package. For details, please see ESP32-MINI-1 & ESP32-MINI-1U Datasheet.

5 V to 3.3 V LDO Power regulator converts 5 V to 3.3 V.

Download button. Holding down boot and then pressing Reset initiates
Boot Button
Firmware Download mode for downloading firmware through the serial port.

Reset Button Reset Button

USB interface. Power supply for the board as well as the communication
Micro-USB Port
interface between a computer and the ESP32 chip.

USB-to-UART Bridge Single USB-UART bridge chip provides transfer rates up to 3 Mbps.

Turns on when the USB is connected to the board. For details, please see the
3.3 V Power On LED
schematics in Related Documents.

All available GPIO pins (except for the SPI bus for flash) are broken out to
I/O Connector the pin headers on the board. Users can program ESP32 chip to enable
multiple functions.

FIG:4.2 TABLE

18
Specifications of ESP32

ESP32 has a lot more features than ESP8266 and it is difficult to include all the
specifications in this Getting Started with ESP32 guide. So, I made a list of some of the
important specifications of ESP32 here. But for complete set of specifications, I strongly
suggest you to refer to the Datasheet.

 Single or Dual-Core 32-bit LX6 Microprocessor with clock frequency up to 240


MHz.

 520 KB of SRAM, 448 KB of ROM and 16 KB of RTC SRAM.

 Supports 802.11 b/g/n Wi-Fi connectivity with speeds up to 150 Mbps.

 Support for both Classic Bluetooth v4.2 and BLE specifications.

 34 Programmable GPIOs.

 Up to 18 channels of 12-bit SAR ADC and 2 channels of 8-bit DAC

 Serial Connectivity include 4 x SPI, 2 x I2C, 2 x I2S, 3 x UART.

 Ethernet MAC for physical LAN Communication (requires external PHY).

 1 Host controller for SD/SDIO/MMC and 1 Slave controller for SDIO/SPI.

4.1.2 LDR

LDR (Light Dependent Resistor) is a two-pin sensor whose negative pin is connected to the
ground pin of Node MCU and the positive pin is connected to any of the digital pin of Node
MCU. It is interfaced with LEDs for an automatic lighting system. Whenever there is
darkness in the room the LDR sensor will detect it and will automatically switch on the
LEDs and switch off them whenever there is sufficient light in the room. We are also using
an LDR sensor for the same purpose of automatic lighting as it will help in energy
conservation because in day time the LDR sensor will automatically switch off all the light.

19
FIG 4.3 LDR SENSOR

SPECIFICATIONS OF LDR MODULE:

 Operating Voltage:3V to 5V DC

 Operating Current: 15milli amps

 Output Digital: 0V to 5V, Adjustable trigger level from preset

 Output Analog:0V to 5V based on light falling on the LDR

PINOUT OF LDR MODULE:

 VCC: Power supply

 GND: Ground

 D0: Digital Output

 A0: Analog Output

20
FIG:4.4 UNDERSTANDING LDR SENSORS

The Light-dependent resistors made with photosensitive semiconductor materials like


Cadmium Sulphides (CdS), lead sulfide, lead selenide, indium antimonide, or cadmium
selenide and they are placed in a Zig-Zag shape as you can see in the pic below. Two metal
contacts are placed on both ends of the Zig-Zag shape these metal contacts help in creating a
connection with the LDRs.Now, a transparent coating is applied on the top so that the zig-
zag-shaped photosensitive material gets protected and as the coating is transparent the LDR
will be able to capture lightfrom the outer environment for its working.

FIG:4.5 LDR SYMBOL

21
LDR Working Principle

It works on the principle of photoconductivity whenever the light falls on its photoconductive
material, it absorbs its energy and the electrons of that photoconductive material in the
valence band get excited and go to the conduction band and thus increasing the conductivity
as per the increase in light intensity. Also, the energy in incident light should be greater than
the bandgap gap energy so that the electrons from the valence band got excited and go to the
conduction band. The LDR has the highest resistance in dark around 1012 Ohm and this
resistance decreases with the increase in Light.

FIG:4.6 CIRCUIT DIAGRAM OF LDR SENSOR

4.1.3 DHT-22

DHT-22 is a 3-pin temperature humidity sensor that is used to detect temperature and
humidity. In this, the positive and negative pin of the sensor is connected to the voltage pin
and ground pin of Node MCU respectively and the output pin of the sensor is connected to
any of the digital pin of Node MCU. We interfaced it with the fan and exhaust fan so that
whenever there is an increase in temperature and humidity in the room the sensor could
detect it and when it passes the given limit it could which on the fan and exhaust
respectively.

22
FIG 4.7 DHT 22 SENSOR

DHT22 Specifications

 Operating Voltage: 3.5V to 5.5V

 Operating current: 0.3mA (measuring) 60uA (standby)

 Output: Serial data

 Temperature Range: -40°C to 80°C

 Humidity Range: 0% to 100%

 Resolution: Temperature and Humidity both are 16-bit

 Accuracy: ±0.5°C and ±1%

Where DHT22 Sensor is Used

 The DHT22 is a commonly used Temperature and humidity sensor. The sensor
comes with a dedicated NTC to measure temperature and an 8-bit microcontroller to
output the values of temperature and humidity as serial data. The sensor is also
factory calibrated and hence easy to interface with other microcontrollers.

23
 The sensor can measure temperature from -40°C to 80°C and humidity from 0% to
100% with an accuracy of ±1°C and ±1%. So if you are looking to measure in this
range then this sensor might be the right choice for you.

How to use DHT22 Sensor

The DHT22 Sensor is factory calibrated and outputs serial data and hence it is highly
easy to set it up. The connection diagram for this sensor is shown below.

FIG:4.8 CONNECTION DIAGRAM OF DHT22

 As you can see the data pin is connected to an I/O pin of the MCU and a 5K pull up
resistor is used. This data pin outputs the value of both temperature and humidity as
serial data. If you are trying to interface DHT22 with Arduino Uno then there are
ready made libraries for it which will give you a quick start.
 If you are trying to interface it with some other MCU then the datasheet given below
will come in handy. The output given out by the data pin will be in the order of 8bit
humidity integer data + 8bit the Humidity decimal data +8 bit temperature integer data
+ 8bit fractional temperature data +8 bit parity bit. To request the DHT11 module to
send these data the I/O pin has to be momentarily made low and then held high as
shown in the timing diagram below.

24
FIG:4.9 TIMING DIAGRAM
 The duration of each host signal is explained in the datasheet, with neat steps and
illustrative timing diagrams

Applications

 Measure temperature and humidity

 Local Weather station

 Automatic climate control

 Environment monitoring

FIG:4.10:2D – MODEL OF THE SENSOR

25
4.1.4 LCD (Liquid Cristal Display)

The term LCD stands for liquid crystal display. It is one kind of electronic display module
used in an extensive range of applications like various circuits & devices like mobile phones,
calculators, computers, TV sets, etc. These displays are mainly preferred for multi-
segment light-emitting diodes and seven segments. The main benefits of using this module
are inexpensive; simply programmable, animations, and there are no limitations for
displaying custom characters, special and even animations, etc.

FIG:4.11 LCD

A liquid crystal display (LCD) is a thin, flat display device made up of any number of color
or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a
column of liquid crystal molecules suspended between two transparent electrodes, and two
polarizing filters, the axes of polarity of which are perpendicular to each other. Without the
liquid crystals between them, light passing through one would be blocked by the other.

The liquid crystal twists the polarization of light entering one filter to allow it to pass through
the other. A program must interact with the outside world using input and output devices that
communicate directly with a human being. One of the most common devices attached to an
controller is an LCD display. Some of the most common LCDs connected to the controllers
are 16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters
per line by 2 lines and 20 characters per line by 2 lines, respectively. Shapes and available.

26
Line lengths of 8, 16, 20, 24, 32 and 40 characters are all standard, in one, two Many
microcontroller devices use 'smart LCD' displays to output visual information.

LCD displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it
is even possible to produce a readout using the 5X7 dots plus cursor of the display. They
have a standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the
display requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0).

For a 4-bit data bus it only requires the supply lines plus 6 extra lines (RS RW D7 D6 D5
D4). When the LCD display is not enabled, data lines are tri-state and they do not interfere
with the operation of the microcontroller.

LCD 16×2 Pin Diagram

The 16×2 LCD pinout is shown below.

 Pin1 (Ground/Source Pin): This is a GND pin of display, used to connect the GND
terminal of the microcontroller unit or power source.

 Pin2 (VCC/Source Pin): This is the voltage supply pin of the display, used to connect
the supply pin of the power source.

 Pin3 (V0/VEE/Control Pin): This pin regulates the difference of the display, used to
connect a changeable POT that can supply 0 to 5V.

 Pin4 (Register Select/Control Pin): This pin toggles among command or data register,
used to connect a microcontroller unit pin and obtains either 0 or 1(0 = data mode,
and 1 = command mode).

 Pin5 (Read/Write/Control Pin): This pin toggles the display among the read or writes
operation, and it is connected to a microcontroller unit pin to get either 0 or 1 (0 =
Write Operation, and 1 = Read Operation).

 Pin 6 (Enable/Control Pin): This pin should be held high to execute Read/Write
process, and it is connected to the microcontroller unit & constantly held high.

27
 Pins 7-14 (Data Pins): These pins are used to send data to the display. These pins are
connected in two-wire modes like 4-wire mode and 8-wire mode. In 4-wire mode,
only four pins are connected to the microcontroller unit like 0 to 3, whereas in 8-wire
mode, 8-pins are connected to microcontroller unit like 0 to 7.

 Pin15 (+ve pin of the LED): This pin is connected to +5V

 Pin 16 (-ve pin of the LED): This pin is connected to GND.

FIG 4.12 LCD-16×2-PIN-DIAGRAM

Features of LCD16x2

The features of this LCD mainly include the following.

 The operating voltage of this LCD is 4.7V-5.3V

28
 It includes two rows where each row can produce 16-characters.

 The utilization of current is 1mA with no backlight

 Every character can be built with a 5×8 pixel box

 The alphanumeric LCDs alphabets & numbers

 Is display can work on two modes like 4-bit & 8-bit

 These are obtainable in Blue & Green Backlight

 It displays a few custom generated characters

Registers of LCD

A 16×2 LCD has two registers like data register and command register. The RS (register
select) is mainly used to change from one register to another. When the register set is ‘0’,
then it is known as command register. Similarly, when the register set is ‘1’, then it is known
as data register.

Command Register

The main function of the command register is to store the instructions of command which are
given to the display. So that predefined tasks can be performed such as clearing the display,
initializing, set the cursor place, and display control. Here commands processing can occur
within the register.

Data Register

The main function of the data register is to store the information which is to be exhibited on
the LCD screen. Here, the ASCII value of the character is the information which is to be
exhibited on the screen of LCD. Whenever we send the information to LCD, it transmits to
the data register, and then the process will be starting there. When register set =1, then the
data register will be selected.

29
16×2 LCD Commands

The commands of LCD 16X2 include the following.

 For Hex Code-01, the LCD command will be the clear LCD screen

 For Hex Code-02, the LCD command will be returning home

 For Hex Code-04, the LCD command will be decrement cursor

 For Hex Code-06, the LCD command will be Increment cursor

 For Hex Code-05, the LCD command will be Shift display right

 For Hex Code-07, the LCD command will be Shift display left

 For Hex Code-08, the LCD command will be Display off, cursor off

 For Hex Code-0A, the LCD command will be cursor on and display off

 For Hex Code-0C, the LCD command will be cursor off, display on

 For Hex Code-0E, the LCD command will be cursor blinking, Display on

 For Hex Code-0F, the LCD command will be cursor blinking, Display on

 For Hex Code-10, the LCD command will be Shift cursor position to left

 For Hex Code-14, the LCD command will be Shift cursor position to the right

 For Hex Code-18, the LCD command will be Shift the entire display to the left

 For Hex Code-1C, the LCD command will be Shift the entire display to the right

 For Hex Code-80, the LCD command will be Force cursor to the beginning ( 1st line)

 For Hex Code-C0, the LCD command will be Force cursor to the beginning ( 2nd
line)

 For Hex Code-38, the LCD command will be 2 lines and 5×7 matrix

30
4.1.5 PIR SENSOR

PIR (Passive Infrared sensor) is a 3-pin sensor that is used to detect motion. In this the VCC
pin is connected to the 3V pin of the Node MCU, the ground pin is also connected to the
ground pin of the Node MCU, and the output pin is connected to any one of the digital pins
of the Node MCU. It is a passive device that detects infrared emitting radiation by humans
and animals in motion . It is used in automatic door openings and security systems. This
sensor has a pyroelectric sensor and lens which works together for generating voltage and
focusing on infrared radiation. It consumes less energy and is reliable and effective . We are
using it for the same application as mentioned above and also it is interfaced with LEDs in
the staircase so that whenever there is a motion will detect it switch on the light.

PIR Sensor Module Pinout Configuration

Pin Pin Name Description


Number

1 VCC Input voltage is +5V for typical applications. Can range from 4.5V-
12V

2 High/Low Digital pulse high (3.3V) when triggered (motion detected) digital
Output low(0V) when idle (no motion detected

3 Ground Connected to ground of circuit

FIG:4.13 PIR SENSOR MODULE PINOUT CONFIGURATION

31
FIG 4.14 PIR SENSOR

PIR Sensor Features

 Wide range on input voltage varying from 4.V to 12V (+5V recommended)

 Output voltage is High/Low (3.3V TTL)

 Can distinguish between object movement and human movement

 Has to operating modes - Repeatable(H) and Non- Repeatable(H)

 Cover distance of about 120° and 7 meters

32
4.1.6 ULTRASONIC SENSOR
Ultrasonic sensor: HC-SR04 is the ultrasonic sensor having 4 pins named VCC, GND, Trig,
and Echo. The VCC pin is connected to the 3V pin of Node MCU; the GND pin is connected
to the ground pin of Node MCU; the Trig and Echo pin of the sensor is connected to the
digital pins (let it be D3 and D4 respectively) of Node MCU. This sensor is used for
detecting objects in front and also measuring the distance. In our project, we have interfaced
the ultrasonic sensor with the servo motor, and we have fixed a limit to this that whenever
any object crosses that limit and comes closer to the sensor.

FIG 4.15 ULTRASONIC SENSORS

The sensor has 4 pins. 5volts is supplied to the VCC pin and GND is connected to the GND
of Arduino. There are two other pins called TRIG and ECHO pins. The Trig pin transmits an
ultrasonic wave and the ECHO pin receives the reflected signal from the object.

Ultrasonic Sensor Datasheet

Model No. HC-SR04

Working Voltage 5v

Working Current 15mA

33
Working Frequency 40Hz

Max Range 4m

Min Range 2cm

Measuring Angle 15 degrees

FIG 4.16: ULTRASONIC SENSOR DATASHEET

4.1.7 BLYNK APPLICATION

The Blynk app is used for creating applications. It is an IOTinterfacing medium used to
interface the sensors and devices we use with our smartphones with the help of the internet. It
has easy access and a variation of dashboards and we can create many web applications quite
easily. We are using Blynk 2.0 for our project through which we are interfacing our various
sensors with our smartphones via the internet and we can easily control those sensors and
devices using this app.

FIG 4.17 BLYNK APPLICATION

34
4.2 SOFTWARE

Arduino IDE (Integrated Development Environment) is required to program the Arduino


Uno board. Once Arduino IDE is installed on the computer, connect the board with
computer using USB cable. Now open the Arduino IDE and choose the correct board by
selecting Tools>Boards>Arduino Uno, and choose the correct Port by selecting Tools>Port.
Arduino Uno is programmed using Arduino programming language based on Wiring. To get
it started with Arduino Uno board and blink the built-in LED, load the example code by
selecting Files>Examples>Basics>Blink. Once the example code (also shown below) is
loaded into your IDE, click on the ‘upload’ button given on the top bar. Once the upload is
finished, you should see the Arduino’s built-in LED blinking. Below is the example code
for blinking:

ARDUINO – INSTALLATION

After learning about the main parts of the Arduino UNO board, we are ready to learn how to
set up the Arduino IDE. Once we learn this, we will be ready to upload our program on the
Arduino board.

In this section, we will learn in easy steps, how to set up the Arduino IDE on our computer
and prepare the board to receive the program via USB cable.

Step 1: First you must have your Arduino board (you can choose your favorite board) and a
USB cable. In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega
2560, or Diecimila, you will need a standard USB cable (A plug to B plug), the kind you
would connect to a USB printer as shown in the following image.

35
FIG 4.18 USB MINI A-CABLE

In case you use Arduino Nano, you will need an A to Mini-B cable instead as shown in the
following image

FIG 4.19 USB MINI B-CABLE

Step 2: Download Arduino IDE Software.

You can get different versions of Arduino IDE from the Download page on the Arduino
Official website. You must select your software, which is compatible with your operating
system (Windows, IOS, or Linux). After your file download is complete, unzip the file.

36
FIG 4.20 DOWNLOAD ARDUINO IDE SOFTWARE

Step 3: Power up your board.

The Arduino Uno, Mega, Due milanove and Arduino Nano automatically draw power from
either, the USB connection to the computer or an external power supply. If you are using an
Arduino Diecimila, you have to make sure that the board is configured to draw power from
the USB connection. The power source is selected with a jumper, a small piece of plastic
that fits onto two of the three pins between the USB and power jacks. Check that it is on the
two pins closest to the USB port.

Connect the Arduino board to your computer using the USB cable. The green power LED
(labeled PWR) should glow.

Step 4: Launch Arduino IDE.

After your Arduino IDE software is downloaded, you need to unzip the folder. Inside the
folder, you can find the application icon with an infinity label (application.exe). Doubleclick
the icon to start the IDE

37
FIG 4.21 LAUNCH ARDUINO IDE

Step 5: Open your first project.

Once the software starts, you have two options:

 Create a new project.

 Open an existing project example.

To create a new project, select File --> New

FIG 4.22 CREATE A NEW PROJECT

To open an existing project example, select File -> Example -> Basics -> Blink.

38
FIG 4.23 EXISTING PROJECT

Here, we are selecting just one of the examples with the name Blink. It turns the LED on
and off with some time delay. You can select any other example from the list.

Step 6: Select your Arduino board.

To avoid any error while uploading your program to the board, you must select the correct
Arduino board name, which matches with the board connected to your computer.

Go to Tools -> Board and select your board.

FIG 4.24 UPLOADING PROGRAM

Here, we have selected Arduino Uno board according to our tutorial, but you must select the
name matching the board that you are using.

39
Step 7: Select your serial port.

Select the serial device of the Arduino board. Go to Tools -> Serial Port menu. This is likely
to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports).
To find out, you can disconnect your Arduino board and re-open the menu, the entry that
disappears should be of the Arduino board. Reconnect the board and select that serial port.

FIG 4.25 SERIAL PORT MENU

Step 8: Upload the program to your board.

Before explaining how we can upload our program to the board, we must demonstrate the
function of each symbol appearing in the Arduino IDE toolbar

FIG 4.26 ARDUINO IDE TOOLBAR

A- Used to check if there is any compilation error.

B- Used to upload a program to the Arduino board.

40
C- Shortcut used to create a new sketch.

D- Used to directly open one of the example sketch.

E- Used to save your sketch.

F- Serial monitor used to receive serial data from the board and send the serial data to the
board.

ARDUINO SOFTWARE` – PROGRAM STRUCTURE

we will study in depth, the Arduino program structure and we will learn more new
terminologies used in the Arduino world. The Arduino software is open-source. The source
code for the Java environment is released under the GPL and the C/C++ microcontroller
libraries are under the LGPL.

Sketch: The first new terminology is the Arduino program called “sketch”.

Structure Arduino programs can be divided in three main parts: Structure, Values (variables
and constants), and Functions. In this tutorial, we will learn about the Arduino software
program, step by step, and how we can write the program without any syntax or compilation
error.

Let us start with the Structure. Software structure consist of two main functions:

 Setup( ) function

 Loop( ) function

41
FIG 4.27 PROGRAM STRUCTURE

PURPOSE: The setup() function is called when a sketch starts. Use it to initialize the
variables, pin modes, start using libraries, etc. The setup function will only run once, after
each power up or reset of the Arduino board.

INPUT: -

OUTPUT: -

RETURN:

PURPOSE: After creating a setup() function, which initializes and sets the initial values, the
loop() function does precisely what its name suggests, and loops consecutively, allowing
your program to change and respond. Use it to actively control the Arduino board.

INPUT: -

OUTPUT: -

RESULT: -

42
CHAPTER 5

RESULTS AND DISCUSSIONS

FIG 5.1 SCHEMATIC DIAGRAM

A Sigma home schematic diagram is a visual representation of a home's systems, showcasing


electrical, plumbing, and structural components using standardized symbols and layouts. It
highlights essential design and functionality details, often associated with smart, energy-
efficient, and innovative housing solutions. Advanced features like solar panels, rainwater
harvesting, and smart home automation may be incorporated. The diagram provides a
comprehensive overview, enabling builders, architects, and homeowners to understand
system relationships and make informed decisions. Using a standardized format ensures
clarity and consistency, facilitating communication and implementation. This diagram is a
valuable tool for creating efficient, sustainable, and technologically advanced homes,
streamlining the design and construction process. It promotes informed decision-making and
effective collaboration among stakeholders.

43
Fig 5.2 SIGMA HOME AUTOMATION SYSTEMS

Sigma Home, a comprehensive IoT-based home automation system, was successfully


developed using ESP32, LDR, DHT-22, LCD 16X2, PIR Sensor, Ultrasonic Sensor, and
Blynk Application. The system seamlessly integrated lighting, temperature, humidity, and
motion detection, allowing WiFi module is connected to an Arduino UNO board, which
communicates with the Blynk application through a mobile hotspot. When the 12V 1A DC
power supply is switched on, the Arduino UNO board is powered, enabling control of the
light and fan using the Blynk application. Switching on the 1st button turns the LED ON, and
the LCD display shows "Load 1 ON" and indicates that the LED is ON. When the 1st button
is switched off, the LED turns OFF. Similarly, switching on the 2nd button turns the fan ON,
and the LCD display shows "Load 2 ON" and indicates that the fan is ON. When the 2nd
button is switched OFF, the fan turns OFF. The DHT22 sensor measures the surrounding
temperature and humidity, displaying the data on an LCD display through Blynk application.
The LDR sensor detects the lighting conditions in the room, displaying "Lighting" when it is
dark and "Darkness" when it is bright.

44
CHAPTER 6

CONCLUSION AND FUTURE SCOPE

CONCLUSION

In conclusion, an IoT-Based Home Automation using Node MCU is proven to be a better


idea for making a home fully secure, a cost-effective solution for operating a home
automatically. We first interfaced each module individually like the lighting system, fan and
humidity and temperature system, darkness deduction system, and security. Then we
interfaced all the modules and their programs together to make it a whole system or network.
We then connected our Node MCU with the mobile using the WIFI module and used the
Blynk application for controlling our system. Home Automation is a very simple and easy
process of just interfacing different sensors with an Android application using Node MCU
and just by doing this, we can control fans, switches, lights, fans, and from anywhere.

The messages from the sensors can be uploaded to the Blynk app, which can be accessed
by the owner whenever they feel like an intruder is trying to breach into their home. They
can simply notify the system about it and the system will further notify the nearby police
station about it with the given data.

FUTURE SCOPE

the smart home system is enhanced with an in-built Artificial Intelligence (AI) that optimizes
the user experience, making the home more responsive, secure, and efficient. The integration
of AI allows the system to learn from the user’s behavior, preferences, and patterns, thereby
making automatic decisions that improve convenience and energy management. One of the
key security features in this system is the installation of a camera designed to monitor the
premises for any unauthorized activity or intrusion. The camera continuously captures video
or images and uses AI algorithms to detect unusual behavior, such as an unknown person
entering the premises or approaching the door. . The images or videos captured by the
camera are automatically uploaded to a secure cloud server. This ensures that the data is
stored safely, allowing the homeowner to access it remotely at any time. Whether they are at
work, on vacation, or simply out for a while, the owner can log into the system through a

45
mobile app or web interface to view real-time footage or images of their home. This provides
peace of mind, knowing that the home is under constant surveillance, even when they are not
physically present. In case of a potential security threat, such as the detection of an intruder,
the AI system can notify the homeowner through a push notification or alert on their mobile
device. At this point, the homeowner can take action, such as reviewing the images and
verifying the situation. If the homeowner deems it necessary, they can notify the system
about the threat. Once the threat is confirmed, the system can automatically alert the nearby
police station or other emergency services, providing them with the relevant images and
details. This level of integration allows for a faster response time in case of an emergency, as
the authorities will receive live footage, enabling them to assess the situation and take the
appropriate actions. The system can also send alerts to other smart devices in the home, such
as lights or alarms, to further deter the intruder and alert neighbors to the potential danger. In
summary, this AI-powered home automation system offers enhanced security, convenience,
and peace of mind by combining real-time surveillance with smart notifications and
automatic alerts to both the homeowner and the police. The seamless integration of AI, cloud
storage, and IoT technology ensures that the home is continuously protected, even when the
owner is not present.

46
REFERENCES

[1]D. H. M. A. Amin, “Voice Controlled Home Automation System,” International Journal


of Electrical, Electronics and Computers, vol. 7, no. 5, pp. 01–11, 2022.

[2]M. Vighnesh, A. John, M. Shibu, and M. Jagannath, “Voice controlled home automation,
security system and virtual joystick-controlled robot for patients in home quarantines,” in
Journal of Physics: Conference Series, Institute of Physics, 2022.

[3]“IOTBased Home Automation Using Node-MCU and Blynk Application,” 2021, doi:
10.46501/IJMTST0703027.

[4]H. S. Sridhar, S. Somvanshi, M. Ramsinghani, and N. H. C., “Designing of Smart Home


Automation Using IoT,” Institute of Electrical and Electronics Engineers (IEEE), Mar. 2023,
pp.

[5] R. K. Kodali, S. C. Rajanarayanan, L. Boppana, S. Sharma, and A.Kumar, “Low cost


smart home automation system using smart phone,” in IEEE Region 10 Humanitarian
Technology Conference, R10-HTC, Institute of Electrical and Electronics Engineers Inc.,
Nov. 2019. doi: 10.1109/R10-HTC47129.2019.9042467.

[6] S. Anand, M. Pranavya, G. Vaibhavi, R. Apoorva, and S. R.Shenoy, “Efficient Model for
Automated Home Management System,” in International Conference on Emerging Trends in
Information Technology and Engineering, ic-ETITE 2020,Institute of Electrical and
Electronics Engineers Inc., Feb. 2020.doi: 10.1109/ic-ETITE47903.2020.489.

[7] M. I. Joha and M. S. Islam, “IoT-Based Smart Home Automation Using Node-MCU: A
Smart Multi-Plug with Overload and over Temperature Protection,” in 24th International
Conference on Computer and Information Technology, ICCIT 2021, Institute of Electrical
and Electronics Engineers Inc., 2021. doi: 10.1109/ICCIT54785.2021.9689913.

[8] M. Saikrishna and G. Vijaykiran, “IOTBased Home Electrical Appliances Control Using
Node MCU.” [Online]. Available: www.ijsetr.com

47
[9]H. Durani, M. Sheth, M. Vaghasia and S. Kotech, "Smart Automated Home Application
using IoT with Blynk App", Proceedings of the International Conference on Inventive
Communication and Computational Technologies ICICCT 2018, pp. 393-397, Sep. 2018.

[10]P. Shelke, S. Kulkarni, S. Yelpale, O. Pawar, R. Singh and K. Deshpande, "A NodeMCU
Based Home Automation System", International Research Journal of Engineering and
Technology, vol. 9001, 2008.

[11]K. Loga Priya and M. S. Saranya, Voice-Activated Home Automation using NodeMCU,
2020, [online] Available: www.irjet.net.

[12]S. Lokesh, S. B. Patil and A. Gugawad, "Home Security and Automation Using
NodeMCU-ESP8266", Proceedings of BHTC 2020 - 1st IEEE Bangalore Humanitarian
Technology Conference Institute of Electrical and Electronics Engineers Inc., Oct. 2020.

[13]R. More, N. Mhatre, A. Maurya and S. Khanvilkar, Energy Efficient Smart Home
Automation, 2021, [online] Available: https://ifttt.com/.

48
APPENDIX

Program:

#include <LiquidCrystal.h>

const int rs = 13, en = 12, d4 = 11, d5 = 10, d6 = 9, d7 = 8;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

int l1=A0;

int l2=A1;

#include <SimpleDHT.h>

int pinDHT11 = 2;

SimpleDHT11 dht11(pinDHT11);

int ldr=3;

void setup()

pinMode(ldr,INPUT);

pinMode(l1,OUTPUT);pinMode(l2,OUTPUT);

digitalWrite(l1,HIGH);digitalWrite(l2,HIGH);

lcd.begin(16, 2);

lcd.clear();lcd.print("SIGMA HOME");

lcd.setCursor(0,1);lcd.print("USING ARDUINO");

Serial.begin(9600);

void loop()

49
{

/*

digitalWrite(trigPin, LOW); delayMicroseconds(2);

digitalWrite(trigPin, HIGH);delayMicroseconds(10);

digitalWrite(trigPin, LOW);duration = pulseIn(echoPin, HIGH);

distance = duration/58.2;

lcd.clear();lcd.print("Distance:");lcd.print(distance);delay(200);

if(distance<60)

lcd.clear();lcd.print("OBJECT ALERT....");delay(100);

Serial.print("OBJECT ALERT.....");delay(1000);

*/

while(Serial.available())

String iot=Serial.readString();

if(iot[0]=='1')

lcd.clear();lcd.print("LOAD:1 ON");delay(1000); digitalWrite(l1,LOW);delay(1000);

if(iot[0]=='2')

lcd.clear();lcd.print("LOAD:1 OFF");delay(1000); digitalWrite(l1,HIGH);delay(1000);

if(iot[0]=='3')

50
{

lcd.clear();lcd.print("LOAD:2 ON");delay(1000); digitalWrite(l2,LOW);delay(1000);

if(iot[0]=='4')

lcd.clear();lcd.print("LOAD:2 OFF");delay(1000); digitalWrite(l2,HIGH);delay(1000);

// read without samples.

byte temperature = 0;

byte humidity = 0;

int err = SimpleDHTErrSuccess;

if ((err = dht11.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess)

// Serial.print("Read DHT11 failed, err="); Serial.print(SimpleDHTErrCode(err));

// Serial.print(","); Serial.println(SimpleDHTErrDuration(err)); delay(1000);

return;

//Serial.print((int)temperature); Serial.print(" *C, ");

// Serial.print((int)humidity); Serial.println(" H");

int temp=((int)temperature);

int hum=((int)humidity);delay(150);

lcd.clear();lcd.print("TEMP:");lcd.print(temp);

51
lcd.setCursor(0,1);lcd.print("Humidity:");lcd.print(hum);delay(1000);

//String iot="TEMP:"+String(temp)+" HUMIDITY:"+String(hum);delay(1000);

int ldrval=digitalRead(ldr);delay(10);

if(ldrval==LOW)

String iot="TEMP:"+String(temp)+" HUMIDITY:"+String(hum)+" LIGHTING";delay(1000);

lcd.clear();lcd.print("LIGHTING");delay(1000);

Serial.println(iot);delay(100);

if(ldrval==HIGH)

String iot="TEMP:"+String(temp)+" HUMIDITY:"+String(hum)+" DARKNESS";delay(1000);

lcd.clear();lcd.print("DARKNESS");delay(1000);

Serial.println(iot);delay(100);

52
/#define BLYNK_TEMPLATE_ID "TMPLyCfpOWwP"

//#define BLYNK_TEMPLATE_NAME "HOME AUTOMATION"

//#define BLYNK_AUTH_TOKEN "sWkLrTAlhVD0wHicyaWrkFZk6Sty4DZo"

#define BLYNK_TEMPLATE_ID "TMPL390hXLvCC"

#define BLYNK_TEMPLATE_NAME "HOME AUTOMATION"

#define BLYNK_AUTH_TOKEN "9b2VKbkFYoafDZgxTmTEcpoBANUs3mjo"

int l1=25;

int l2=26;

int l3=32;

int pp=33;

#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

//#include <WiFi.h>

//#include <WiFiClient.h>

//#include <BlynkSimpleEsp32.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.

53
// Set password to "" for open networks.

char ssid[] = "project";

char pass[] = "project.123";

uint8_t connection_state = 0;

uint16_t reconnect_interval = 10000;

WiFiClient client;

String data1="";

String data2="cmd";

String data=" MESSAGE";

BlynkTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).

// In the app, Widget's reading frequency should be set to PUSH. This means

// that you define how often to send data to Blynk App.

void upload()

const char* server4 = "api.thingspeak.com";

const char* _getLink4 = "https://api.thingspeak.com/update?


api_key=91SHW5GUCCRO6Y5M&field1="; // Thingspeak.com

//const char* _getLink4 = "https://api.thingspeak.com/update?api_key=8QEMT0G004GKO1L8&field1=";


// Thingspeak.com

// Serial.println("data uploading");delay(1000);

client.connect(server4,80);

if (client.connect(server4,80)) // "184.106.153.149" or api.thingspeak.com


https://api.thingspeak.com/apps/thinghttp/send_request?api_key=CT9B331KB5PLM1G5

54
String getStr4 = _getLink4;

client.print("GET "+getStr4+data1+"\n");

client.print("HTTP/1.1\n");

client.print("Host: api.thingspeak.com\n");

client.print("Connection: close\n\n\n");

client.stop();

void myTimerEvent()

while(Serial.available())

data1=Serial.readString();

upload();

//Blynk.virtualWrite(V8, data1);

Blynk.virtualWrite(V4,data1);

/*

Blynk.virtualWrite(V6,temp);

Blynk.virtualWrite(V7, hum);

Blynk.virtualWrite(V4, temp);

Blynk.virtualWrite(V5, hum);

55
if(((millis()/1000)%2)==0)

Blynk.virtualWrite(V8, "RAIN ALERT");

else

Blynk.virtualWrite(V8, "NO RAIN HERE");

Blynk.virtualWrite(V9, millis() % 2);

*/

BLYNK_WRITE(V0)

int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable

//Serial.print("VALUE V0:");//Serial.println(String(pinValue));

if(pinValue==0)

Serial.print("1");delay(100);

digitalWrite(l1,HIGH);digitalWrite(l2,LOW);digitalWrite(l3,HIGH);digitalWrite(pp,LOW);delay(1000);

if(pinValue==1)

56
{

Serial.print("2");delay(100);

digitalWrite(l1,HIGH);digitalWrite(l2,LOW);digitalWrite(l3,HIGH);digitalWrite(pp,LOW);delay(1000);

BLYNK_WRITE(V1)

int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable

//Serial.print("VALUE V1:");Serial.println(String(pinValue));

//lcd.clear();lcd.print("LIGHT1:");lcd.print(String(pinValue));delay(1000);

if(pinValue==0)

Serial.print("3");delay(100);

digitalWrite(l1,HIGH);digitalWrite(l2,LOW);digitalWrite(l3,LOW);digitalWrite(pp,HIGH);delay(1000);

if(pinValue==1)

Serial.print("4");delay(100);

digitalWrite(l1,HIGH);digitalWrite(l2,LOW);digitalWrite(l3,LOW);digitalWrite(pp,HIGH);delay(1000);

57
}

BLYNK_WRITE(V2)

int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable

//Serial.print("VALUE V2:");Serial.println(String(pinValue));

if(pinValue==0)

Serial.print("5");delay(100);

digitalWrite(l1,LOW);digitalWrite(l2,HIGH);digitalWrite(l3,HIGH);digitalWrite(pp,LOW);delay(1000);

if(pinValue==1)

Serial.print("6");delay(100);

digitalWrite(l1,LOW);digitalWrite(l2,HIGH);digitalWrite(l3,HIGH);digitalWrite(pp,LOW);delay(1000);

BLYNK_WRITE(V3)

int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable

//Serial.print("VALUE V3:");Serial.println(String(pinValue));

if(pinValue==0)

58
{

Serial.print("7");delay(100);

digitalWrite(l1,LOW);digitalWrite(l2,LOW);digitalWrite(l3,LOW);digitalWrite(pp,LOW);delay(1000);

if(pinValue==1)

Serial.print("8");delay(100);

digitalWrite(l1,LOW);digitalWrite(l2,LOW);digitalWrite(l3,LOW);digitalWrite(pp,LOW);delay(1000);

BLYNK_WRITE(V8)

String pinValue = String(param.asInt()); // assigning incoming value from pin V1 to a variable

Serial.print("VALUE V8:");Serial.println(pinValue);

void setup()

59
{

pinMode(l1,OUTPUT);pinMode(l2,OUTPUT);pinMode(l3,OUTPUT);pinMode(pp,OUTPUT);

digitalWrite(l1,LOW);digitalWrite(l2,LOW);digitalWrite(l3,LOW);digitalWrite(pp,LOW);

// Debug console

Serial.begin(9600);

Blynk.begin(auth, ssid, pass);delay(1000);

// You can also specify server:

//Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);

//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);

timer.setInterval(1000L, myTimerEvent);

void loop()

Blynk.run();

timer.run();

// You can inject your own code or combine it with other sketches.

// Check other examples on how to communicate with Blynk. Remember

// to avoid delay() function!

60

You might also like