Miniproject (B) FINAL
Miniproject (B) FINAL
BACHELOR OF TECHNOLOGY
In
By
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.
EXTERNAL EXAMINER
DECLARATION
We hereby declare that the entire Mini Project work described in this report,
NAAC. The work is original and has not been submitted to any other University
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 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.
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
LIST OF FIGURES
iv
FIG NO FIGURE NAME PAGE NO
3.1 BLOCK DIAGRAM 18
4.1 ESP32 20
4.2 Table 22
4.11 LCD 29
v
4.20 Download Arduino IDE software 40
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 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.
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.
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.
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.
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.
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.
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
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. Hardware Architecture
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.
6
Other Components: Includes LEDs, resistors, push buttons, and connectors for
building and testing the system.
2. Software Infrastructure
Cloud Integration: Optional cloud services (e.g., Firebase, AWS IoT) for storing
data, managing device states, and enabling remote control.
3. Communication Protocols
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
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.
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
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)
Relay Module
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
4.1 ESP32
17
Key Component Description
Download button. Holding down boot and then pressing Reset initiates
Boot Button
Firmware Download mode for downloading firmware through the serial port.
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.
34 Programmable GPIOs.
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
Operating Voltage:3V to 5V DC
GND: Ground
20
FIG:4.4 UNDERSTANDING LDR SENSORS
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.
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
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.
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.
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
Environment monitoring
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.
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.
Features of LCD16x2
28
It includes two rows where each row can produce 16-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
For Hex Code-01, the LCD command will be the clear LCD screen
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.
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
31
FIG 4.14 PIR SENSOR
Wide range on input voltage varying from 4.V to 12V (+5V recommended)
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.
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.
Working Voltage 5v
33
Working Frequency 40Hz
Max Range 4m
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.
34
4.2 SOFTWARE
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
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
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.
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
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.
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.
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.
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
40
C- Shortcut used to create a new sketch.
F- Serial monitor used to receive serial data from the board and send the serial data to the
board.
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
43
Fig 5.2 SIGMA HOME AUTOMATION SYSTEMS
44
CHAPTER 6
CONCLUSION
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
[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.
[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>
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, HIGH);delayMicroseconds(10);
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')
if(iot[0]=='2')
if(iot[0]=='3')
50
{
if(iot[0]=='4')
byte temperature = 0;
byte humidity = 0;
return;
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);
int ldrval=digitalRead(ldr);delay(10);
if(ldrval==LOW)
lcd.clear();lcd.print("LIGHTING");delay(1000);
Serial.println(iot);delay(100);
if(ldrval==HIGH)
lcd.clear();lcd.print("DARKNESS");delay(1000);
Serial.println(iot);delay(100);
52
/#define BLYNK_TEMPLATE_ID "TMPLyCfpOWwP"
int l1=25;
int l2=26;
int l3=32;
int pp=33;
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
//#include <WiFi.h>
//#include <WiFiClient.h>
//#include <BlynkSimpleEsp32.h>
53
// Set password to "" for open networks.
uint8_t connection_state = 0;
WiFiClient client;
String data1="";
String data2="cmd";
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
void upload()
// Serial.println("data uploading");delay(1000);
client.connect(server4,80);
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)
else
*/
BLYNK_WRITE(V0)
//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)
//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)
//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)
//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)
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);
timer.setInterval(1000L, myTimerEvent);
void loop()
Blynk.run();
timer.run();
// You can inject your own code or combine it with other sketches.
60