0% found this document useful (0 votes)
152 views44 pages

The University of Faisalabad: Department of Electrical Engineering Technology

This document outlines a student project on an IOT based home automation system using NodeMCU. It includes an abstract, table of contents, and sections on introduction/background, literature review, methodology, hardware and software modules. The system allows wireless control of home appliances like fans, lamps and street lights via a smartphone app. It connects the appliances to a NodeMCU microcontroller using relays. The microcontroller receives on/off commands from the app over WiFi and controls the appliances accordingly.

Uploaded by

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

The University of Faisalabad: Department of Electrical Engineering Technology

This document outlines a student project on an IOT based home automation system using NodeMCU. It includes an abstract, table of contents, and sections on introduction/background, literature review, methodology, hardware and software modules. The system allows wireless control of home appliances like fans, lamps and street lights via a smartphone app. It connects the appliances to a NodeMCU microcontroller using relays. The microcontroller receives on/off commands from the app over WiFi and controls the appliances accordingly.

Uploaded by

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

IOT Based Home Automation by using NodeMCU

Name Registration #
Muhammad Azeem BSET-FA18-022
Ali Raza BSET-FA18-040
Muhammad Hassan BSET-FA18-048
Abdul Rehman Aziz BSET-FA18-093

Supervised by

Name_________________ Designation_______________

Department of Electrical Engineering Technology


The University of Faisalabad
Undertaking

We certified that report work titled

“IOT Based Home Automation by using NodeMCU”


It is our own creation. This project's work has not been submitted in support of any other award
or qualification, either at this university or anywhere else.
Candidate’s Signature

Muhammad Azeem Date:


BSET-FA18-022

Ali Raza Date:


BSET-FA18-040

Muhammad Hassan Date:


BSET-FA18-048

Abdul Rehman Aziz Date:


BSET-FA18-093

Subscribed and solemnly declared before,

Supervisor’s Signature ___________________ Date: ________________

Name __________________________ Designation __________________


Abstract
The Internet of Things (IoT) connects devices and devices to the Internet network so that
websites and smartphone apps, tools and devices can be remotely controlled through code and
algorithm frameworks for artificial intelligence issues. To control. If we want to build modern
systems using the Python algorithm, we have a Wi-Fi or Ethernet connection connected to our
tools, devices and devices that control them via smartphone apps or websites. This is actually a
simple definition of IoT. Instead of using IoT as a smart home lamp or other home appliance, it
can be used as a security system or industrial use system, for example, the main building door or
automatic industrial machine self-opening of the. Turn off, be fully operational or even control
Internet and communication ports. And more ideas can be created using IOT technology. A large
industrial plant or government agency has too many lamps. Employees sometimes forget to close
them at the end of the day. This research suggests energy-saving solutions while ensuring the
safety of building lighting control with your smart home through the Blank app. The lamp can be
controlled simultaneously in a special electrical installation building with a switch and a blank
app. This research offers a simple smart home prototype, or an easy way to handle loads, usually
on Wi-Fi and at low cost. In this home automation system. We have connected 6 home
appliances like fans, lamps, street lights to the relay using the free app. The ESP8266 MCU Wi-
Fi module node receives wireless commands from a smartphone via the Internet. We need the
best IoT platform to encode the on / off signal and send it to the server and ESP 8266 board. This
project requires internet connectivity and cannot work without internet connection.
Table of Contents
Abstract............................................................................................................................................1
CHAPTER # 01..................................................................................................................................2
INTRODUCTION................................................................................................................................2
1.1 Introduction......................................................................................................................2
1.2 Background.......................................................................................................................3
1.3 Problem Statement...........................................................................................................3
1.4 Objective...........................................................................................................................4
1.4.1 Design of an independent HAS..................................................................................4
1.4.2 Wireless control of home appliances (Switch and Voice mode)...............................4
1.4.3 Monitoring status of appliances................................................................................4
1.4.4 Secure connection channels between application and Node MCU..........................4
1.4.5 Controlled by any device capable of Wi-Fi (Android, iOS, PC)..................................4
1.4.6 Extensible platform for future enhancement............................................................4
1.5 Scope.................................................................................................................................5
1.6 Project Management........................................................................................................5
1.6.1 Experimentation........................................................................................................6
1.6.2 Design........................................................................................................................6
1.6.3 Development and testing..........................................................................................6
1.6.4 Real Word Testing......................................................................................................6
1.7 Overview and Benefit........................................................................................................7
1.7.1 No legal issues...........................................................................................................7
1.7.2 Reduced wiring issues................................................................................................7
1.7.3 Extended Range.........................................................................................................7
1.7.4 Security......................................................................................................................7
1.7.5 Integrable and extensive nature................................................................................7
CHAPTER # 02..................................................................................................................................8
2 LITERATURE REVIEW................................................................................................................8
2.1 Literature Review..............................................................................................................8
2.1.1 Bluetooth-based Home Automation System controlling by mobile phone..............8
2.1.2 GSM based Home Automation System controlling by Android phones...................9
2.1.3 Wi-Fi Based Home Automation System Using IOT..................................................10
CHAPTER # 03................................................................................................................................12
3 METHODOLOGY.....................................................................................................................12
3.1 Methodology...................................................................................................................12
3.1.1 Flow of the System..................................................................................................12
3.1.2 Block Diagram of the System...................................................................................14
3.1.3 Working Process......................................................................................................16
3.1.4 Circuit Diagram........................................................................................................17
3.1.5 Debug Circuit Diagram.............................................................................................18
3.2 Hardware Module...........................................................................................................19
3.2.1 Node MCU...............................................................................................................19
3.2.2 LCD...........................................................................................................................21
3.2.3 Relay Module 5V......................................................................................................23
3.2.4 Power Supply...........................................................................................................25
3.2.5 Introduction.............................................................................................................26
3.2.6 Connecting wires.....................................................................................................27
3.2.7 Wi-Fi hotspot...........................................................................................................28
3.3 Software Module.............................................................................................................28
3.3.1 Blynk App.................................................................................................................28
3.3.2 Downloading and installing and Blynk application on smart phone.......................29
3.3.3 Driver installation for hardware interfacing............................................................30
3.3.4 Interfacing Node MCU with Arduino IDE.................................................................30
3.3.5 Uploading code to Node MCU.................................................................................32
CHAPTER # 04................................................................................................................................34
4 RESULT AND DISCUSSION......................................................................................................34
4.1 RESULTS AND DISCUSSION..............................................................................................34
4.1.1 Light Control Test Results........................................................................................34
4.1.2 Final Connect of Hardware......................................................................................35
CHAPTER # 05................................................................................................................................36
5 CONCLUSONS.........................................................................................................................36
5.1 Limitations.......................................................................................................................36
5.2 Conclusions.....................................................................................................................36
5.3 Further Enhancement and Future Scope........................................................................36
List of Figure
Figure 1 Model of phases in project management.......................................................................10
Figure 2 Block Diagram of Bluetooth-based Home Automation System.....................................13
Figure 3 Block Diagram of GSM-based Home Automation System...............................................14
Figure 4 Block Diagram of Wi-Fi-based Home Automation System..............................................15
Figure 5 Blynk System Principle.....................................................................................................17
Figure 6 Flowchart of Load ON/OFF..............................................................................................18
Figure 7 System Block Diagram.....................................................................................................19
Figure 8 Working Process..............................................................................................................21
Figure 9 Circuit Diagram................................................................................................................22
Figure 10 Debug Circuit Diagram...................................................................................................23
Figure 11 Node MCU ESP 8266......................................................................................................24
Figure 12 ESP8266 Node MCU pinout...........................................................................................25
Figure 13 LCD.................................................................................................................................26
Figure 14 Relay Module.................................................................................................................28
Figure 15 Block Diagram of CD Supply..........................................................................................29
Figure 16 Connecting Wire............................................................................................................31
Figure 17 Wi-Fi Device...................................................................................................................32
Figure 18 Blynk App.......................................................................................................................32
Figure 19 Set up Blynk application................................................................................................33
Figure 20 Arduino IDE preferences................................................................................................34
Figure 21 ESP8266 board installation in Arduino IDE....................................................................35
Figure 22 Arduino IDE board manager installation.......................................................................35
Figure 23 Assigning communication port on Arduino IDE.............................................................36
Figure 24 Code in Arduino IDE to be installed to Node MCU........................................................37
Figure 25 Final Hardware...............................................................................................................39
List of Table
Table 1 Features of NodeMCU......................................................................................................23
Table 2 Pin Configuration of NodeMCU........................................................................................25
Table 3 Load Control Test..............................................................................................................37
CHAPTER # 01
INTRODUCTION
1.1 Introduction
There are several benefits to manually controlling a load that is controlled by a computer
system. Many programs and applications are using artificial intelligence schemes to better
control things using Python code or algorithms. To save energy and easily control loads, this
study proposes a smart home project based on IoT technology. It is a smart home Internet of
Things (IoT) project that handles loads connected to the Internet over a wireless Wi-Fi network.
A node MCU microcontroller kit as an Internet-connected smartphone with a flashing app as a
control panel and a controller that receives control commands via a Wi-Fi signal. The Node
MCU Kit is built with Wi-Fi receiver ESP 8266, which can process and analyze Wi-Fi signals to
include a microcontroller. The Wi-Fi receiver and microcontroller are integrated into one kit so
that it can be used as an IoT project. This is called an MCU node.

A Wi-Fi receiver is required to connect the system to the Internet. In my case, I used ESP 8266
connected to the Node MCU board as an onboard module running firmware with ESP 8266.
Firmware is low-level computer software.

The MCU node is coded through the Arduino Integrated Development Environment (IDE)
through the Universal Serial Bus (USB) port to tell the MCU node what to do. I want to control
the four-channel relay kit and display the temperature through the empty phone app. Which is
measured with an LM35 sensor.

Parts used to create the project:

 Node MCU card. Open source Internet of Things platform.


 AC-DC step-down converter. Changing the power supply to supply power to the project.
This project requires 5 volts.
 Supply DC-DC step-down converter to convert 12V output of power supply from
regulator to 5V regulated.
 Four channel relay kit. Driving loads from digital node MCU output pins.
 LM35 temperature probe. Measuring ambient temperature.
 The computer with the Arduino program (IDE) is installed once to encode NodeMCU.
 The Android smartphone with the Blank application installed will be used as the control
panel.

1.2 Background
The concept of "home automation" has been around for years. "Smart Home", "Intelligent
Home" are the terms used to introduce the concept of home networking devices. Home
automation systems (HAS) include central control and remote monitoring of lighting, security
systems and other devices and systems. HAS enables energy efficiency, improves security
systems and certainly provides comfort and convenience to consumers. In today's emerging
market, HASs are gaining popularity and attracting the interest of many consumers. They have
come up with their own challenges. Basically, in the current era, end users, especially the
elderly and the disabled, although they have benefited a lot, do not accept this system due to
complications and cost factors.

1.3 Problem Statement


Today, people are looking for ways to improve their lives using modern technology. Any new
simple home appliances that promise to improve their lifestyle are in the hands of consumers.
As such devices and equipment are expanded, it becomes inevitable that there are simple and
effective methods and resources to control and use these tools. Traditional wall switches are
available in different areas of the house and thus require mechanical functions such as
switching on or off these switches to control different devices. It becomes impossible to keep
an eye on moving objects and monitor their performance. And the goal is to create a system
that controls household appliances with minimal features, such as a touch screen or voice
control.
1.4 Objective
1.4.1 Design of an independent HAS
To formulate the design of an interconnected network of household appliances to be
integrated into the HAS. The objective of reporting on each device and its control to be
automated and integrated into the network formulated later in the HAS.

1.4.2 Wireless control of home appliances (Switch and Voice mode)


Develop applications that include switching and / or voice mode functionality to control
applications.

1.4.3 Monitoring status of appliances


Be able to see the condition of home appliances on request, so that there is better HAS.

1.4.4 Secure connection channels between application and Node MCU


Use a secure protocol over Wi-Fi to prevent other devices from gaining control over HAS.
Secure connections with SSL are obtained via TCP, SSH.

1.4.5 Controlled by any device capable of Wi-Fi (Android, iOS, PC)


To gain flexibility in the control of home appliances and a device with Wi-Fi connection will be
able to gain secure control over HAS.

1.4.6 Extensible platform for future enhancement


With a strong current possibility of adding and integrating more features and devices into the
system, the designed system should be highly scalable in nature.

1.5 Scope
Taking the stage for home robotization advertising will be subject to a couple of key
improvements in the progress that is opening up in automation, for example, wireless
automation appears to improve the blueprint as well as decrease respect as the market begins
The use of domestic mechanization is one of the most notable volumes. Some of the examples
we offer for this time of business are:
Large associations such as Philips, Siemens and Schneider will, over time, bring to the fore
large-scale market mechanization items that, in any case, interfere with the UI, in any case a
less prestigious position than today, and more people Will be able to afford the price. .

Promise solutions will move to a slightly more straightforward structure, where beyond two or
three key sections, customers will have the ability to automatically buy and use items without
any specific axis.

The future scope of the home automation system includes making homes smarter. Homes can
be interfaced with motion sensors, light sensors and temperature sensors and thus provide
automatic toggling to devices according to the situation.

More energy can be saved by ensuring occupancy and brightness of the home before turning
on the appliances and turning off the lights if not necessary.

The system can be closely integrated with home security solutions that enhance homeowners'
safety.

1.6 Project Management


The management of any project can be briefly divided into several stages. Our project is divided
into the following phases.

Figure 1 Model of phases in project management


1.6.1 Experimentation
At this stage, the necessary equipment for the project was discussed. There is a need to study
relevant pre-existing projects, to learn about collective theory. This includes locating the coding
part, developing simple algorithms and flowcharts to design the entire process.

1.6.2 Design
This was the phase of designing the app and incorporating the required features. This included
the complete hardware assembly and uploading the code to the Node MCU. The power strip is
designed to connect household appliances that can be controlled via GPIO pins.

1.6.3 Development and testing


At this stage, the application was developed. The Android device was connected to the Node
MCU via a wireless network (Wi-Fi) and the entire prototype was tested to detect and remove
errors.

1.6.4 Real Word Testing


The prototype was ready for real-world testing and was integrated with a variety of real-time
electronics.

1.7 Overview and Benefit


The advantages of a built-in wireless remote switching system for household appliances
include:

1.7.1 No legal issues


It is extremely difficult to access or pass through properties with hard lines.

1.7.2 Reduced wiring issues


Considering the increase in copper price, this increases the possibility of wire theft. Using a
wireless remote control system to control household appliances means thieves have no wires
to steal.
1.7.3 Extended Range
Since the system controlled Wi-Fi, it was generally considered a landing threshold. There are
150 meters inside the house. It can be extended up to 300 feet outside, but indoor range is
considered as the application is for HAS.

1.7.4 Security
This system provides maximum security as the HAS control connection is established over a
secure network.

1.7.5 Integrable and extensive nature


The designed prototype can be extensively integrated. There is also a wide variety of
applications that can add or remove controllers according to the application.
CHAPTER # 02
2 LITERATURE REVIEW
2.1 Literature Review
2.1.1 Bluetooth-based Home Automation System controlling by mobile phone
In automation gadgets, totally at the Bluetooth-based house, national teams are connected to
the Arduino BT reproduction cards and use the relays of their input and production doors. The
Arduino BT rear utility is based on the linguistic era of high quality interactive microcontrollers.
The connection is carried out via Bluetooth. Password protection is provided to facilitate
delinquent users to access the devices. A Bluetooth connection has been configured for Wi-Fi
connection between the Arduino BT card and the phone. This tool uses the Python script and
can be incorporated into any Symbian OS environment, its portable miles. A circuit was
designed and was built to obtain the descriptions of the smartphone that reflects the sphere of
the device.

Figure 2 Block Diagram of Bluetooth-based Home Automation System

2.1.2 GSM based Home Automation System controlling by Android phones


GSM-based home automation is attracting investigation because of mobile phones and GSM
technology. We found these alternatives, specifically full SMS automation, GPS based home
automation, and multi-frequency dual-tone automation (DTMF) which is mostly based on
absolute internal automation (mainly GSM). I use sound sensors and home appliances to talk to
the family community and communicate via GSM and SIM (subscriber identity module). The
machine converts the toolbox into electrical signals in the microcontroller via a converter. The
tool sensor can convert codes of various amplitudes, including sound, temperature and
humidity, and voltage. The evaluation of the microcontroller implements all indicators and
instructions by the GSM module in understanding. Select the correct language mode from SMS,
GPRS and DTFC of the receiving GSM module according to the instructions.

Figure 3 Block Diagram of GSM-based Home Automation System

2.1.3 Wi-Fi Based Home Automation System Using IOT


This machine uses a cell telephone or computer to govern the simple manipulate of the house
and works automatically from anywhere in the world through the internet; an automatic
domestic is once in a while called a clever home. The proposed system is a distributed domestic
automation gadget that consists of the server, particularly the NodeMCU Esp-8266 wireless
module, sensors, relays. The Empty Server controls and monitors an expansion of sensors and is
without problems configurable. It could handle 14 masses. It can be a sensor as input or a relay
to act as output. Node MCU board with integrated Wi-Fi module acting as a web server. blank
can be used to get right of entry to automation structures to be had inside the Play save, which
are used to govern a cell internet-linked device with the suitable clean community app, blank
Server.

Figure 4 Block Diagram of Wi-Fi-based Home Automation System


CHAPTER # 03
3 METHODOLOGY
3.1 Methodology
Make connection as per circuit diagram, make connection on NodeMCU and connect NodeMCU
to the Wi-Fi using hotspot/Router. Then connect the NodeMCU pins output to the relay driver
circuit then start programming the NodeMCU module. Programme the NodeMCU using
Arduino IDE Software. Download the Blynk library zip file, install it from add library files.
Download the NodeMCU boards from preferences, by inserting the library link in it. Set the
output of NodeMCU (D0 – D14) for different control function. Compile the typed programme
check whether are occur or not…. Upload the Programme onto NodeMCU using micro-type USB
cables. Then connect the NodeMCU module to the Internet using Router/Hotspot. Now pair the
NodeMCU module with Android application. I.e., Blynk App.
3.1.1 Flow of the System

Figure 5 Blynk System Principle

In the NODEMCU card, this system is inserted as a web-based system. Due to the ESP8266
circuit, NODEMCU is always linked to the Internet via a Wi-Fi or WLAN connection.

As the NODEMCU connects with the smartphone's access point, you'll need to know the access
point's name, the hotspot's password, and the token code for the Blynk server. Once you've
transferred the Arduino IDE code, you'll need a computer to configure the NODEMCCU to
control a portion of the product's software. As you can see in Figure 1, Blynk's application
server processes the connection from the NODEMCU smartphone. Libraries are flashed It's
common to download ZIP files from the Github website and import them into the Arduino IDE
library.

With Android Hotspot and NODEMCU code, the Blynk server checks if there's an online
connection, and if so, the credential. Data in code must correlate to hotspot information for
ESP8266 port, which is employed as an exchange channel between smartphone and NodeMCU.
As illustrated in Figure 2, the remaining processes are just assignments sent from the Blynk
application to NODEMCU to the control goods related to the Realist, and therefore the output
value of the sensor is reversed on the Blynk application of the NODEMCU set.

Start

Blynk application Check for


Check whether N Smart phone
there is internet internet
connection connection

Y
Bulbs ON/OFF from
Blynk application

NodeMCU ESP8266 initialized

Relay control initialized

Bulbs ON/OFF
Controlled by relay kit

End

Figure 6 Flowchart of Load ON/OFF


3.1.2 Block Diagram of the System

Figure 7 System Block Diagram

3.1.2.1 Smart Phone


Used for controlling Purpose, for giving command and gain output, for this Blynk Android app
is required.
3.1.2.2 NodeMCU Esp-8266 (Wi-Fi Enable Microcontroller).
To take input and perform operation. As per programme fed in the Microcontroller and obtain
output as per user requirements.

3.1.2.3 Relay Driver

Basically, the output of microcontroller is in Mile-volts so this output volt is not sufficient to
run the bulky load output.

So as to run the appliances on 230v we require a Relay module so the output is fed to the relay
module according to given input to the relay module it will generate output and drive
various appliances and load e.g., Lamp, Fan, Tube light, T.V, etc.

3.1.2.4 Output

These are the output Generated from the given input by the user The user can set the various
output sections and can gain output through any of the section like Home appliance A for lights,
Home appliance B for fans, Home appliance C for T. V .and many more……….

Home Appliance A
Home Appliance B
Home Appliance C

3.1.3 Working Process

Figure 8 Working Process


3.1.3.1 Android Device
The Device used to provide the Commands, Control the Appliances, Switch the Loads over the
Internet (Internet of Things) Through Voice Commands or Swiping on Screen/Display of Smart
phones.

3.1.3.2 NodeMCU Processing


The Heart of Home Automation, Used to Process the Information/Commands/Instruction
provided by the User or Owner, its function is to Process the data & pass the signal to the
Relay and Switch the loads as per given Input.

3.1.3.3 Applications/Appliances
The Load Can be of any type which is the output of the circuit. The Output of relay drives
the appliances. i.e switch the Loads.

 Fan
 Led Bulbs
 Computers
 Motors
 Pumps
 LED
 Air Conditioner
 Refrigerator
 Switches etc.
3.1.4 Circuit Diagram

Figure 9 Circuit Diagram

3.1.4.1 NodeMCU Esp-8266


It is Node Micro-Controller Unit. It takes input from user from internet, then process the data
and perform operation. As per programme fed in the Micro-Controller and obtain output as per
user requirements.

3.1.4.2 Relay Deriver


Basically, the output of Micro-Controller is in Mile-volts so this output volt is not sufficient to
run the bulky load output.

So as to run the appliances on 230v we require a Relay module so the output is fed to the relay
module according to given input to the relay module it will generate output and drive various
appliances and load e.g., Lamp, Fan, Tube light, T.V, etc.

3.1.4.3 Output
These are the output Generated from the given input by the user. The user can set the various
output sections and can gain output through any of the section like Home appliance A for lights,
Home appliance B for fans, Home appliance C for T. V .and many more.
3.1.5 Debug Circuit Diagram

Figure 10 Debug Circuit Diagram

3.2 Hardware Module


As mentioned above, the components used to build the circuit, NodeMCU requires 5V DC as a
stock voltage VIN pin, AC-DC drops 12V converter and DC-DC drops 5V, in case it uses -AC-DC to
convert down to 5V, there is no compelling reason to use a DC-DC converter. Yield voltage
supply voltage is associated with Vin NodeMCU, Vcc for hand unit and VCC for LM35 sensor. At a
time when the soil is normal. D0, D1, D2, D3, D5 and D6 are fruits and A0 is a simple signal
information associated with a temperature sensor as shown in Figure

3.2.1 Node MCU


For open source IoT, NodeMCU may be a cost-effective platform to use. First, the ESP8266 Wi-
Fi SoC was programmed to work with the ESP-12 module's hardware. In the future, support for
the 32-bit ESP32 MCU was added. ASCII-related file code NodeMCU displays local board styles
in a text file. There are two parts to the term "NodeMCU": "node" and "micro-controller unit"
(MCU). As a result, the term "NodeMCU" is used to refer to code rather than development kits.
Code and prototyping board styles are grouped together in a large open space.
Figure 11 Node MCU ESP 8266

3.2.1.1 Features
Table 1 Features of NodeMCU

Developer ESP8266 Open-source Community

Type Single-board microcontroller


Memory 128kBytes
Power USB
Operating system 128kBytes XTOS
Storage 4Mbytes
CPU ESP8266
Website www.nodemcu.com

3.2.1.2 Specificatio
n
3.2.1.3 Pin Diagram/ Pin Layout of NodeMCU

Figure 12 ESP8266 Node MCU pinout


3.2.2 LCD
There are many different types of liquid crystal screens, but the most common is the liquid
crystal flat screen. When using a backlight or a mirror instead of emitting light directly, the
liquid crystal has created a monochrome image or a color, on a screen. To show or hide low
information contents, such as preprogrammed words, 7 segment numbers and screens on
digital watches, Flash liquid crystal screens of any image or a fixed image (such as a general
computer monitor). Although everyone uses the same basic technique, the images consist of a
lot of small pixels, while the other screens have larger components.

Figure 13 LCD

3.2.2.1 Pin Configuration of LCD

Table 2 Pin Configuration of NodeMCU

Pin No Symbol Level Description


1 VSS 0V Ground
2 VDD 5V Supply voltage for logic
3 VO (Variable) Operating voltage for LCD
4 RS H/L H: DATA, L: Instruction Code
5 R/W H/L H: Read (MPU Module)
L: Write (MPU Module)
6 E H H->L Chip enable signal
7 DB0 H/L Data bus line
8 DB1 H/L Data bus line
9 DB2 H/L Data bus line
10 DB3 H/L Data bus line
11 DB4 H/L Data bus line
12 DB5 H/L Data bus line
13 DB6 H/L Data bus line
14 DB7 H/L Data bus line
15 A 5V LED +
16 K 0V LED -

3.2.3 Relay Module 5V

Figure 14 Relay Module

3.2.3.1 Introduction
It is a 5V 4-channel transmission board interface with a 15-20mA current drive required for
each station. It can be used to control a variety of current and device types. They have a high
current transmission performance when operating at AC 240V 10A or DC 28V 10A. It has a
typical interface which will be controlled directly by the microcontroller.
3.2.3.2 Principle
There are two types of relay contacts: typically open and normally closed. The normally open
contact will be closed when signal port is at a low level when signal fire is illuminated and opto-
coupler Relay is conducting and the transistor is conducting as well. A longer signal port means
that you'll have to alter how long it is before you can connect or disconnect a load.

3.2.3.3 Pin Description


 Input: 0-5 V
 Vcc: Pin for Positive Supply voltage
 GND: Pin for Ground
 IN1-IN4: Pin for Relay control opening
 Output: Supports different types of loads
 Connect a load, DC 28V / 10A, AC 240V / 10A

3.2.3.4 Features
 Size: 70mm (Length) * 50mm (Width) * 19.6mm (Height)
 Weight: 62g
 PCB Color: Blue
 Each corner of the board has four fixed screw holes, making it easy to install and fix. The hole
has a diameter of 3.4mm.
 High quality single transfer is used with a single pole for double throws, regular ends, frequent
open ends, and closed end
 Precise anti-interference, Optical coupling isolation.
 Released at high level with indicator off ,Closed at low level with indicator on,
 JD VCC is a relay power source, whereas V CC is the system power supply. Default is a 5V relay on
the ship.
 The maximum output requirement of relay: DC 30V/10A, AC 240V/10A
3.2.4 Power Supply
3.2.4.1 Block diagram of Power Supply

Figure 15 Block Diagram of CD Supply

3.2.5 Introduction
The operation of almost every electronic device today requires the use of a DC power supply.
This power supply must be operated within certain power supply limits. All of this DC power is
provided by the single phase AC mains.

The regulated power supplies are capable of converting alternating current or voltage from
unreliable to a constant DC (current or voltage). Because it regulates power, the output remains
constant regardless of changes in input. Embedded DC power supply, or linear power supply,
consists of several blocks and is used to power a variety of devices. The regulated power supply
accepts an AC input and results in a constant DC output.

So, we have powered the Kit/ set-up with the Adaptor which gives exact 5V output voltage we
have used the micro-type USB cables for connection of Controller with Adaptor.

3.2.5.1 Description
Following is a list of the basic components of a regulated DC power source:

 Step down transformer


 Rectifier
 DC filter
 Regulator

3.2.5.1.1 Step-down Transformer


An ac step down transformer reduces voltage level from 220V ac supply to the desired level.
The transformer's turn ratio is adjusted to obtain the desired voltage. The rectifier circuit
receives the transformer's output as an input.

3.2.5.1.2 Rectification
The rectification process is carried out by a diode-based electronic circuit. To rectify means to
convert an alternate current (AC) and voltage (AC) into their corresponding direct current (DC)
quantities. Unbalanced, unidirectional DC pulses are the result of the rectifier's input and
output. Rectifiers are typically used for both Positive and negative half cycle of the AC supply,
whether they are full-wave rectifiers or bridge .A full wave bridge rectifier is shown in figure.

3.2.5.1.3 DC Filtration
It is a pulsating DC voltage with an extremely high ripple content. But that's not what we are
looking for; we are looking for a pure DC without ripples.

3.2.5.1.4 Regulation
A regulated DC power deliver is completed with this final block. The output voltage and
contemporary will fluctuate due to modifications inside the enter voltage from the ac mains,
adjustments inside the load present day on the output of the regulated strength supply, or
other elements such as temperature changes. It is possible to solve this problem by utilizing a
regulator. Even if the input changes the output of a regulator will remain constant. There are a
variety of ways to regulate the flow of electricity, including using transistor series regulators,
fixed and variable integrated circuits, and zener diodes operating in the zener region. These
integrated circuits (IC) have been designed to provide fixed voltage values at the output
waveform. Filtering is therefore necessary. For example, a capacitor filter is used as well as an
LC filter, a choke input filter, and a filter.
3.2.6 Connecting wires
Connecting wires, allows electrical power or signal to travel from one place to another because
a signal or current requires a means of travel. In basic circuits, the telephone comes from a
single power source circuit, such as a battery.

Figure 16 Connecting Wire

3.2.7 Wi-Fi hotspot


Wi-Fi hotspot is just an area with an on hand wireless community. The time period is normally
used to refer Wi-Fi networks in public regions including airports and cafes. Customers can even
create their very own mobile hotspot with a mobile phone or an outside device that may
manufacture with a cellular community.

Figure 17 Wi-Fi Device


3.3 Software Module
3.3.1 Blynk App
The Blank app was created for the Internet of Things. It can remotely control hardware, view
sensor logs, keep facts, visualize and much more. The prototype typically uses a blank
application to detect instructions from the user for hardware on a Wi-Fi network.

Figure 18 Blynk App

3.3.2 Downloading and installing and Blynk application on smart phone


 Blynk application is downloaded and installed from the Play Store.
 Once the application is installed, a new account is created and logged in to it.
 After logging in, a new project is created. The project is named, hardware is selected as Node
MCU and the connection type is selected as Wi-Fi, and created.
 At this point Blynk will sends an authentication token to email id. This authentication token will
be used to identify the hardware in the Blynk server.
 As the prototype uses 6 channel relay module, 6 buttons are added to the screen from the side
bar.
 All the 6 buttons are then customized by adding a name and selecting the digital pin it will
correspond to. This section will actually affect the hardware connection as the relays will be
physically connected to the digital pins corresponded here.
 The setup of Blynk application is now complete.

Figure 19 Set up Blynk application

3.3.3 Driver installation for hardware interfacing


These days, most devices download and install drivers on their own, without any assistance from the
user's end. Therefore, Windows cannot identify the Node MCU board and proceed normally because it
does not know how to communicate with the USB driver on Node MCU.

 ESP8266 Wi-Fi module-based Node MCU Amica development board. With its Micro USB port,
you can easily connect your computer or other USB host devices to it without any hassle. If you
want to connect a USB host device to the Ti, it has 15X2 header pins that can be mounted on a
breadboard and a Micro USB slot. A USB to serial converter, the CP2120, is built into the device.
 To install CP2120 (USB to serial serial), the user is required to download the driver accordingly.
 A connection to NodeMCU is established as soon as the user downloads the appropriate drivers
for their operating system.
 The user needs to download the COM posts provided on the newly connected USB device (Node
MCU) from the system device manager. This com port number will be required while using the
Node MCU Amica.
3.3.4 Interfacing Node MCU with Arduino IDE
To start with the latest version of Arduino IDE, we will need to update the board manager with
a custom URL. Choose File > Preferences in Arduino IDE. After that, copy below the URL in the
text box for additional URLs located at the bottom of the window:

Figure 20 Arduino IDE preferences

Then, at that point go to Board Manager by getting to Tools> Boards> Board Manager. There
ought to be a couple of new increases to the quality Arduino sheets. Channel your hunt by
composing ESP8266. Click enter and select Insert.

Figure 21 ESP8266 board installation in Arduino IDE.

Let's confirm the board is selected correctly in Arduino IDE before transferring the sketch and
playing with LEDs. Open the Arduino IDE and select Node MCU 0.9 from the Tools > Boards
menu (ESP-12 Module).
Figure 22 Arduino IDE board manager installation

Now, connect your NodeMCU ESP8266 with Laptop through USB cable As soon as the board is
plugged in, it should be given a unique COM port number. COM# is the Windows equivalent,
while on Mac/Linux computers its /dev/tty.usbserial-XXXXX. This serial port can be found in the
Arduino IDE's Tools > Port menu under the Arduino IDE's Tools menu. Also, select 115200 for
the Upload Speed.
Figure 23 Assigning communication port on Arduino IDE.

3.3.5 Uploading code to Node MCU


 NodeMCU is connected to laptop through a USB cable.
 After that, we'll configure the Arduino IDE by making a few changes. You'll need to open up your
computer's Arduino IDE software. Selected ESP-12E Module as the board under Tools > Board.
There are no other settings to change. So, let's get to work on the code.
 Select Files > Examples > Blynk > Boards WIFI > ESP8266_Standalone. A new file with some
prewritten code opens. The following changes to the code are made.

1. The line which says ‘char auth [] = “YourAuthToken”, replace YourAuthToken part with your
Blynk’s authentication token that was generated by the Blynk server.
2. The line which says char ssid [] = “YourNetworkName”, replace YourNetworkName part with the
name of Wi-Fi network that the Node MCU must connect to.
3. The line in which it says char pass [] = “YourPassword” and change the YourPassword part with
the password of the Wi-Fi network.
Figure 24 Code in Arduino IDE to be installed to Node MCU

The code is ready to be uploaded to the hardware. On clicking upload button, the code is
uploaded to Node MCU and the next time it’s powered on, it automatically connects to the
assigned Wi-Fi network.
CHAPTER # 04
4 RESULT AND DISCUSSION

4.1 RESULTS AND DISCUSSION


4.1.1 Light Control Test Results
In the Blynk app on your Android smart phone, press the ON / OFF button for lights and fans to
perform the Light Control Test. Wi-Fi Internet connection must be established after the system
is turned on. Internet connectivity issues, such as a reduced signal, may affect system
performance. In the table below, you can see the results of the switch test.

Table 3 Load Control Test

Switch status On Off


Relay 1
---- Relay 2
Relay 3
Relay 4
Relay 5
Relay 6
Relay 1 Relay 2
Relay 3
Relay 4
Relay 5
Relay 6
Relay 1
Relay 2 Relay 3
Relay 4
Relay 5
Relay 6
Relay 1
Relay 2
Relay 3 Relay 4
Relay 5
Relay 6
Relay 1
Relay 4 Relay 2
Relay 3
Relay 5
Relay 6
Relay 1
Relay 5 Relay 2
Relay 3
Relay 4
Relay 6
Relay 1
Relay 6 Relay 2
Relay 3
Relay 4
Relay 5
Relay 1
Relay 2
Relay 3 ---------
Relay 4
Relay 5
Relay 6

4.1.2 Final Connect of Hardware


The materials and building materials mentioned above are used. Figure 12 shows a project that
is being used as a system (IoT) operated by the Blynk operating system. The loads used in this
project are bulbs, which can be replaced by other devices by replacing bulbs with AC plugs to
connect devices or home appliances.

Figure 25 Final Hardware


CHAPTER # 05
5 CONCLUSONS

5.1 Limitations
In order to convert the speech data into string data, Android devices with API versions lower
than 16 require internet access. For the time being, the application is only available for Android
Smart Phones. Noises from the outside (voice) can affect our results when using the voice mode.
In our voice mode, the speech command that we issue may not produce the exact result that we
had hoped for. As a result, there is ambiguity in the outcome.

5.2 Conclusions
It's possible to come to these conclusions after analyzing data obtained from testing smart
home with NodeMCU ESP6288's Internet of Things-based module:

 There are various things that can be used to create a smart home system controlled by the Blynk
Android app. The NodeMCU ESP8266 Module can be used to create a Smart Home with Internet
of Things (IoT).
 The NodeMCU ESP8266 Internet of Things (IoT) module can be used to control lighting, fans,
temperature, and early warning systems in the smart home of the powerful Internet of Things
(IoT).

5.3 Further Enhancement and Future Scope


Shortcuts that can no longer be distributed on various platforms, such as iOS and Windows are
possible in the current location. If you use all of your home appliances, you can remove the
limit of your ability to control a small number of devices. The prototype can include sensors to
implement automatic control of the home appliances like; an LDR that can sense daylight and
switch lamp accordingly, a PIR to detect motion and be used for security purposes making an
alarm buzz, or a DHT11 sensor that’s senses ambient temperature and humidity of atmosphere
and switch fan/air conditioner accordingly. Scope of this project can be expanded to many
areas by not restricting to only home, but to small offices.
References
[1]. Evans, D. (2011). The internet of things: How the next evolution of the internet is changing
everything. CISCO white paper, 1(2011), 1-11.
[2]. Buyya, R., Broberg, J., & Goscinski, A. M. (Eds.). (2010). Cloud computing: Principles and
paradigms (Vol. 87). John Wiley & Sons.
[3]. Xiong, G., Chen, C., Kishore, S., & Yener, A. (2011, January). Smart (in-home) power
scheduling for demand response on the smart grid. In ISGT 2011 (pp. 1-7). IEEE.
[4]. Bharath,S., Pasha, M.Y., & Deepth, J.(2017, April). IoT-Home
Automation.
International Journal of Computer Technology and Research, 5, 4-6.
[5]. Li, B., & Yu, J. (2011). Research and application on the smart home based on component
technologies and Internet of Things. Procedia Engineering, 15, 2087-2092.
[6]. Kim, J. (2016). HEMS (home energy management system) base on the IoT smart home.
Contemporary Engineering Sciences, 9(1), 21-28.
[7]. Kodali, R. K., Jain, V., Bose, S., & Boppana, L. (2016, April). IoT based smart security and
home automation system. In 2016 international conference on computing, communication and
automation (ICCCA) (pp. 1286-1289). IEEE.
[8]. Pan, J., Jain, R., Paul, S., Vu, T., Saifullah, A., & Sha, M. (2015). An internet of things
framework for smart energy in buildings: designs, prototype, and experiments. IEEE Internet of
Things Journal, 2(6), 527-537.
[9]. Jain, S., Kumar, V., Paventhan, A., Chinnaiyan, V. K., Arnachalam, V., & Pradish, M. (2014,
March). Survey on smart grid technologies-smart metering, IoT and EMS. In 2014 IEEE Students'
Conference on Electrical, Electronics and Computer science (pp. 1-6). IEEE.
[10]. Zhao, Z., Lee, W. C., Shin, Y., & Song, K. B. (2013). An optimal power scheduling method
applied in home energy management system based on demand response. Etri Journal, 35(4),
677-686.
[11]. Haque, K. F., Saqib, N., & Rahman, M. S. (2019, March). An Optimized Stand-alone Green
Hybrid Grid System for an Offshore Island, Saint Martin, Bangladesh. In 2019 International
Conference on Energy and Power Engineering (ICEPE) (pp. 1-5). IEEE.
[12]. Singh, R. S. S., Ibrahim, A. F. T., Salim, S. I. M., & Chiew, W. Y. (2009, November). Door
sensors for automatic light switching system. In 2009 Third UKSim European Symposium on
Computer Modeling and Simulation (pp. 574-578). IEEE.
[13]. Vaghela, M., Shah, H., Jayswal, H., & Patel, H. (2017). Arduino based auto street light
intensity controller. Invention Rapid: Embedded Systems, 2013(3), 1-4.

[14]. Jewel, M. H., Islam, M. N., & Hasan, M. J. (2017). Automatic Room Light Control Using
Bidirectional Visitor Counter and Gas Detection (Doctoral dissertation, East West University).
[15]. Pavithra, D., & Balakrishnan, R. (2015, April). IoT based monitoring and control system for
home automation. In 2015 global conference on communication technologies (GCCT)(pp. 169-
173). IEEE.
[16]. Khadem, T., Billah, S. B., Barua, S., & Hossain, M. S. (2017, September). Homer based
hydrogen fuel cell system design for irrigation in Bangladesh. In 2017 4th International
Conference on Advances in Electrical Engineering (ICAEE)(pp. 445-449). IEEE.
[17]. Adhya, S., Saha, D., Das, A., Jana, J., & Saha, H. (2016, January). An IoT based smart solar
photovoltaic remote monitoring and control unit. In 2016 2nd international conference on
control, instrumentation, energy & communication (CIEC) (pp. 432-436). IEEE.
[18]. Khan, M., Silva, B. N., & Han, K. (2016). Internet of things based energy aware smart home
control system. IEEE Access, 4, 7556-7566.
[19]. Bedi, G., Venayagamoorthy, G. K., Singh, R., Brooks, R. R., & Wang, K. C. (2018). Review of
internet of things (IoT) in electric power and energy systems. IEEE Internet of Things Journal,
5(2), 847-870.
[20]. Adila, A. S., Husam, A., & Husi, G. (2018, April). Towards the self-powered Internet of
Things (IoT) by energy harvesting: Trends and technologies for green IoT. In 2018 2nd
International Symposium on Small-scale Intelligent Manufacturing Systems (SIMS) (pp. 1-5).
IEEE.
[21]. Desco retail electricity price rate, (2019). DESCO. Retrieved from
https://www.desco.org.bd/bangla/tariff_rate_b.php
[22]. Mondal, A. H., & Denich, M. (2010). Hybrid systems for decentralized power generation in
Bangladesh. Energy for Sustainable Development, 14(1), 48-55.

You might also like