A Smart Switch Control System Using ESP8266 Wi-Fi Module Integrated With An Android Application

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

2019 the 7th International Conference on Smart Energy Grid Engineering

A Smart Switch Control System Using ESP8266 Wi-Fi Module Integrated with an
Android Application

S. P. Makhanya, E. M. Dogo, N. I. Nwulu, U. Damisa


Dept. Electrical and Electronic Engineering Science
University of Johannesburg
South Africa
e-mail: 201423502@student.uj.ac.za, eustaced@uj.ac.za, nnwulu@uj.ac.za, uyikumhe@yahoo.com

Abstract—There is an increase in demand for low-cost Smart and an IR-emitter. It allowed users to plug devices into the
Switch Control Systems (SSCS) that can remotely control smart plug and remotely switch power on/off and retrieve
home switches or devices in residential environments using information of the device‟s power consumption and ambient
mobile applications or websites. In this paper, an SSCS which temperature. Furthermore, it allowed users to control the
uses open source software, and can be configured without any nearby devices using the integrated IR-emitter. The system
physical adjustment to the environment, is developed to allowed two types of connections: A Wi-Fi Ad-Hoc mode
automatically minimize energy consumption. The device and a router in Wi-Fi infrastructure mode. The smart plug
comprises two parts: An Android application and a unit made included intelligent and information-oriented features such as
up of a programmable Arduino board, ESP8266 Wi-Fi module,
control function, communication function, timing function
wall socket and an SD card. In the SSCS, the Android
among others.
application is used to remotely control switches using the Wi-Fi
technology. Tests carried out on the system proved its A review of other similar works [3]-[6] shows that some
effectiveness and quick response to signals. proposed SSCS have limitations like limited operating
ranges, unnecessary complexity, and so on. Hence the
Keywords-smart switch control system (SSCS); ESP8266 wi- integration of the Internet of Thing (IoT) and SSCS is a
fi module; arduino; android application perfect proposition for a reliable, easy-to-operate SSCS
solution. An SSCS that uses open source software is
I. INTRODUCTION therefore developed so that a user can control their home
A Smart Switch Control System (SSCS) can be defined switches wirelessly from a remote location to curb
as a networked system consisting of electrical outlets, lights, excessive/unnecessary power consumption.
heating and cooling systems that can be controlled remotely The rest of this paper is organized thus: In Section II, the
[1]. The advent of Industry 4.0 and the increasing demand design of the proposed SSCS is presented. The Section is
for automation have necessitated the need for effective divided into two parts - the first for the hardware and the
systems for monitoring and control of household energy second for the software of the SSCS. Section III details the
consumption in a bid to minimize energy losses [2], [3]. test, results and discussion. Section IV presents the
There are numerous SSCS that have been developed as a conclusion and a recommendation for future advancement of
subset of Home Automation Systems (HASs), utilizing the work.
different technologies like Bluetooth, Infrared, GSM etc. [4].
II. SYSTEM DESIGN
In [5], the authors developed a home automation system
that integrates Wi-Fi with an android mobile application. In A. Hardware Design
essence, this system uses an Android application installed on The hardware components of the proposed SSCS are an
a mobile device to communicate with a home automation Arduino UNO board, an ESP8266 Wi-Fi module, wall
system using long range Wi-Fi technology. The application sockets, AC/DC power supply, Level Logic Converter (LLC)
is used to send commands to turn ON/OFF electrical and an SD card. The Android mobile application which can
equipment such as home appliances etc. The system uses a run on a smartphone, tablet or an android compatible
simple GUI application which allows the user to monitor the computer is a Graphical User Interface (GUI) that accepts
results from an Android mobile application virtually commands from the user. The commands are sent to the
anywhere. In addition, from a security perspective, they controlling unit (Arduino UNO) of the smart device via Wi-
provided access codes for the Wi-Fi, thus their system helped Fi communication. The Arduino UNO is an embedded
users to minimize human controls whilst providing a secure microcontroller which acts as the brain of the system. It
home automation system. processes all the commands received and sends them to the
In [6], the authors designed a Smart Home System Based relay board which performs the switching task. The system
on a Wi-Fi Smart Plug. Their objective was to develop a low has four AC socket outlets, each of which is controlled by a
cost and flexible solution to control and monitor home relay. Figure 1 shows the detailed block diagram of the
appliances using Smart Plug devices. The system integrated
components such as the temperature sensors, current sensor

978-1-7281-2440-7/19/$31.00 ©2019 IEEE 125


components of the hardware unit. Figures 2 and 3 are the
interior and exterior of the SSCS device respectively.

Figure 1. Detailed block diagram of the SSCS hardware unit.

Figure 4. Activity diagram of the Android application.

Figure 2. Interior of the SSCS prototype.

Figure 5. Developed Android application login page.

Figure 3. Exterior of the SSCS prototype.

B. Software Design
The GUI of the developed Android application is shown
below. It has a page for login or creation of account and
other pages for control of switches, viewing of switch status
and addition of switches. The application accesses data from
the SD card to verify the credentials entered on the login
page. Figure 4 is the activity diagram of the android
application. Figures 5 and 6 are snapshots of the login and
control pages respectively. Figure 6. Developed Android application control page.

126
III. TESTS, RESULTS AND DISCUSSIONS switch number while the y-axes are for the average response
The system was set-up as follows: the ESP8266 Wi-Fi times. Note that on the x-axes, Switch 5 represents all the
switches (ALL). There were no significant differences
module was configured, and its firmware was set-up using
between the time responses of the switches, with the
the ESP8266 Download Tool V3.6.4 and made ready to difference being in milliseconds (ms) which was probably
respond to AT commands. A serial monitor of the Arduino due to human errors while starting and stopping the timer.
IDE was used to type in the commands, such as AT,
AT+GMR etc. Note that all AT commands were entered in
capital letters. AT was sent and the ESP8266 responded with
„OK‟ to show that the AT commands are set and ready to be
used. Furthermore, AT+GMR was sent and the ESP8266
responded with the AT version, SDK version and compile
mode. Several other AT commands were sent as can be seen
in Figure 7.

Figure 8. Plot of the switch time response test for turning off the switches.

Figure 9. Plot of the switch time response test for turning on the switches.

A survey was carried out to determine user satisfaction


by users of the developed SSCS. The Android application
and the smart unit were given to six users (two students from
each of the Engineering, Accounting and Psychology
Figure 7. ESP8266 Download Tool V3.6.4 displaying results. Departments), and their operation was thoroughly explained.
Table I details the survey questions and codes, and Table II
To ascertain successful communication between the details the responses of the respondents. Figure 10 is a bar
mobile application and the ESP8266 Wi-Fi module, the chart of the ratings obtained.
serial monitor of the Arduino IDE was used to view the
actions between the NodeMCU-App and the ESP8266, TABLE I. SURVEY RATING CODES
where the NodeMCU-App Arduino code was run on the Code Question
Arduino IDE and its Android code was run on Android RC1 Is the device easy to use
studio while a compatible mobile phone was connected. An
IP address was inserted in the NodeMCU-App and an LED RC2 Is the aesthetics of the smart unit pleasing
was turned ON/OFF. This proved that there was RC3 Is the GUI of the android application aesthetically pleasing?
communication between the NodeMCU-App and the RC4 Is the overall performance of the system satisfactory?
ESP8266 which was through commands sent via HTTP. In
RC5 Will you recommend this device to other users?
addition, the LED turned on wirelessly from the commands
sent from the NodeMCU-App via Wi-Fi, and this code was
integrated with the main code of the Android application and TABLE II. RESPONSE OF SURVEY RESPONDENTS
the Arduino. User RC1 RC2 RC3 RC4 RC5
Figures 8 and 9 depict the plots of the average time
1 Yes Yes Yes Yes Yes
responses of the switches to ON and OFF signals. Each
switch was individually turned on four times, and then 2 Partially Yes Yes Yes Yes
Yes
turned off four times. The x-axes of the plots represent the

127
3 Yes Yes Partially Yes Yes 2. A Wi-Fi module which facilitated the connection and
Yes
communication between the mobile application and the
4 Maybe Partially Yes Partially Partially actual device.
Yes Yes Yes
5 Yes Yes Partially Partially Partially
3. A programmable board/microcontroller which acted as
Yes Yes Yes the brain of the system and executed key functions.
6 Yes Yes Yes Yes Yes 4. An internal security system which protected the device
from unauthorized users.
It was noted that, the users understood how the SSCS Finally, a survey was conducted on users of the system
works and that most users rated „yes‟ for ease of use and who were generally satisfied with its performance and
overall performance of the system. indicated that they will recommend it to other users.
The proposed SSCS may be improved by incorporating a
system that can intelligently respond to demand response
signals without jeopardizing customer satisfaction.
REFERENCES
[1] P Waghmare, M Chandgude, P Chaure and A Chaudhari "Survey on:
Home Automation Systems," International Conference on Trends in
Electronics and Informatics (ICEI), Tiruneveli, India, IEEE, 11-12
May 2017, pp. 7-10, DOI: 10.1109/ICOEI.2017.8300864
[2] M Xu, JM David and SH Kim, “The Fourth Industrial Revolution:
Opportunities and Challenges,” International Journal of Financial
Research, Vol. 9 No. 2, 2018, pp. 90-
95,https://EconPapers.repec.org/RePEc:jfr:ijfr11:v:9:y:2018:i:2:p:90-
95
[3] A Shinde, S Kanade, N Jugale, A Gurav, RA Vatti and MM
Patwardhan "Smart Home Automation System using IR, Bluetooth,
Figure 10. Users rating for the SSCS. GSM and Android," In 2017 Fourth International Conference on
Image Information Processing (ICIIP), Shrimla, India, IEEE, 21-23
IV. CONCLUSION Dec 2017, pp. 1-6. DOI: 10.1109/ICIIP.2017.8313770
[4] ION, Design and implementation of a Wi-Fi Based automation
The key objectives of this work were to research, design, Syestm, March 2017, Available: http://designlike.com/design-and-
implement and evaluate a Smart Switch Control System implementation-of-a-wifi-Based-home-automation-syestm/.
(SSCS) using Wi-Fi technology, and evaluate the system in Referenced on 19 March 2019.
terms of its accuracy and time to control switches. To [5] JA Dandge, R. Shirwadkar, P Gite, N Odhekar and C Kakad,
achieve this, the following key components were delivered: “Electric Switch On/Off System Using Android App Via Wi-Fi”,
1. An Android mobile application was developed to International Research Journal of Engineering and Technology
(IRJET), Vol 03, March 2016.
control an Arduino UNO board.
[6] L Wang, D Peng and T Zhang, “Design of Smart Home System
Based on WiFi Smart Plug”, International Journal of Smart Home,
Vol. 9, No. 6, 2015, pp. 173-182.

128

You might also like