You are on page 1of 53

SMART REMOTE CONTROL SYSTEM (SRCS)

MALIK SAIFUL LIZAN BIN JALALUDIN

BUSINESS INFORMATION SYSTEM


UNIVERSITI TEKNOLOGI PETRONAS
JANUARY 2020
SMART REMOTE CONTROL SYSTEM (SRCS)

by

MALIK SAIFUL LIZAN BIN JALALUDIN


20167

FINAL PROJECT REPORT


Dissertation submitted in partial fulfilment of
the requirements for the
Bachelor of Information System (Hons)
(Business Information System)

JANUARY 2020

Universiti Teknologi PETRONAS


32610 Seri Iskandar
Perak Darul Ridzuan.
CERTIFICATION OF APPROVAL

SMART REMOTE CONTROL SYSTEM (SRCS)

by

MALIK SAIFUL LIZAN BIN JALALUDIN


20167

A project dissertation submitted to the


Business Information System Programme
Universiti Teknologi Petronas
in partial fulfilment of the requirement for the
Bachelor of Information System (Hons)

Approved by.

___________________
(Dr. Faizal bin Ahmad Fadzil)

UNIVERSITI TEKNOLOGI PETRONAS


SERI ISKANDAR, PERAK
JANUARY 2020

i
CERTIFICATION OF ORIGINALITY

This is to certify that I am responsible for the work submitted in this project, that the
original work is my own except as specified in the references and acknowledgements,
and that the original work contained herein have not been undertaken or done by
unspecified sources or persons.

___________________________
(MALIK SAIFUL LIZAN BIN JALALUDIN)

ii
ABSTRACT

Technology's rapid growth has dramatically changed the standard of living in


modern society. In view of the growing amount of household electrical equipment
manufactured, an increasingly useful feature has become an integrated home control unit.
Existing systems, however, have issues with performance, strong price, non-open sources
and numerous standards that are incompatible limiting the power of the affluent or the
hobbyist's home appliances

This venture aims at developing a reliable, affordable and convenient remote


control structure to interface the NodeMCU open source microcontroller with the mobile
application; generating a fast, convenient controller system for electrical devices. In
several stages, the venture was carried out. A microcontroller called NodeMCU is the first
installation that having a Wi-Fi Module (ESP8266) chip on itself interfacing mobile
applications. First, in a home version, the system is designed to operate with appliances.
Eventually, Blynk App provides a simple graphical user interface to form the device user-
friendly, completing the smart remote control system development.

The development of smart remote controller system will be implemented


successfully. Using the mobile app on the smartphone, NodeMCU was linked via wireless
network, enabling control of the home model appliances.

iii
ACKNOWLEDGEMENT

Alhamdulillah, all praises and gratitude to Allah for giving the health and strength
to successfully complete the final year project. First and foremost, the author would like
to express his thankfulness to his parents and the rest of his beloved family members
whom have supported and motivated in finishing his study. Secondly, the author would
like to take this chance to show his thankfulness to Dr. Faizal bin Ahmad Fadzil, who,
although incredibly busy with his duties, provided invaluable assistance, support and
guidance during author’s final year project. It has been a great time spent supervised by
him and learned various skills that may need in future tasks. Last but not least, the author
would like to express appreciation to all his other lecturers and friends and to all those
who have supported him over the past two semesters, making his final year project a huge
success.

Thank you.

iv
TABLE OF CONTENTS

CERTIFICATION OF APPROVAL i
CERTIFICATION OF ORIGINALITY ii
ABSTRACT iii
ACKNOWLEDGEMENT iv
TABLE OF CONTENTS v
LIST OF FIGURE vii
LIST OF TABLE ix
CHAPTER 1: INTRODUCTION 1
1.1 Background of Study 1
1.2 Problem Statement 3
1.3 Objectives and Scopes of Study 4
CHAPTER 2: LITERATURE REVIEW 5
2.1 Existing Remote Control System Review 5
2.2 The Multifunction Microcontroller (NodeMCU) 6
2.2.1 The Development Board 6
2.2.2 ESP8266 (Wi-Fi Module) 9
2.2.3 Serial Port 10
2.2.4 NodeMCU Programming 11
2.2.5 Advantage of NodeMCU 14
2.3 Relay 14
2.4 ACS712 Current Sensor 16
2.5 HC-SR04 Ultrasonic Sensor 18
2.6 Blynk Application 19
2.6.1 Blynk Server 19
CHAPTER 3: METHODOLOGY 21
3.1 Design Methodology 21
3.2 Hardware Design 25
3.3 Software Design 26
3.3.1 Blynk Apps 28
3.4 Project Cost 29
v
3.5 Gantt Chart 29
CHAPTER 4: RESULTS AND DISCUSION 32
4.1 Prototype Setup 32
4.2 Operation of the System 33
CHAPTER 5: CONCLUSION AND RECOMMENDATION 37
REFERENCES 38
APPENDICES 40

vi
LIST OF FIGURE
Figure 1: Picture of NodeMCU board. 6
Figure 2: NodeMCU’s board diagram. 7
Figure 3: NodeMCU ESP-12E schematic diagram 8
Figure 4: Early model of ESP8266 (Wi-Fi Module) 9
Figure 5: NodeMCU pin schema.10
Figure 6: Installing the ESP8266 board package Step 1. 11
Figure 7: Installing the ESP8266 board package Step 2. 12
Figure 8: Installing the ESP8266 board package Step 3. 12
Figure 9: Setting up the ESP8266 support first step. 13
Figure 10: Setting up the ESP8266 support last step. 13
Figure 11: Single channel Relay module. 14
Figure 12: Basic relay structure. 16
Figure 13: ACS712 Current Sensor. 16
Figure 14: Pinout Diagram and Pin Description of ACS712. 17
Figure 15: HC-SR04 Ultrasonic Sensor. 18
Figure 16: Working Principle of Ultrasonic Sensor. 18
Figure 17: Blynk application an IoT Platform. 19
Figure 18: Design Methodology Process Flowchart 22
Figure 19: Project Classification Units. 23
Figure 20: Full System Design. 24
Figure 21: Circuit diagram of the integration between ACS712
sensor & NodeMCU. 25
Figure 22: Circuit diagram of the integration between Ultrasonic
sensor & NodeMCU. 25
Figure 23: Circuit diagram of the integration between Relay,
Load & NodeMCU. 26
Figure 24: Flowchart of the system. 27
Figure 25: Step to build Smart Remote Control System Via Blynk Apps. 28
Figure 26: Complete Circuit of SRCS prototype. 32

vii
Figure 27: Serial Monitor showing the output from NodeMCU. 34
Figure 28: The SRCS application interface. 35
Figure 29: Successfully notify the client. 36

viii
LIST OF TABLE

Table 1: Project Cost 29


Table 2: Gantt Chart of the Final Year Project 1. 29
Table 3: Gantt Chart of the Final Year Project 1. 30

ix
CHAPTER 1
INTRODUCTION

1.1 Background of Study

Due to the population increase, housing desire is growing throughout world. It


leads to a global increased demand for energy use by the residential inhabitants (Hassan
J. S et al., 2014). Construction now absorbs up to 40% of the total global energy. And by
2030, it is predicted that demand will increase to 50%, meaning half of the global energy
(Hassan J. S et al., 2014). Building in Malaysia already uses an amount of 50% of the
electricity produced in the state (Hassan J. S et al., 2014). Every year, therefore, there is
always the need for efficient energy usage in the construction sector (Ramli K. N et al.,
2014). Because the energy demand in Malaysia is expected to exceed 100 GWh in the
coming year 2020. Nevertheless, more than 50% of building energy consumption is air
conditioning (Hassan J. S et al., 2014). In addition, the main factor affecting air
conditioner energy consumption is our attitude that does not turn off when not in use.
Therefore, to minimize the use of power, it is necessary to consider and track the use itself.

Energy consumption is a significant part of the total demand for electricity in the
residential sector. (Rahman K. A et al., 2017). Many customers are not alert in their daily
lives about how to use power efficiently. In other words, users are inefficiently consuming
electrical energy because they are using inefficient electrical appliances. Electricity
saving requires either energy preservation or enhancement (Rahman K. A et al., 2017).
Conserving means carrying out less electricity-using tasks. Improving energy efficiency
(EE) means finding the right devices for the same activities that use less energy. It can be
seen from the survey that customers have not grasped the high power consumption that
exists from their electrical appliances (Rahman K. A et al., 2017).

1
Governments around the world are encouraging energy consumers to reduce
energy use by raising awareness, creating incentives to low-energy users and
implementing options to green energy. Other possible solutions may include reducing
energy consumption and utility bills by installing integrated photovoltaic systems, alerting
customers to their use of electricity, using energy-efficient devices, replacing traditional
devices with smart devices (remote controllable sockets), and implementing intelligent
energy management systems that control smart devices (Al-Hassan E.S et al., 2018). The
growing use of home remote control system can be seen in cold cities like Williston,
where the citizen set the their home’s heating to go off when they leave and turn on the
heater 15 minutes before returning (Chassiakos et al., 2016). The HVAC (Heating
Ventilation Air Conditioning) system is the greatest option for home automation system.
Users want to connect home appliances wirelessly in an age of wireless
telecommunications like Bluetooth, WiFi, Zigbee, and GSM (Chassiakos et al., 2016).
Every wireless technology has its own definition and specifications.

In hot countries, including Malaysia, air conditioning is commonly used today.


The traditional air conditioning typically cools the house lean on the setting of the
predetermined temperature and not changed automatically to the convenience of the user
(Jaafar L., 2014). Several researchers are proposing excellent real-time, high reliability
and good intelligence in the central air conditioning control area. In addition, the
conventional PID (proportional-integral-derivative) algorithm still plays a major role in
the system of control (Jaafar L., 2014). The air conditioning system has becoming a field
to be researched to improve the user convenience by applying intelligent system such as
Adaptive Fuzzy controller (Jaafar L., 2014). While the enhanced air conditioning system
is being developed, a modelling project must include type of control system consideration.
The controller in general is the ineffectiveness of the continuous operation of air
conditioning must be minimized. In the presence of the sensing circuit, multiple control
options are considered, which would shut off air conditioning while there is no people in
the room or house with air conditioning and temperature sensor feedback, which would
adjust the function of air conditioning based on room temperature (Jaafar L., 2014). It
2
always works constantly without systematic monitoring, based on the experience of using
the present traditional air conditioning method. Air conditioning control is therefore
controlled via a feedback control system to track and maintain a persistent temperature
based on the sensor's data input.

While developing a remote control system, there are a few issues to tackle. The
process must be designed in such a way that new components or hardware are integrated
so that at a later stage these components should not be a concern. The system should be
convenient for user on the host side, allowing devices to be easily monitored and
controlled. The device interface should provide diagnostic tools in the event of any
problems in the future. Finally, the device should be cost-effective in order for anyone on
the market to be able to use it widely. Therefore, the project aimed at inventing a system
that can improve the energy usage by the occupants by controlling and monitoring it.

1.2 Problem Statement

Below are the problems that have been identified to be solved through the proposed
system:

1. Occupant lack of awareness about the energy consumption of air conditioner or


other electrical appliances (Chiaroni D et al., 2016).
2. The manual switching method which through the fixed wall switch board is
an inconvenient method when frequent switching operation is required (Nagy Z et
al., 2015).
3. The traditional remote controller are easy to lose and the range of wireless is quite
short which is within 10 meter only.

3
1.3 Objective and Scope of Study

Objectives

In order to solve the problems to avoid further difficulty, the following objectives
need to be achieved:

1. To investigate and design a system that user able to monitor their usage using
smartphone.
2. The system able to turn off the appliances automatically when no one is using it
for specific or set periods.
3. To give user the ability to switch on or off the appliances from anywhere anytime
using a smartphone over the Internet.

Scopes

This venture aims to improve the energy usage of air conditioner or other
electrical appliances. While the goal of this venture is about to build an affordable,
reliable and adaptable system that give the user the ability to monitor and remotely
switch on or off the air conditioner using smartphone. For this purpose, the
NodeMCU microcontroller is used for sending signals to monitor electronic
equipment as the main controller for the device. For prototyping purposes, the
system will be restricted to a home model. A mobile application serves as the
front-end while using a generic Wi-Fi module as the connection between mobile
application and NodeMCU.

4
CHAPTER 2
LITERATURE REVIEW

2.1 Existing Remote Control Systems Review

Various kind of solutions to home remote control systems have been developed.
A method based on SMS uses the Global Mobile Communication System technology
available for interacting with a microcontroller on telephones that acts as the primary
monitor of access to electrical equipment. In order to enable SMS capabilities, a GSM
module must also be connected to the microcontroller via a port (Ransing R. S., Rajput
M., 2014). The downside of this kind of program is that it is not convenient because there
is no such graphical user interface (GUI) is available, and entry keys and control codes
should be considered for the operation of the system (Asadullah M., Raza A., 2016).

Another solution is voice recognition to submit wireless network commands of


Radio Frequency (RF). The voice command is recorded, digitized and sent to a device
using a microphone to be interpreted by a Visual Basic-based program that uses the
Microsoft speech API (Kumar S., 2014). When the voice command is understood, test
signals will be sent to appropriate system addresses for intervention. Nonetheless, in
interpreting voice commands, the program tested was not always accurate (Rathnayake
K. A. S. V et al., 2016).

Hand gestures have also been introduced to power remote control devices at home
(Jain S et al., 2014). In order to interpret and transmit command signals, a tiny camera
used to track the various moves made by the hand of the user. Nonetheless, the use of
such technologies involves the use of a high-end computer desktop to process information,
resulting to bigger arrangement costs.

5
2.2 The Multifunction Microcontroller (NodeMCU)

2.2.1 Development Board

Figure 1: Picture of NodeMCU board.

NodeMCU is an Open Source Firmware Development Board that assist to mainly


develop Internet of Things projects with the assistance of a few LUA Scripts. The
development board usually consists of a pre-loaded LUA scripting language, but it is also
compatible with Arduino Integrated Development Environment (Arduino IDE) software
and can be programmed in a fashion similar to that Arduino (Modi M et al., 2016). It is
similar to the Arduino Hardware with built-in Input/ Output pins. Not only that, it does
has a built-in Wi-Fi chip that allows direct internet connectivity, thus making it easier to
handle thing online. It speeds up the Internet of Things projects by providing the
developers with a simplistic and easy development environment. The development board
is composed of ESP8266 Chip, Integrated GPIO (General Purpose Input Output), PWM
(Pulse with Modulation), IIC (Interconnected Integrated Circuit), and ADC (Analog to
Digital Converter). It supports a wide range of libraries including controls for HTTP,
UDP, MQTT, normal GPIO, Blynk, and SimpleTimer (Modi M et al., 2016).

The NodeMCU Input/ Output Board is the NodeMCU system’s body, palpable
part. The commonly used prototyping equipment is a circuit board that acts as a dual in-
line (DIP) package, combining a USB controller with a smaller surface-mounted board
that includes the antenna and MCU (Micro Controller Unit) as the microprocessor (Qiang
T et al, 2018).
6
Figure depicts the block diagram of the NodeMCU board:

Figure 2: NodeMCU’s board diagram.

7
Figure 3: NodeMCU ESP-12E schematic diagram.

8
2.2.2 ESP8266 (Wi-Fi Module)

The ESP8266 chip is the main constituent of the development board, it functions
on 3V logic. It is the chip that is primarily responsible for the ability of the development
board to connect to Wi-Fi. The early models have a self –contained SoC (System on Chip)
and a complete TCP/IP stack offering the ability to access Wi-Fi networks to any
microcontroller connected to it (Modi M et al., 2016).

Figure 4: Early model of ESP8266 (Wi-Fi Module)

The recent models like NodeMCU have microcontroller capability integrated with
the Wi-Fi chip because of the technological developments. It has a strong on-board
processing unit, and the storage capacity is sound enough to allow integration through the
GPIO pins with sensors and other applications. Every ESP8266 module comes pre-
programmed with a firmware set of AT commands, which means that the user can easily
hook up to the Arduino and get as much Wi-Fi capability as a Wi-Fi Shield offers
(Anandakumar M et al., 2017).

9
2.2.3 Serial Port

While adding programs to the Input/ Output panel, the serial port is used during
the development stage as communication between the NodeMCU and the computer.
There are multiple types of serial communication protocols. The NodeMCU serial port is
used in asynchronous mode, which means there is no need for an external clock signal.
The asynchronous method utilizes one data transmission signal and one data receiving
signal (Skraba A et al., 2016).

Figure 5: NodeMCU pin schema.

10
2.2.4 NodeMCU Programming

To be able to interact with the software Arduino IDE used in this task, the
NodeMCU board needs to upload some program (code) to the NodeMCU board. In that
case, the NodeMCU must be connected to computer using USB cable (Grokhotkov I.,
2020).. In this phase, the first thing need to do is to install the ESP8266 Board package at
first place and also other important package such as Blynk that will used in this kind of
system. There are still some configuration need to done after setting up the ESP8266
support which are selection of type and version of NodeMCU board from the “Tools”
option, and also some configuration of setting up the “CPU Frequency”, “Flash Size”,
“Upload Speed” and more (Grokhotkov I., 2020).

Figure 6: Installing the ESP8266 board package Step 1 (Grokhotkov I., 2020).

11
Figure 7: Installing the ESP8266 board package Step 2 (Grokhotkov I., 2020).

Figure 8: Installing the ESP8266 board package Step 3 (Grokhotkov I., 2020).

12
Figure 9: Setting up the ESP8266 support first step (Grokhotkov I., 2020).

Figure 10: Setting up the ESP8266 support last step (Grokhotkov I., 2020).
13
This Arduino IDE software offers a convenient interface for users to facilitate the
process of development and programming. It can run on Windows, Mac OS X, and Linux.
The Arduino IDE includes an editor of text, a status display message area, a screen of text,
a standard feature toolbar, and a menu bar. In addition, Arduino IDE offers a convenient
interface for fast upload of code, this is possible because NodeMCU is ready to boot
(Devekar N., 2018). NodeMCU can be programmed using Arduino IDE by downloading
a specific set of libraries for the same. The IDE’s baud rate and port size is modified
according to NOdeeMCU’s hardware specification, and the software is inserted into the
board in a serial fashion (Milan M et al., 2016). The program is written in standard C/C++
language along with the library supporting Blynk Applications.

2.2.5 Advantage of NodeMCU

The key benefit of using NodeMCU is the availability of on-board Wi-Fi module
while eliminating the need for unnecessary external modules or Ethernet cables to achieve
an Internet connection. In addition, the board is explicitly designed to meet these needs;
that is obvious from the fact that the chip board size is small and optimal, the electricity
consumption is very low, the board can be started in deep sleep mode for power saving
and most significantly is it contains a TCP/IP stack that allows the board to accept any
TCP/IP protocol as its base (Milan M et al., 2016).

2.3 Relay

Figure 11: Single channel Relay module.


14
A relay is an electromechanical switch type. It has a generic microcontroller
interface that can be controlled directly. Provided the electrical isolation of the control
pins and switches, a relay can be used to control large current with a small current
(Agrawal N., Singhal S., 2015). It means that it can be used to monitor different large-
scale appliances and equipment (Agrawal N., Singhal S., 2015). Therefore, relays are best
suited for this project to be used as switches to electronic devices as they can be triggered
by NodeMCU's low-current signals. They are commonly used because many sensors only
generate tiny electric current and it is difficult to cross the current gap to power bigger
machinery. The electromagnet which is at the relay’s main component, is for executing
the process for switching.

There are two fundamental types of relay switches, namely:

 Normally Open Contact (NO) - Often known as “make contact”. When the
relay is switched on, it closes the circuit. When relay is disabled, it
disconnects the circuit.
 Normally Closed Contact (NC) – Often known as “break contact”. The
circuit disconnects when the relay is switched on. The circuit connects
when the relay is switched off.

The way a five-pin relay works is quite simple; as current flows through the input
terminal of control, the inductor is energized, and the electromagnet connected to the
mobile slider is drawn to the coil and the switching circuit is closed.

15
Figure 12: Basic relay structure.

2.4 ACS712 Current Sensor

Figure 13: ACS712 Current Sensor.

ACS712 current sensor is a sensor for detecting the either AC or DC current. It


also can be explain as a tool capable detecting electric current in a wire and producing a
signal proportional to the current (Kurde A., Kulkarni V. S., 2016). The signal produced
could be analogue or current voltage, or even digital output. The produced signal can be
used to visualize the measured current in an ammeter, or stored in a data acquisition device
for further study, or may be used for control purposes. In this project, this sensor is used
for monitoring the power usage of the home appliances. Using this current sensor
ACS712 mostly has disadvantages that a current value is not linear in getting the sensor,
so sometimes need a linear higher level (Kurde A., Kulkarni V. S., 2016). This type of
current sensor has many variation type according to the 5A, 20A, 30A maximum standard.
16
The 5V VCC (Voltage Common Collector) is used by ACS712 (Kusriyanto M., Putra B.
D., 2016).

In this project, creator uses 5 Ampere current sensor (ACS712) which is a sensor
module for measuring the amount of current flowing through the terminal block using the
current chip sensor ACS712-5 that uses Hall Effect (Kusriyanto M., Putra B. D., 2016).
Broad maximum current that can be measured by 5A when the voltage at the output pin
varies linearly from 2.5 Volt (1/2 x VCC, power supply voltage VCC = 5V) for non-
current conditions up to +4.5V 5A or 0.5V at a current of -5A (positive/ negative polarity
dependent, value below 0.5V or above 4.5V may be considered more than the average).
Changes in voltage levels linearly associated with the current of 400 mV/ Ampere, with
the shape graph Vout to the current sensor are observed (Kusriyanto M., Putra B. D.,
2016).

Figure 14: Pinout Diagram and Pin Description of ACS712

17
2.5 HC-SR04 Ultrasonic Sensor

Figure 15: HC-SR04 Ultrasonic Sensor

The HC-SR04 ultrasonic sensor has a transmitter as well as a receiver (Asadullah


M., Ullah K., 2017). This sensor uses sonar and is capable of determining physical object
distance which is not easily influenced by sunlight. HC-SR04 has an outstanding range of
object detection from 2 cm to 400 cm (13 feet) with big accuracy (Asadullah M., Ullah
K., 2017). HC-SR04 measure the distance of the physical object by transmitting ultrasonic
sound, and then detect the wave of reflection.

Figure 16: Working Principle of Ultrasonic Sensor (Asadullah M., Ullah K., 2017).

As in the figure above, the ping is ultrasonic input waves that are transmitted at a
velocity of 340mls and Echo is reflected sensor data that is used to calculate the distance
(Asadullah M., Ullah K., 2017). Ultrasonic sensor is used in the proposed prototype to
18
detect motion or human body inside the area of the particular project such as home’s room.
This monitors the motion or human body detection distance from the top of the room
which is ceiling, and uses Wi-Fi module (ESP8266) technology to report on the Blynk
application. When there is no motion or human in the project’s area in certain time, the
system automatically switch off the electrical appliances.

2.6 Blynk Application

Figure 17: Blynk application an IoT Platform

Blynk is and internet-controlled platform with iOS and Android framework for
NodeMCU, Raspberry Pi and the like. It is a digital dashboard where it can build a
graphical user interface by simply dragging and dropping the widgets (Kamal M. M et al.,
2018). Blynk is another support system that is connected via Wi-Fi and ESP8266 modules
to the Internet. Blynk was designed to remotely control equipment, where data can be
displayed, data stored, and data motorized. Not only that, Blynk is not tied to some
specific board or shield (Kamal M. M et al., 2018).

2.6.1 Blynk Server

Blynk Server is a Java server based on Open Source Netty, responsible for
transmitting messages between the Blynk Mobile App and various microcontroller boards
19
such as NodeMCU, Arduino and Raspberry Pi (Kamal M. M et al., 2018). While Blynk
Cloud is Java-written program with simple TCP/ IP sockets and running on our serve. By
default Blynk iOS and Android apps connect to Blynk Server. For every Blynk user access
is secure. Only Java Runtime Environment is all we need to run Blynk Server.

20
CHAPTER 3
METHODOLOGY

The general structure and organization of the project will be addressed in this
section including the project’s guiding theory, work processes, and improvement. The
designed circuit will be based on a board to make testing and troubleshooting easier.
Improvement in programming consolidates NodeMCU coding of microcontroller unit,
that by interfacing to all components and also to the production of mobile applications to
show all the necessary model details. Hardware and software must function as an overall
system framework during the coordination stage.

In order to have a better understanding of how the project works, the project’s
goals, specifications and priorities are being researched before the project is discussed.
Next, the Gantt chart and milestone chart are completed to visualize how to proceed over
the specified two semester (about 8 months) time period.

After that, research papers and articles relating to the project are extensively
investigated. For future references relevant or valuable details shall be noted. The product
procurement process begins with the sensors and the necessary components being sorted
out and purchased with supervisor oversight to ensure that the components purchased are
within the university-allocated budget.

3.1 Design Methodology

The accompanying flowchart will delineate how the project will be performed,
as show in Figure.

21
Figure 18: Design Methodology Process Flow Chart.
22
Figure 19: Project Classification Units.

Preliminary research is done after verification of the project name to evaluate the
current remote controller systems and identify the problems before a more pragmatic
solution is proposed. More work will be carried out to find the most appropriate project
execution hardware and software. This project is then drawn up for the design of the
process and materials are purchased.

It is important to familiarize the programming language of Arduino IDE which is


C/C++. The next move is to get the system to wirelessly function using Wi-Fi Module
(ESP8266) and remote controller to power electrical devices through the mobile
application. Using the Blynk App, a basic graphical user interface is generated after the
hardware configuration is finalized. Once the device is found to be reliable, the
23
microcontroller (NodeMCU) used to monitor the actual electrical devices will be designed
into a more realistic configuration.

Mobile application Blynk Server

ACS712 Current Sensor


NodeMCU
HC-SR04
Ultrasonic Sensor

Relay Module Load/ Electrical

Appliance

Figure 20: Full System Design

24
3.2 Hardware Design

The prototype hardware is built in conjunction with the circuit diagrams designed
as shown in the figures below. The main components used to mount the prototype are the
NodeMCU ESP-12E, HC-SR04 ultrasonic sensor, the ACS712 Current Sensor, and the
5V single channel relay, lastly.

NodeMCU ESP12E HC-SR04 ACS712 5V single relay

Figure 21: Circuit diagram of the integration between ACS712 sensor & NodeMCU.

Figure 22: Circuit diagram of the integration between Ultrasonic sensor & NodeMCU.

25
Figure 23: Circuit diagram of the integration between Relay, Load & NodeMCU.

The modules are connected to the NodeMCU ESP12E based on the datasheet in
which the MCU pin number is set. The output pins are the relay, and the analogue pin for
feedback is the ultrasonic sensor and the current sensor.

3.3 Software Design

The Arduino Software was used as the software-hardware interface for this
project. The NodeMCU requires a system for the operation and execution of the proposed
design process. After writing the code at Arduino IDE, it is really easy to verify and
compile. The complete flowchart that gives the entire system process is shown in Figure.
This complete flowchart which shows the entire device process and is operated by a
mobile application (Blynk App). At the first place, the Wi-Fi hotspot connects to the
existing network infrastructure and initializes the open source server which is Blynk
Server, the ESP8266 chip will send signal to the client (operator) indicating the device is
online or offline and then tests the Input/ Output pins i.e. switch- 1,2, or 3. If the client
(operator) flips any of the switches or giving a motion to sensor, The Blynk Server will
26
receive the data and return user’s status by showing it on the “Value Display” in the
application. Not only that, the sensor data for calibrating the power consumption also will
be returned to the application by displaying on the “Gauge Display”. Finally, this cycle
is in continuous operation and the system returns (loop) to the initial condition.

Figure 24: Flowchart of the system.

27
3.3.1 Blynk Apps
First of all, the important to do for Blynk Apps is design the application in which
the developer can choose the widget for the application’s functions. Through these mobile
application the power consumption of electrical appliances will also be shown. There will
be “Gauge” to display the power consumption of the load (electrical appliance). Next, the
“Value Display” will display is there a motion or not in the home appliance’s area.
Besides, the clients can turn on or off the button for power up or off their home appliances.

Figure 25: Step to build Smart Remote Control System Via Blynk Apps.

28
3.4 Project Cost
Table 1: Project Cost
Build of Materials Material Cost (RM)
NodeMCU ESP12E Version 3 15.00
HC-SR04 Ultrasonic Sensor 3.00
ACS712 Current Sensor 9.00
5V Single Channel Relay 4.00
Bulb 2.00
Miscellaneous 10.00
Total Cost 43.00

3.5 Gantt Chart


Table 2: Gantt chart of the Final Year Project 1

Final Year Project 1

Operation

1 2 3 4 5 6 7 8 9 10 11 12

1 Selection of title

Structure Research and


2

Literature review

Concept drawing and system


3 architecture

Program NodeMCU and


4
Mobile application

5 Testing phase

29
Final Year Project I Milestones:

Selection of title completion : Week One


Structure research and literature review completion : Week Six
System architecture completion : Week Eight
NodeMCU and Blynk App completion : Week Ten
Testing phase completion : Final Week

Table 3: Gantt chart of the Final Year Project 2

FINAL YEAR PROJECT II

Week
No Details

1 2 3 4 5 6 7 8 9 10 11 12

1 Prototype Setup

Blynk Apps Interface


2
Integration

3 Results Analysis

4 Discussion

5 Conclusion

30
Final Year Project I Milestones:

Prototype setup :Week One


Blynk apps interface integration :Week Three
Result analysis :Week Seven
Discussion :Week Eleven
Conclusion :Final week

31
CHAPTER 4

RESULTS AND DISCUSSION

The findings obtained from testing the evolved prototype will be discussed in this
chapter. The prototype testing is conducted to prove the prototype’s functionality
fulfilling all the necessary requirements. The prototype circuit was assembled as described
in the chapter preceding. The source code that has been created is uploaded to the
NodeMCU which a microcontroller unit that embedded with ESP8266 (Wi-Fi Module) to
allow prototype testing. Following testing of the built prototype the following results are
obtained.

4.1 Prototype Setup

For the prototype setup, smartphone portable Wi-Fi hotspot was used as wireless
connection or router to connect client (Blynk Apps) and server (Blynk Server). Serial
monitor in Arduino IDE on PC was used to monitor the output of the NodeMCU which
are power consumption value and human body detection (motion or object distance).

Since the NodeMCU works on 5 Volts, single channel 5V relay module is used to
let control of the electrical appliance with bigger voltage ratings. In this prototype setup,
the electrical appliance which is a light bulb that operates on 5 Volts, thus an external
power source is used as a 5 Volts AC to DC adapter.

Figure 26: Complete Circuit of Smart Remote Controller System (SRCS) prototype.

32
4.2 Operation of the System

After setting up the prototype, developer needs to set up the mobile application
which is Blynk Apps. Setting up the Wi-Fi connection between NodeMCU and Blynk
Apps is must at the first place. Below is the common steps for connecting between
NodeMCU and Blynk Apps.

1. Firstly, connect the NodeMCu to the PC and launch the Arduino IDE.
2. Download from www.blynk.cc the Blynk libraries, and link the libraries to the
Arduino IDE.
3. Then go to “Examples” in the “File” option to setting up the serial boards which
is NodeMCU Serial USB.
4. After the example has been selected the sample code will appear.
5. There is to make some changes in this case, so developer need to log in to the
Blynk app using the Android or iOS app for this.
6. Create a new project after logging in and pick the type of development board
which is NodeMCU.
7. After that developer will obtained an authentication key, pick this authentication
key and paste it under the authentication token in the example sketch in Arduino
IDE.
8. Then, press Compile and Upload button after previous move to burn it into
NodeMCU. The sample sketch is successfully loaded after receiving “Done
Uploading”, it means successfully loaded and script should be executed that is
located in Arduino folder libraries-blynk-scripts.
9. The file name is “blynk-ser.bat” and then run it as an administrator at Command
Prompt on Search tab in order to run the script. When command prompt is opened,
type “cd” and the path name of the script file, then followed by inserting “blynk-
ser.bat –c COM4” where the COM is a port where NodeMCU is connected.
10. Make changes according to developer’s configuration, the NodeMCU connects to
the Blynk Server over the USB cable without any shields once this script is up and
running. Without much hardware, this is the easiest way to make the device go
online.

33
11. Here, the developer will attach the ultrasonic sensor and ACS712 that are
discussed in the discussion before. Assuming the developer must attach it to pin
A0 and other digital pin in the same way as the one mentioned in previous session.
12. Now on the application, the created project, click the on the icon of the widget box
that is a circle plus sign.
13. Then select the gauge, button and notification icon and it will appear on the
workspace region of Blynk. Tap on the icon in the workspace and pick pin analog
A0 or other digital pin to read the output such as frequency A0 in order to make
these icons work.
14. After complete setting up the icon, press the “Play” button on the application to
execute the command.
15. The NodeMCU and Blynk Apps have established connection and at the same time,
the gauge shows the value of ACS712 sensor.
16. Lastly, press “Stop” button to stop the operation of the system.

At the same time, the output of the NodeMCU can be seen in serial monitor on the
Arduino IDE software. The figure below delineate the output of connection setup and
both sensor data.

Figure 27: Serial monitor showing the output from NodeMCU.

34
The Figure below shows the Smart Remote Controller System (SRCS) application
on Blynk Apps.

Figure 28: The SRCS application interface.

35
Figure 29: Successfully notify the client.

36
CHAPTER 5

CONCLUSIONS AND RECOMMMENDATIONS

The development of the smart remote control system implemented successfully.


Using the smartphone mobile application (Blynk Apps) which is an Internet of Things
(IoT) platform, NodeMCU was linked via wireless network or Wi-Fi connection, enabling
control of the home model appliances.

To order to make the smart remote control system even better, sensor technology
such as heat sensors and better human presence detection sensors have been integrated
with the system for potential upgrades. For example, if occupants enter a room, motion
detectors will turn automatically on the air conditioner and turn off after being abandoned
by the inhabitants, not only that, it also can enables the air conditioner to automatically
set its temperature based on room temperature or current weather. There will be a lot of
saves in energy consumption for the user.

Remote access to Internet which using Wi-Fi Module (ESP8266) is one of the
most convenient features to be used in control systems for electrical appliances. This will
allow users from anywhere and anytime to access and track the home system. The Wi-Fi
Module application has been successfully tested by different manufacturers on a multitude
of different mobile phones, their portability and compatibility are thus proven.

When this project is completed, it is expected that a low-cost, friendly to use and
accessible home appliance remote control platform will be available for all.

37
REFERENCE

Agrawal, N., & Singhal, S. (2015). Smart drip irrigation system using raspberry pi and
arduino. International Conference on Computing, Communication and Automation,
ICCCA 2015, 928–932. https://doi.org/10.1109/CCAA.2015.7148526
Al-Hassan, E., Shareef, H., Islam, M. M., Wahyudie, A., & Abdrabou, A. A. (2018).
Improved smart power socket for monitoring and controlling electrical home
appliances. IEEE Access, 6(September), 49292–49305.
https://doi.org/10.1109/ACCESS.2018.2868788
Anandakumar, M. (2017). Smart Home Energy Saving System using IOT. 2(5), 102–
108.
Asadullah, M., & Raza, A. (2016). An overview of home automation systems. 2016 2nd
International Conference on Robotics and Artificial Intelligence, ICRAI 2016, 27–
31. https://doi.org/10.1109/ICRAI.2016.7791223
Asadullah, M., Ullah, K. (2017). Smart Home Automation System Using Bluetooth
Technology.
Basri, N. A., Ramli, A. T., & Aliyu, A. S. (2015). Malaysia energy strategy towards
sustainability: A panoramic overview of the benefits and challenges. Renewable
and Sustainable Energy Reviews, 42, 1094–1105.
https://doi.org/10.1016/j.rser.2014.10.056
Chassiakos, A., Aghnatios, W., Ary, J., Sciortino, A., By, A., & Kumar, B. S. (2016).
Home Automation Via Bluetooth Using the Arduino Uno Microcontroller.
(December).
Davide Chiaroni, Vittorio Chiesa, Simone Franzò, Federico Frattini & Vito Manfredi
Latilla (2017) The impact of the electricity tariff reform on renewable energies and
energy efficiency investments: The case of the Italian residential market,
International Journal of Green Energy, 14:11, 889-898, DOI:
10.1080/15435075.2017.1336715
Devekar, N. (2018). Polyhouse Automation using IoT & Image Processing. 5(7), 38–41.
Grokhotkov, I. (2020). ESP8266 Arduino Core Documentation.
Hassan, J. S., Zin, R. M., Majid, M. Z. A., Balubaid, S., & Hainin, M. R. (2014).
Building energy consumption in Malaysia: An overview. Jurnal Teknologi, 70(7),
33–38. https://doi.org/10.11113/jt.v70.3574
Jain, S., Vaibhav, A., & Goyal, L. (2014). Raspberry Pi based interactive home
automation system through E-mail. ICROIT 2014 - Proceedings of the 2014
International Conference on Reliability, Optimization and Information Technology,
(2002), 277–280. https://doi.org/10.1109/ICROIT.2014.6798330

38
Jaafar, L., (2014). Automatic Room Temperature Control. Master Thesis, universiti Tun
hussein Onn Malaysia.
Kamal, M. M., Noar, N. A. Z. M., Sabri, A. M. (2018). Development of Detection and
Flood Monitoring Via Blynk Apps. Indonesian Journal of Electrical Engineering
and Computer Science. Vol.10, No.1, 361-370.
Kumar, S. (2014). Ubiquitous Smart Home System Using Android Application.
International Journal of Computer Networks & Communications, 6(1), 33–43.
https://doi.org/10.5121/ijcnc.2014.6103
Kurde, A., Kulkarni, V. S. (2016). IOT Based Smart Power Metering. International
Journal of Scientific and Research Publications.Volume 6, Issue 9, 411-415.
Kusriyanto, M., Putra, B. D. (2016). Smart Home Using Local Area Network (LAN)
Based Arduino Mega 2560.
Modi, M., Karthikeyan, K., Nizam, M. (2016). Home Automation Using Internet of
Things.
Nagy, Z., Yong, F. Y., Frei, M., & Schlueter, A. (2015). Occupant centered lighting
control for comfort and energy efficient building operation. Energy and Buildings,
94, 100–108. https://doi.org/10.1016/j.enbuild.2015.02.053
Rahman, K. A., Leman, A. M., Mubin, M. F., Yusof, M. Z. M., Hariri, A., & Salleh, M.
N. M. (2017). Energy Consumption Analysis Based on Energy Efficiency
Approach. Faculty of Mechanical & Manufacturing Engineering, Universiti Tun
Hussein Onn Malaysia, 02003.
Ransing, R. S., & Rajput, M. (2015). Smart home for elderly care, based on wireless
sensor network. 2015 International Conference on Nascent Technologies in the
Engineering Field, ICNTE 2015 - Proceedings, 1–5.
https://doi.org/10.1109/ICNTE.2015.7029932
Rathnayake, K. A. S. V., Diddeniya, S. I. A. P., Wanniarachchi, W. K. I. L.,
Nanayakkara, W. H. K. P., & Gunasinghe, H. N. (2017). Voice operated home
automation system based on Kinect sensor. 2016 IEEE International Conference
on Information and Automation for Sustainability: Interoperable Sustainable Smart
Systems for Next Generation, ICIAfS 2016, 1–5.
https://doi.org/10.1109/ICIAFS.2016.7946530
Skraba, A., Kolozvari, A., Kofjac, D., Stojanovic, R., Stanovov, V., Semenkin, E.
(2016). Streaming Pulse Data to the Cloud with Bluetooth LE or NodeMCU
ESP8266. 5th Mediterranean Conference on Embedded Computing. 428-431.
Qiang, T., Guangling, G., Hai, L., Lina, C., Han, Wang. (2018). Nodemcu-based Low-
cost Smart Home Node Design. IOP Conference Series: Materials Science and
Engineering. Vol.435.

39
APPENDICES

Appendix I: Code of the Project

40
41
42

You might also like