0% found this document useful (0 votes)
60 views54 pages

Final Report

This document discusses the development of a home automation system using NodeMCU as the main processing unit, integrating various sensors for enhanced comfort, security, and energy efficiency. It highlights the use of Android technology for remote control and emphasizes the affordability and flexibility of ESP home automation solutions. The document also details the specifications and functionalities of the NodeMCU microcontroller, which serves as a key component in the automation system.

Uploaded by

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

Final Report

This document discusses the development of a home automation system using NodeMCU as the main processing unit, integrating various sensors for enhanced comfort, security, and energy efficiency. It highlights the use of Android technology for remote control and emphasizes the affordability and flexibility of ESP home automation solutions. The document also details the specifications and functionalities of the NodeMCU microcontroller, which serves as a key component in the automation system.

Uploaded by

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

Chapter no.

1
1.1 Abstract

The world is rapidly moving towards automation as people have


less time to handle all the work that needs to be done. Automation
is an easy solution to control any product or machine to suit our
needs. This article presents the development and implementation
of a new home automation system unit using nodemcu as the main
processing unit. The system integrates multiple sensors such as
passive infrared (PIR) sensors for motion detection, gas sensors
for monitoring gas issues, temperature sensors for detecting
temperature changes, and light sensors for monitoring ambient
light, as well as LCD modules for seamless wireless
communication and monitoring capabilities. The primary objective
of this research is to create a smart and flexible home automation
solution that I'menhances comfort, security, and energy efficiency.
Home Automation, Sensors, Bluetooth modules, Energy efficiency
The main objective of the project is to develop a home automation
system with android application controlled remote
Android controlled home automation system provides a simpler
solution with android technology
Remote operation is achieved by any smart phone etc with android os,
upon a Gui based touch screen operation

1
1.2 Introduction
Introduction to Automation of Home Appliances Using Android

Home automation has become increasingly popular as people look for ways to
enhance comfort, convenience, and efficiency in their daily lives. One of the most
accessible and cost-effective methods to control home appliances remotely is
through the use of Android-based automation systems. Android smart phones, with
their widespread availability, user-friendly interfaces, and powerful processing
capabilities, offer an ideal platform for home automation.

ESP Home Automation


With the rise of smart home technology, homeowners are increasingly looking for
cost-effective and customizable solutions to automate everyday tasks. ESP home
automation, which utilizes the ESP8266 and ESP32 microcontrollers, offers an
affordable, flexible, and powerful way to connect and control various devices in your
home. These microcontrollers are equipped with Wi-Fi and Bluetooth capabilities,
making them ideal for wirelessly controlling devices such as lights, thermostats,
security systems, and more.
ESP home automation especially attractive is the ease of integrating these
microcontrollers with open-source platforms like Home Assistant, ESPHome, and
Tasmota. This flexibility allows users to design their own automation systems
without relying on expensive proprietary hardware or cloud-based services. Whether
you want to automate your lighting, monitor temperature and humidity, or build a
comprehensive smart home network, ESP modules provide an accessible solution
for creating a connected home environment.

2
What is home automation

Home automation involves introducing a degree of computerized or


automatic control to certain electrical and electronics system in a building
These lighting temperature control rtc… this paper demonstrate a simple
home automation system which contains a remote mobile host controller
and several client module ( home appliances)
The client modules communication with controllers through a wireless
device such as a bluetooth enabled mobile phone in this case an android
based smart phone.
Home automation using NodeMCU is a fantastic project! NodeMCU is a
low-cost, open-source microcontroller that can connect to the internet and
control various devices. Here's a brief introduction to get you started:

Home Automation Using NodeMCU:

NodeMCU can be used to automate various aspects of your home, such


as:

1. Lighting: Control LED lights, bulbs, or strips to turn them on/off or


adjust brightness.
2. Temperature: Monitor and control temperature using sensors and
relays.
3. Security: Use sensors and cameras to detect intruders and alert you
via notifications.
4. Appliances: Control and monitor appliances like fans, Acs or tv

3
1.3 Objective of project

● Use a home automation remote system


● different inner and outer network technology
● Use low price materials and devices
● Manage multiple control points
● Ensure security
● Improve comfort
● Study about lcd module and different technologies
● To save the energy or power used in places like
offices or homes where lighting is very much important
for the people and provide an automated life style
● Use devices that are easy to install
● To design and implement cost effective home
automation system yet an efficient one
● Intelligent services
● Control , monitoring
● To design a user and safe system to control home
appliances especially aimed to aid elders and
handicapped

4
1.4 List of components

● ESP8266 node Mcu


● 4 channel relay module( LCD MODULE)
● 4 push button
● Bread board
● Wires, switches
● 5v power supply
● Blynk app

5
Chapter no.2

2.1 ESP8266 NODE MCU:

What is NodeMCU?

The NodeMCU (Node MicroController Unit) is an open-source software and hardware development
environment built around an inexpensive System-on-a-Chip (SoC) called the ESP8266. The
ESP8266, designed and manufactured by Espressif Systems, contains the crucial elements of a
computer: CPU, RAM, networking (WiFi), and even a modern operating system and SDK. That
makes it an excellent choice for Internet of Things (IoT) projects of all kinds.However, as a chip,
the ESP8266 is also hard to access and use. You must solder wires, with the appropriate analog
voltage, to its pins for the simplest tasks such as powering it on or sending a keystroke to the
“computer” on the chip. You also have to program it in low-level machine instructions that can be
interpreted by the chip hardware. This level of integration is not a problem using the ESP8266 as
an embedded controller chip in mass-produced electronics.

Figure 2.1[1]

6
But,

what about Arduino? The Arduino project created an open-source hardware design and
software SDK for their versatile IoT controller. Similar to NodeMCU, the Arduino hardware is a
microcontroller board with a USB connector, LED lights, and standard data pins. It also defines
standard interfaces to interact with sensors or other boards. But unlike NodeMCU, the Arduino
board can have different types of CPU chips (typically an ARM or Intel x86 chip) with memory
chips, and a variety of programming environments. There is an Arduino reference design for the
ESP8266 chip as well. However, the flexibility of Arduino also means significant variations across
Develop different vendors. For example, most Arduino boards do not have WiFi capabilities, and
some even have a serial data port instead of a USB

2.2 NodeMCU Specifications


The NodeMCU is available in various package styles. Common to all the designs is the base
ESP8266 core. Designs based on the architecture have maintained the standard 30-pin layout.
Some designs use the more common narrow (0.9″) footprint, while others use a wide (1.1″)
footprint – an important consideration to be aware of.
The most common models of the NodeMCU are the Amica (based on the standard narrow
pin-spacing) and the LoLin which has the wider pin spacing and larger board. The open-source
design of the base ESP8266 enables the market to design new variants of the NodeMCU
continually.

NodeMCU

Figure 2.2.1

7
Amica NodeMCU measures 49mm x 26mm with a standard pin space of 0.1″ between pins and 0.9″
between rows.

The Amica NodeMCU is approximately 25% smaller in size than a closely compatible LoLin style
NodeMCU

NodeMCU

on Carrier Board

Figure 2.2.2

Amico NodeMCU mounted to a 102mm x 51mm carrier board with dual DB-09 male/female
connectors

Lolin

NodeMCU

Figure 2.2.3
8
LoLin style NodeMCU measures 58mm x 32mm with a pin spacing of 0.1″ between pins and 1.1″
between row

Figure 2.3

2.3 NodeMCU Technical Specifications

Official LoLin
NodeMCU Carrier
NodeM Node
Board
CU MCU

ESP-8266 ESP-8266
Microcontroller ESP-8266 32-bit
32-bit 32-bit

NodeMCU Clone
Amica Amica
Model LoLin

9
49mm x 58mm x
NodeMCU Size 49mm x 26mm
26mm 32mm

Carrier Board
n/a 102mm x 51mm n/a
Size

0.9" 1.1"
Pin Spacing (22.86 0.9" (22.86mm) (27.94
mm) mm)

Clock Speed 80 MHz 80 MHz 80 MHz

USB to Serial CP2102 CP2102 CH340G

Micro
USB Connector Micro USB Micro USB
USB

Operating
3.3V 3.3V 3.3V
Voltage

Input Voltage 4.5V-10V 4.5V-10V 4.5V-10V

Flash
4 MB / 64 4 MB / 64
Memory/SR 4 MB / 64 KB
KB KB
AM

Digital I/O Pins 11 11 11

Analog In Pins 1 1 1

ADC Range 0-3.3V 0-3.3V 0-3.3V

UART/SPI/I2C 1/1/1 1/1/1 1/1/1

802.11 802.11
WiFi Built-In 802.11 b/g/n
b/g/n b/g/n

10
Temperature -40C - -40C -
-40C - 125C
Range 125C 125C

NodeMC
Product Link NodeMCU
U

2.4 NodeMCU Pinout and Functions Explained

Figure 2.4

Power Pins There are four power pins. VIN pin and three 3.3V pins.
● VIN can be used to directly supply the NodeMCU/ESP8266 and its peripherals. Power delivered on
VIN is regulated through the onboard regulator on the NodeMCU module – you can also supply 5V
regulated to the VIN pin
11
● 3.3V pins are the output of the onboard voltage regulator and can be used to supply power to
external components.

GND are the ground pins of NodeMCU/ESP8266

I2C Pins are used to connect I2C sensors and peripherals. Both I2C Master and I2C Slave are
supported.
I2C interface functionality can be realized programmatically, and the clock frequency is 100 kHz at a
maximum. It should be noted that I2C clock frequency should be higher than the slowest
clock frequency of the slave device.

GPIO Pin NodeMCU/ESP8266 has 17 GPIO pins which can be assigned to functions such as I2C, I2S,
UART, PWM, IR Remote Control, LED Light and Button programmatically. Each digital enabled GPIO

can be configured to internal pull-up or pull-down, or set to high impedance. When configured as an
input, it can also be set to edge-trigger or level-trigger to generate CPU interrupts.

ADC Channel The NodeMCU is embedded with a 10-bit precision SAR ADC. The two functions can be
implemented using ADC. Testing power supply voltage of VDD3P3 pin and testing input voltage of
TOUT pin. However, they cannot be implemented at the same time.

UART Pins NodeMCU/ESP8266 has 2 UART interfaces (UART0 and UART1) which provide
asynchronous communication (RS232 and RS485), and can communicate at up to 4.5 Mbps.
UART0 (TXD0, RXD0, RST0 & CTS0 pins) can be used for communication. However, UART1 (TXD1
pin) features only data transmit signal so, it is usually used for printing log.

SPI Pins NodeMCU/ESP8266 features two SPIs (SPI and HSPI) in slave and master modes. These
SPIs also support the following general-purpose SPI features:
● 4 timing modes of the SPI format transfer
● Up to 80 MHz and the divided clocks of 80 MHz
● Up to 64-Byte FIFO

SDIO Pins NodeMCU/ESP8266 features Secure Digital Input/Output Interface (SDIO) which is used to
directly interface SD cards. 4-bit 25 MHz SDIO v1.1 and 4-bit 50 MHz SDIO v2.0 are supported.

12
PWM Pins The board has 4 channels of Pulse Width Modulation (PWM). The PWM output can be
implemented programmatically and used for driving digital motors and LEDs. PWM frequency
range is adjustable from 1000 μs to 10000 μs (100 Hz and 1 kHz).

Control Pins are used to control the NodeMCU/ESP8266. These pins include Chip Enable pin (EN),
Reset pin (RST) and WAKE pin.

● EN: The ESP8266 chip is enabled when EN pin is pulled HIGH. When pulled LOW the chip works
minimum power.
● RST: RST pin is used to reset the ESP8266 chip.
● WAKE: Wake pin is used to wake the chip from deep-sleep.

● EN: The ESP8266 chip is enabled when EN pin is pulled HIGH. When pulled LOW the chip works at
minimum power.
● RST: RST pin is used to reset the ESP8266 chip.
● WAKE: Wake pin is used to wake the chip from deep-sleep

2.5 NodeMCU Carrier Board with Serial Ports

13
Figure 2.5

The NodeMCU Carrier Board features a genuine Amica NodeMCU ESP8266 processor
along with a DB09 male and female connector with an RS-232 level converter.
The original design of the Carrier Board was for a WiFi application and the serial ports allowed for
RS-232 data to be provided over the serial connectors, through a MAX232 compatible level
converter to the NodeMCU. The level converter allows true RS-232 signals to be sent to the
NodeMCU without worrying about the wide voltage swings.

2.6 NodeMCU Carrier Board Schematic

14
The NodeMCU Carrier Board schematic shows the two DB-09 connectors, along with the switch at SW1.
The switch toggles the data from either DB-09 between Pin 2 or Pin 3 to the level converter.
Finally, there is a jumper position at J1. The allows serial data from either DB-09 to appear on the NodeMCU
Rx pin.

Figure 2.6

It q on the NodeMCU module, in particular, the ability to program the NodeMCU. If


programming/reprogramming the NodeMCU, it is advisable to remove the jumper when
programming

15
2.7 What Is The NodeMCU IoT Experimenter?

Figure 2.7

The NodeMCU IoT Experimenter is a versatile prototyping platform for use with a variety of the most
popularNodeMCU modules including our NodeMCU Carrier Board. Great to use for IoT projects, advanced
or straightforward interfacing, and as a prototyping platform. The NodeMCU, with its versatility,
including its ability to be programmed and used from the Arduino IDE, makes it along with
this prototyping
board the perfect experimenter’s solution.
The NodeMCU IoT Experimenter measures 5 5/16″ x 4.5″ (135mm x 115mm) with a solder mask on each
side plated holes along with a high-contrast silk-screen labeling component and prototyping positions.
Features of the board include a mounting socket area to accept either wide 1.1″ or narrow 0.9″ pitch
NodeMCU modules. This includes the Amica NodeMCU carrier board (narrow pin spacing) to compatible
variants such as the LoLin NodeMCU models. Power can be provided directly to your NodeMCU module
through its built-in USB interface. Alternately, power can be

16
supplied to the IoT Experimenter board which has provisions for an integrated regulated power supply
module
The board offers over 1,000 plated-through holes on the prototype surface, mounting for eight status
indicator LEDs along with dropping resistors and a power indicator LED. The prototyping area offers power
busbars for the Ground (G), +3.3V (3V) power rail, and a third rail X. The third rail can be used for external
voltages such as a 5V rail.
Interfacing to the NodeMCU is through a series of headers that extend each pin of the NodeMCU to
rows of four headers. Each port is labeled to identify matching pins from the NodeMCU.
The header area is located below the NodeMCU using standard 40-pin headers allowing
for versatility in interfacing for sockets or header pins.
For more information about the NodeMCU IoT Experimenter, visit the support page.
Are you interested in purchasing NodeMCU IoT Experimenter, either a partial or full kit of parts? Visit the
Online Store for the NodeMCU IoT Experimenter or other NodeMCU and Arduino accessories.

Chapter no.3
3.1 4 channel relay module ( LCD module)
Features Of Arduino 5V 4 Channel Relay Module:
● Arduino UnofLeonardo/Seeeduino compatible, other board or microcontroller via jumper cables.
● via digital 1/0 pins 4, 5, 6 and 7.
● Interface Relay screw terminals.
● Standardized shield shape and design.
● LED working status indicators for each relay.
● High quality relays COM, NO (Normally Open), and NC (Normally Closed) relay pins for each relay.

Specifications Of 4 Channel DC 5V Relay Module Board For Arduino Raspberry Pi:

1. Output controllable: Digital


2. Compatible: With any 5V microcontroller such as Arduino.
3. Rated through-current: 10A (NO) 5A (NC)
4. Control signal: TTL level
5. Max. switching voltage: 250VAC/30VDC
6. Max. switching current: 10A
7. Size: 76mm x 56mm x 17mm

17
Figure 3.1[2]

3.2 Components Present on A Four-Channel Relay Module


Following are the major components present on the four-channel relay module, we will
get into the details of this later in the article.

5V relay, terminal blocks, male headers, transistors, optocouplers, diodes, and LEDs.
Four-Channel Relay Module Specifications
Supply voltage – 3.75V to 6V
Trigger current – 5mA
Current when the relay is active - ~70mA (single), ~300mA (all four)
Relay maximum contact voltage – 250VAC, 30VDC
Relay maximum current – 10A
18
The four-channel relay module contains four 5V relays and the associated switching
and isolating components, which makes interfacing with a microcontroller or sensor
easy with minimum components and connections. There are two terminal blocks with
six terminals each, and each block is shared by two relays. The terminals are screw
type, which makes connections to mains wiring easy and changeable.
The four relays on the module are rated for 5V, which means the relay is activated
when there is approximately 5V across the coil. The contacts on each relay are
specified for 250VAC and 30VDC and 10A in each case, as marked on the body of the
relays.
The switching transistors act as a buffer between the relay coils that require high
currents, and the inputs which don’t draw much current. They amplify the input signal
so that they can drive the coils to activate the relays. The freewheeling diodes prevent
voltage spikes across the transistors when the relay is turned off since the coils are an
inductive load. The indicator LEDs glow when the coil of the respective relay is
energized, indicating that the relay is active. The optocouplers form an additional layer
of isolation between the load being switched and the inputs. The isolation is optional
and can be selected using the VCC selector jumper. The input jumper contains the

main V­CC, GND, and input pins for easy connection using female jumper wires.
Figure 3.2
19
3.3 How To Use The Four-Channel Relay Module
The four-channel can be used to switch multiple loads at the same time since there are
four relays on the same module. This is useful in creating a central hub from where
multiple remote loads can be powered. It is useful for tasks like home automation
where the module can be placed in the main switchboard and can be connected to
loads in other parts of the house and can be controlled from a central location using a
microcontroller.

Figure 3.3

20
In this diagram, four separate loads (represented by lightbulbs) have been connected
to the NO terminals of the relay. The live wire has been connected to the common
terminal of each relay. When the relays are activated, the load is connected to the live
wire and is powered. This setup can be reversed by connecting the load to the NC
terminal that keeps it powered on till the relay is activated.

3.4 Dual-Channel Relay Module Basic Troubleshooting

If either of the relays does not turn on:

The contacts might be welded due to overcurrent/arcing. Shaking the module firmly
might help unstick the contacts
The driver circuitry might have been damaged due to overvoltage.
Input polarity might be incorrect.
Jumper might not have been moved to the correct position

3.5 Dual-Channel Relay Module Applications

● Switching mains loads


● Home automation
● Battery backup
● High current load switching

Figure 3.5

21
Chapter no.4

4.1LCD MODULE

Figure 4.1[3]

the 16×2 LCD is named so because; it has 16 Columns and 2 Rows. There are a lot of combinations available
like, 8×1, 8×2, 10×2, 16×1, etc. But the most used one is the 16*2 LCD, hence we are using it here.
All the above mentioned LCD display will have 16 Pins and the programming approach is also the same and
hence the choice is left to you. Below is the Pinout and Pin Description of 16x2 LCD Module:

22
Sr. No Pin No. Pin Name Pin Type Pin Description Pin Connection

1 p Groud Sou This is a Connected to the


i r grou ground of
n c nd the
1 e pin MCU/Power
P of sourse
i LCD
n

2 P VCC Sou This is the Connected to the


i r sup supply pin of
n c ply Power
2 e volt source
P age
i pin
n of
LCD

3 P V0/VE Con Adjusts Connected to a


i E t the variable POT
n r cont that can
3 o rast source 0-5V
l of
P the
i LCD
n .

4 P Regist Con Toggles Connected to a


i e t betw MCU pin and
n r r een gets either 0
4 S o Com or 1.
e l man
l P d/Da 0 -> Command
e i ta Mode
c n Regi
t ster 1-> Data Mode

23
5 P Read/ Con Toggles Connected to a
i W t the MCU pin and
n r r LCD gets either 0
5 i o betw or 1.
t l een
e P Rea 0 -> Write
i d/Wr Operation
n ite
Ope 1-> Read
ratio Operation
n

6 P Enable Con Must be Connected to MCU


i t held and always
n r high held high.
6 o to
l perf
P orm
i Rea
n d/Wr
ite
Ope
ratio
n

7 P Data Data Pins used In 4-Wire Mode


i B / to
n i C sen Only 4 pins (0-3) is
7 t o d connected to
- s m Com MCU
1 ( m man
4 0 a d or In 8-Wire Mode
- n data
All 8 pins(0-7) are
7 d to
connected to
) P the
MCU
i LCD
n .

24
8 P LED LED Normal Connected to +5V
i P P LED
n o i like
1 s n oper
5 i atio
t n to
i illu
v min
e ate
the
LCD

9 P LED LED Normal Connected to


i N P LED ground
n e i like
1 g n oper
6 a atio
t n to
i illu
v min
e ate
the
LCD
con
nect
ed
with
GND
.

It is okay if you do not understand the function of all the pins, I will be explaining in

detail below. Now, let us turn back our LCD:

25
Figure 4.1.1

Okay, what is this two black circle like things on the back of our LCD?

These black circles consist of an interface IC and its associated components to help us use
this LCD with the MCU. Because our LCD is a 16*2 Dot matrix LCD and so it will have
(16*2=32) 32 characters in total and each character will be made of 5*8 Pixel Dots. A
Single character with all its Pixels enabled is shown in the below picture.

So Now, l will be a hectic task to handle everything with the help of MCU, hence an Interface
IC like HD44780 is used, which is mounted on LCD Module itself. The function of this IC is to
get the Commands and Data from the MCU and process them to display meaningful
information onto our LCD Screen.
Let’s discuss the different type of mode and options available in our LCD that has to be
controlled by our Control Pins.
4-bit and 8-bit Mode of LCD:
The LCD can work in two different modes, namely the 4-bit mode and the 8-bit mode. In 4 bit
mode we send the data nibble by nibble, first upper nibble and then lower nibble. For those of
you who don’t know what a nibble is: a nibble is a group of four bits, so the lower four bits
(D0-D3) of a byte form the lower nibble while the upper four bits (D4-D7) of a byte form the
higher nibble. This enables us to send 8 bit data.

26
Whereas in 8 bit mode we can send the 8-bit data directly in one stroke since we use all the 8
data lines.
Now you must have guessed it, Yes 8-bit mode is faster and flawless than 4-bit mode. But the
major drawback is that it needs 8 data lines connected to the microcontroller. This will make
us run out of I/O pins on our MCU, so 4-bit mode is widely used. No control pins are used to
set these modes. It's just the way of programming that change.
Read and Write Mode of LCD:
As said, the LCD itself consists of an Interface IC. The MCU can either read or write to this
interface IC. Most of the times we will be just writing to the IC, since reading will make it more
complex and such scenarios are very rare. Information like position of cursor, status
completion interrupts etc. can be read if required, but it is out of the scope of this tutorial.

4.2 4 push button


● You just need to connect only 2 pins to use the push button. Don’t need to use all 4 pins.
● Pin 1 is always internally connected to pin 2 and same goes for pin 3 and pin 4.
● To use the push button normally, you can either use one of these combinations:
○ Pin 1 - 3
○ Pin 1 - 4
○ Pin 2 - 3
○ Pin 2 - 4

Push buttons in home automation systems are essential components that serve as
user interfaces for controlling various devices and functions in a smart home. They are
versatile, reliable, and can be integrated with different automation technologies like
Zigbee, Z-Wave, Wi-Fi, or proprietary systems. Here's a detailed look:

Key Features of Push Buttons in Home Automation

1. Design:
Sleek and modern styles to match interior aesthetics.
Often customizable with different colors, materials, or backlit options.
Touch-sensitive or physical click designs
2. Functionality:
Single Function: Controls one specific device (e.g., turning a light on/off)
Multi-Function: Can perform multiple tasks based on:
Single press: Turns on/off a device

27
Figure 4.2

Figure 4.2.1

28
4.3 Bread board
A breadboard is a rectangular plastic board with a bunch of tiny holes in it. These holes let you easily insert
electronic components to prototype (meaning to build and test an early version of) an electronic circuit, like
this one with a battery, switch, resistor, and an LED (light-emitting diode).

Figure 4.3

4.4 Switches,wires
Switch
A switch is a device that can break an electrical circuit by diverting the current from one
conductor to another conductor or an insulator. These set of contacts are termed as open
and closed. Open circuit means that the contacts are separated and the circuit is broken,
so no current is flowing.

Whereas closed circuit means that the contacts are touching, the circuit is complete and the
current is flowing. Switches are of many types and are used depending upon the device we
are using. Generally, we use them in our house for controlling the fans, bulbs, call bells,
power switches for devices like refrigerators, washing machines, etc.

29
Figure 4.4[4]

4.5 Light Bulb


A light bulb is a device that produces light from electricity. Light bulbs turn the electricity
to light by sending current through a thin wire called filament. The filament is usually made
of tungsten, a material that emits light when electricity is passed through it. The emission
of light is due to the high resistance offered by the material tungsten, which we will learn in
higher classes.Apart from lighting, the light bulbs are used in electronic items as an
indicator, traffic signals, indicator lights in cars, etc

30
Figure 4.5

4.6 Connecting Wires

A wire is a flexible strand of metal, usually cylindrical. Wires are used for establishing electrical conductivity
between two devices of an electrical circuit. They possess negligible resistance to the passage of current.
The wires are covered by an insulated coating of different colours. The colour codes are used to distinguish
between neutral and ground, and live wire, which differs from one country to another.

Figure 4.6

31
4.7 5v power supply

ESP8266 WIFI 5V 2 Channel Relay Module IOT Based


ESP8266 WIFI 5v 2 Channel Relay Module uses ESP-01 as the WIFI module and
is compatible with 8 bit MCc chips. Only a simple configuration process can realize
the wireless control of the 2 way relay by using the mobile phone APP.
The ESP8266 Relay X2 is a WIFI enabled relay module that can use to control two
electrical loads (such as lights, fans, or motors) from a remote location. ESP8266
Relay 2 Channel is base on the ESP-01 ESP8266 microcontroller, which is a
low-cost, low-power WIFI chip that is popular for IoT projects The 5V Relay
ESP8266 has two 5V relay outputs. This means that the maximum voltage that can
switch by the relays is 5V. The ESP8266 ESP-01s Dual Relay can use to control
variety of electrical loads, such as lights, fans, and motors, as long as they are
within the 5V voltage range.
The ESP8266 Relay X2 is powered by a 5V DC power supply. The power supply
must be able to provide at least 2A of current, as each relay draws 1A of current
when it is activated.
The 2 Channel WIFI Relay is a versatile and easy-to-use module that can use to
automate a variety of tasks Around the home and office
2 Relay Module is a great way to add WIFI control to your existing electrical devices
Or consists of two IOT project.
Features: –

The ESP8266 Relay X2 is a very affordable module. This makes it a great option for
budget-minded projects. The ESP8266 2 Channel Relay module can control
remotely using WiFi. This means that you can control the relays from anywhere in
the world, as long as you have an internet connection.The ESP8266 Relay X2 has
two relay outputs, so it can control two electrical loads independently. The relays
can be activated or deactivated using the ESP8266 microcontroller, or they can be
controlled using a variety of other methods, such as a web browser, a mobile app,
or MQTT. The ESP8266 Relay X2 has a number of benefits, including

● WIFI connectivity
● Low cost
● Easy to use
● Versatile

32
ESP8266 wifi 5v 2 Channel Relay Module Specifications:

The 2 Channel WIFI Relay Module ESP8266 has two 5V relay outputs. This means
that it can control two electrical loads independently. The ESP8266 2 Channel Relay
is relatively easy to use. The module comes with a pre-programmed firmware that
allows you to control the relays using a web browser. You can also customize the
firmware to control the relays using other methods, such as MQTT or HTTp

Transmission Distance(m) 400

Relay Channel 2

Trigger Voltage (VDC) 5

Switching Voltage (VAC) 250@10A

Switching Voltage (VDC) 30@10A

Baud Rate 9600

33
Length (mm) 59

Width (mm) 40

Height (mm) 20

Weight (gm) 60

Applications : –The ESP01-01S Relay Module is a small, compact module that


measures 40mm x 25mm x 15mm. The Relay Module With ESP8266 is powered by
a 5V DC power supply. The power supply must be able to provide at least 2A of
current, as each relay draws 1A of current when it is activated.

The ESP8266 Relay X2 can be used for a variety of applications, including

● Home automation
● IoT projects
● Security
● Business applications

The ESP-01s ESP8266 Relay Module can also use for business applications. The

ESP8266-01s Relay X2 can use to create a security system for your home. The

ESP8266 Relay X2 can use to create a variety of IoT projects.

34
Chapter no .5

5.1 BLYNK app

Blynk is a comprehensive software suite that enables the prototyping, deployment,


and remote management of connected electronic devices at any scale.
Whether it's personal IoT projects or commercial connected products in the millions,
Blynk empowers users to connect their hardware to the cloud and create iOS,
Android, and web applications, analyze real-time and historical data from devices,
remotely control them from anywhere, receive important notifications, and much
more.

Components of the Blynk IoT Platform


Blynk.Console

35
Blynk.Console is a feature-rich web application catering to differentt types of users.
Its key functionalities include Configuration of connected devices on the platform,
including application settings.

○ Device, data, user, organization, and location management.


○ Remote monitoring and control of devices
○ To get started, simply register in Blynk.Console.

Blynk.Apps

Figure 5.1[5]

36
Blynk.Apps is a versatile native iOS and Android mobile
application that serves these major functions:
​ Remote monitoring and control of connected devices that work with Blynk
platform.Configuration of mobile UI during prototyping and production stages.
​ Automation of connected device operations. Applications made with Blynk are
​ ready for the end-users. Whether they are family members, employees, or
​ product purchasers, they can easily download the app, connect their devices,
​ and start using them.Blynk also offers a white-label solution as part of the
​ Business Plan, allowing you to customize

the app with your company logo, app icon, theme, colors, and publish it on App
. Store And Google Play under your company's name. These customize apps will
work seamlessly with your devices.

To use Blynk.Apps, install Blynk app on your iOS or Android device.

For comprehensive documentation on Blynk.Apps, refer to the provided link.

Blynk.Edgent and Blynk Library

Edge + Agent = Edgent

37
Blynk.Edgent is a packaged solution designed to simplify the connection of supported devices to the Blynk
platform,

providing access to all its advanced features without extensive coding.

Key features of Blynk.Edgent include:

​ Device claiming and Wi-Fi provisioning (bringing device online and authenticating them with a certain user).
​ Connectivity management for Wi-Fi, Cellular, and Ethernet.
​ Data transfer between device and the cloud.
​ API integration with Blynk.Apps and Blynk.Cloud features.
​ Over-the-air firmware updates for select hardware models.

For detailed information on Blynk.Edgent, refer to the provided documentation.

Blynk Library is a user-friendly and portable C++ library, that comes pre-configured
to work with hundreds of development boards. It implements a streaming
connection protocol, allowing for low-latency and bi-directional communication.
38
Explore Blynk Library documentation for further details.

5.2 Blynk.Cloud
Introduction:
Blynk was designed for the Internet of Things. It can control hardware remotely, it can
display sensor data, it can store data, visualize it and do many other cool things.
Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi and
the likes over the Internet. It's a digital dashboard where you can build a graphic
interface for your project by simply dragging and dropping widgets. It's really simple to
set everything up and you'll start tinkering in less than 5 mins. Blynk is not tied to
some specific board or shield. Instead, it's supporting hardware of your choice.
Whether your Arduino or Raspberry Pi is linked to the
Internet over Wi-Fi, Ethernet or this new ESP8266 chip, Blynk will get you online and
ready for the Internet Of Your Things.

Fig: Blynk aap Overview

Figure 5.2 [6]

Key Components of IoT


39
1. User-Friendly Interface:Blynk Cloud provides a user-friendly interface that allows
both beginners and experienced developers to create IoT projects effortlessly. The
drag-and-dropfunctionality of the Blynk app interface makes it easy to design
custom user interfaces for controlling and monitoring connected devices.

2. Wide Range of Supported Hardware:One of the strengths of Blynk Cloud is its


compatibility with a diverse array of hardware platforms. Whether it’s Arduino,
Raspberry Pi, ESP8266, or other popular microcontrollers, Blynk Cloud supports a
wide range of devices, offering flexibility to developers and ensuring that they can
work with their preferred hardware.

3. Widgets for Interactivity:Blynk Cloud incorporates a variety of widgets that


enhance interactivity in IoT projects. Widgets such as buttons, sliders, gauges, and
graphs can be easily added to the Blynk app interface, providing users with a visual
and interactive means to control and monitor connected devices.

4. Real-Time Data Visualization:Blynk Cloud facilitates real-time data visualization by


allowing users to create dynamic dashboards. This feature is particularly valuable
for applications where monitoring and analyzing data in real-time is crucial, such as
in smart home systems or industrial automation.

5. Cloud Integration and Data Storage:Blynk Cloud seamlessly integrates with


popular cloud platforms, enabling users to store and retrieve data. This integration is
useful for scenarios where historical data analysis or cloud- based services are
essential components of the IoT application.

Setting Up Blynk Cloud


Setting up Blynk Cloud involves a straightforward process

1. Create an Account:Users start by creating an account on the Blynk app, available


on both iOS and Android platforms.

2. Create a New Project:After logging in, users can create a new project and select
the hardware they are using.

3. Get Auth Token:Each project on Blynk Cloud is assigned a unique authentication


token. This token is crucial for connecting the hardware to the Blynk Cloud.

4. Add Widgets:Users can then add widgets to their project, defining the user interface
elements that will control or display information from the connected devices.
40
5. Upload Code to Hardware:Once the project is configured in the Blynk app, users
need to upload the corresponding code to their hardware, integrating it with the
Blynk Cloud.

Applications of Blynk Cloud


1. Smart Home Automation:Blynk Cloud is widely used in smart home projects,
allowing users to control lights, thermostats, security cameras, and other devices
from their smartphones. The real-time data visualization feature is particularly
beneficial for monitoring home parameters.

2. IoT Prototyping:Blynk Cloud is a go-to platform for IoT prototyping, enabling


developers to quickly build and test their ideas. Its compatibility with various
hardware platforms and extensive library support streamlines the prototyping
process.

3. Industrial IoT (IoT):In industrial settings, Blynk Cloud finds applications in


monitoring and controlling machinery, tracking production metrics, and optimizing
processes. The ability to integrate with cloud platforms makes it suitable for data
storage and analytics in industrial IoT applications.

4. Education and Learning:Blynk Cloud is an excellent educational tool for teaching


IoT concepts. Its user-friendly interface, coupled with a vast community and
documentation, makes it accessible for students and hobbyists exploring IoT
development.

Conclusion

Blynk Cloud stands as a testament to the democratization of IoT development,


making it accessible to a broad audience, from beginners to experienced
developers. Its intuitive interface, compatibility with diverse hardware, and range of
features contribute to its widespread adoption in various IoT applications. As the IoT
landscape continues to expand, Blynk Cloud remains a powerful tool for those
looking to bring their connected projects to life without the complexities of managing
backend infrastructure. Whether’s for smart homes, industrial applications, or
educational purposes, Blynk Cloud continues to be a driving force in the world of
Internet of Things.

41
5.3 Blynk Libraries
- for
all the popular hardware platforms - enable communication with the
server and process all the incoming and out coming commands.
Blynk was designed for the Internet of Things. It can control hardware remotely, it
can display
sensor data, it can store data, visualize it and do many other cool thing

figure 5.3

Features:
● Similar API and UI for all supported hardware and devices
● Connection to the cloud using
❖ Wifi
❖ Bluetooth and bile
❖ Ethernet
❖ Usb (seriel)
❖ GSM
❖ Set of easy to use widgets
❖ Direct pin manipulation with no code writing
❖ Easy to integrate and add new functionality using virtual pins
❖ History data monitoring via History Graph widget.
● Device to Device communication using Bridge Widget.
● Sending emails ,tweets,push notification etc.
● New features are constantly added
42
5.4 Blynk Micro-Services

Blynk provides micro-services, which are software modules that work across products

and perform specific functionalities. These micro-services include:

Figure 5.4[7]
Blynk.Inject

A. micro-service that facilitates:



​ A microservices that facilitates
​ Claiming device ownership by users and organizations
​ Provisioning devices with WiFi credentials so they can connect to the
​ end-user WiFi networks.
​ Managing Authentication Tokens

43


​ UX flow to guide end-users through the process of claiming and provisioning with
the help of Blynk.Apps.Here are concise notes on the Blynk app, covering its key
aspects, features, and functionalities


​ Advantages
​ User-Friendly: Simplifies IoT development for both beginners and experienced
developers.
​ Flexible Integration: Supports a wide range of microcontroller platforms and
hardware.
​ Cloud and Local Server Options: Offers choice for data management and privacy.
​ Free and Paid Tiers: Basic functionality is free, with advanced features available in
paid versions.
​ . Applications
​ Smart Home: Automate home appliances and monitor energy consumption.
​ Environmental Monitoring: Track air quality, temperature, humidity, etc.
​ Industrial Automation: Control manufacturing processes and collect data from
machinery.
​ Health Monitoring: Use wearable devices to track health metrics in real-time.
​ Considerations
​ Security: Assess the security features and options for data encryption when using
the platform.
​ Scalability: Evaluate how well the system scales for larger projects and multiple
devices.
​ Community and Support: Utilize forums, documentation, and community support for
troubleshooting and ideas.

​ Figure 5.5
44


Chapter no.6

6.1 PROCEDURE And working

Here's a step-by-step procedure for home


automation using NodeMCU and Blynk App:

Step 1: Setup NodeMCU

● 1.Connect NodeMCU to your computer via USB


● 2. Install Arduino IDE and add NodeMCU board support
● .3. Upload the "Blank" sketch to NodeMCU.

Step 2: Install Blynk Library

● 1. Open Arduino IDE.


● 2. Go to Sketch > Include Library > Manage Libraries.
● 3. Search for "Blynk" and install the library.

45
Step 3: Create Blynk Account and Project

● 1. Download and install Blynk App.


● 2. Create a Blynk account.
● 3. Create a new project:
Choose "NodeMCU" as hardware.
- Choose "WiFi" as connection type.
- Enter your WiFi credentials.

Step 4: Configuration NodeMCU with Blynk

1. Open Arduino IDE.


2. Create a new sketch.
3. Include Blynk library:
c++
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

1. Define WiFi credentials and Blynk auth token:

c++

char ssid[] = "your_wifi_ssid";


char pass[] = "your_wifi_password";
char auth[] = "your_blynk_auth_token"
;1. Initialize Blynk:

c++
Blynk.begin(auth, ssid, pass);

46
Step 5: Add Sensors and Actuators
1. Connect
sensors to NodeMCU digital pins.
2. Connect actuators to NodeMCU digital pins.
3. Define sensor and actuator pins in the sketch:

c++
const int temperaturePin = D1;
const int ledPin = D2;
1. sensor data and control actuators:
c++
void loop() {
int temperature = analogRead(temperaturePin);
Blynk.virtualWrite(V0, temperature);
if (temperature > 25) {
digitalWrite(ledPin, HIGRead H);
} else {
digitalWrite(ledPin, LOW);
}
Blynk.run();
}
Step 6: Create Blynk App Interface
● 1. Open Blynk App.
● 2. Create widgets for sensors and actuators:
● - Temperature: Gauge widget.
● - LED: Button widget.
● 3. Configure widget settings:
● - Set pin numbers.
● - Set data types.

Step 7: Run the Project


● 1. connect the sketch to NodeMCU.
● 2 Open Blynk App.
● 3. to your WiFi network.Upload

47
Figure 6.1[8]

Figure 6.2

48
Finally, the ESP8266 Smart Home System
is ready

Figure 6.3

49
● 6.2 Advantages
● Saves electricity
● Control home appliances from anywhere in the world
● Quick response.
● You will receive a email or sms for any activity
● Help for safety purposes
● Monitoring 24/7

Benefits having an automated home

● Disadvantages
● Risks of home automation
● Cybersecurity – One of the biggest risks of home automation is cybersecurity. Smart devices are to
hacking, and if a hacker gains access to your home automation system , they could control various Devices
and systems in your home. This could include turning off your
● security cameras, unlocking your doors, and controlling your thermostat. To reduce this risk, it is
● important to use strong passwords and
● keep your devices and software up to date

50
Conclusion

In conclusion, home automation has many benefits for everyday life,


including convenience, energy efficiency, improved home security, and
accessibility. However, there are also risks to consider, including
cybersecurity, dependence on technology, privacy concerns, and cost. It is
important to weigh these factors carefully before deciding whether to invest
in home automation.
the home automation system using NodeMCU has been successfully
designed and implemented, enabling remote monitoring and control of
various appliances and devices within a household. The system's
Wi-Fi connectivity and user-friendly interface make it an ideal solution
for automating and enhancing the convenience, energy efficiency, and
security of smart homes. With its flexibility, scalability, and
cost-effectiveness, this system has the potential to revolutionize the
way we interact with our living spaces.
Home automation makes life more convenient and can even save you
money on heating, cooling and electricity bills. Home automation can
also lead to greater safety with Internet of Things devices like security
cameras and systems.
Future developments could include integrating additional sensors,
actuators, and machine learning algorithms to further enhance the
system's capabilities and automation features. Nonetheless, this
project demonstrates the potential of NodeMCU in home automation
and paves the way for future innovations in this field."

51
● 1..https://www.make-it.ca/nodemcu-details-specifications/
● 2..https://components101.com/switches/5v-four-channel-relay-module-pinout-featur
es-applications-working-datasheet
● 3.https://www.sameskydevices.com/blog/push-button-switches-101?srsltid=AfmBOo
pfUHty8tCV_KuXot0bRwc4QU2WvlRR4eoaZ2wolofvaGCeRiau
● 4.https://learn.sparkfun.com/tutorials/how-to-use-a-breadboard/all
● 5.https://docs.blynk.io/
● 6.https://osoyoo.com/2021/10/24/what-is-blynk-and-how-does-it-work/
● 7.https://blynk.cloud/
● 8..https://www.instructables.com/Smart-Home-Automation-Using-Blynk-ESP32-IoT-
Projec/
● 9.https://www.oobsmarthome.com/blog/advantages-and-disadvantages-of-home-aut
omation-everything-you-need-to-know
● 10..https://how2electronics.com/iot-home-automation-using-blynk-nodemcu-esp826
6/
● 11.https://osoyoo.com/2021/10/24/what-is-blynk-and-how-does-it-work/
● 12.https://docs.blynk.io/en/blynk.apps/overview
● 13.https://www.grafiati.com/en/literature-selections/home-automation/
● 14.https://iotcircuithub.com
● 15.https://www.instructables.com

52
53
54

You might also like