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

International Journal of Pure and Applied Mathematics

Volume 115 No. 8 2017, 565-570


ISSN: 1311-8080 (printed version); ISSN: 1314-3395 (on-line version)
url: http://www.ijpam.eu
Special Issue
ijpam.eu

IOT BASED SMART CHARGER: AN ESP8266 BASED AUTOMATIC CHARGER

1
Navjeet Kumar, 2Dorathy R, 3ShruthiM, 4Dr. Anusuya S
1
Department of Computer Science and Engineering, Saveetha School of Engineering
2
Final Year Student, Saveetha School of Engineering
3
Final Year Student, Saveetha School of Engineering
4
Head of the Department, Saveetha School of Engineering
12,3,4
Saveetha University
1
tonunavjeet@gmail.com, dorathyraja89@gmail.com, 3Imshruthi1997@gmail.com,
2
4
anusuya@saveetha.com

Abstract: The internet of things has many applications; like ESP8266, Particle Photon, and other Arduino
one of those is Smart Power Monitoring and Control based Wi-Fi modules.
Systems. Energy efficient devices can be designed in
IoT, which can reduce both, the power consumption 2. Literature Survey
and the human effort required to do so. This work has
been designed in to implement a smart charging system IoT is widespread and popular nowadays, is prevalent
that automatically controls its behaviour using the in research, the design includes Wi-Fi module, power
webserver and the phone which is being charged. The supply and remote-control plug [1]. The remote-control
device being used is a ESP8266, the Webserver which plug is a part of the IoT which connects the mobile
will be stored on the ESP8266 module acts as the IoT phone to other appliances and can be controlled from
platform. As the webserver is platform independent, it any place at any-time. The design used in this research
can be used on any device, like mobiles and laptops, has remote plug along with the Wi-Fi and power supply
these devices relay commands, and in turn the web module. The control strategy is depicted with the help
server toggles the charger through the ESP8266 of the comfortable design which consists of the 220V –
module. This project helps in automatic monitoring of Input and 5V, 6W – Output power supply. This
the device and sends notifications to the phone, which research design contains the STC 15L 204EA as the
is necessary if we want to reduce both the energy and core control chip to manage the device’s electrical relay
time needed to maintain said devices. This system functions and the control signals are transmitted in two
would be capable of turning on and off only when the diverged paths during the connection establishment.
device is connected and charge only when needed, and Also, the mobile phone can control the plug through
can be further improved to monitor other appliances. remote access by means of TCP port in the same Wi-Fi
There are various modules available, which when environment.This work gives an overview of
paired up with the charging circuit will turn the charger functionality of the ESP8266 Wi-Fi module.
into an IoT based device, like ESP8266, Particle Putta Sindhuja and Balamurugan [2] has
Photon, and other Arduino based modules, but projected a home automation system in which the user
ESP8266 is the most cost effective and also has low can be able to control and monitor appliances with the
power consumption. help of the IoT to minimize the energy usage. The
appliances are connected via an Ethernet to a router and
Keywords: IOT, ESP8266, ESP8266 Webserver, uses m-bed microcontroller and sensor-actuator units to
Smart Charger. control the power utilization. The designed system
enables client to monitor and control the appliances at
1. Introduction home from anywhere availing the IoT features of the
designed system thereby reducing the wastage of
A device that could monitor the power consumption energy.The interesting part of the hardware for this
and control it, will help vastly in reducing the wastage system comprises of the Hall effect sensor, Ethernet
of energy. This system would be capable of turning on break outboard, Appliances such as 10W bulb – 12V
and off only when the device is connected and charge fan, two channel relay, m-bed microcontroller – LPC
only when needed, and can be further improved to 1768 and Ethernet modem. The Relay needs 12v power
monitor other appliances. There are various modules supply, groove Electricity Sensor is employed to
available, which when paired up with the charging measure the energy consumption in each appliance.
circuit will turn the charger into an IoT based device, Xively is software which enables the cloud data storage
and its used to analyse the usage.This work gives the

565
International Journal of Pure and Applied Mathematics Special Issue

direction to be followed while designing systems that


analyse the power consumption of devices. A. Hardware Requirements
Krupal Kachhia Patel et. al. [3] proposes a
system that implements MQTT (Message Queuing i.) ESP8266 Wi-fi module(as webserver and
Telemetry Transport) and TCP in ESP8266 Wi-Fi controller).
module to control appliances and interfaces them with
proximity, PIR sensors. In his paper, they have ESP8266 is a low power, highly efficient Wi-Fi
described the architecture and implementation of home module that can run on just 3.3v. Its open source and
automation system. To reduce the development cost, can be programmed with Arduino Uno. The ESP8266
this system utilizes the electronic boards. Apart from module contains stack for HTML, JAVASCRIPT,
the low cost, the smartness of the automation system XML, CSS, etc. and supports implementation of
can be justified with the automation scripts that can be various API’s. ESP8266 can also be used to store
customized by the user, even at runtime. The complete cookies and for authentication process. With ESP8266
system efficiently utilizes the existing network local Webservers can readily be created and remote
infrastructure with the help of MQTT protocol and TCP implementation can be done by port forwarding using
protocol.This work helps understanding how the router’s static IP.
ESP8266 can be interfaces with appliances, and ii.) Arduino Uno(as a FDTI board).
automation of appliances.
The four-tier architecture is proposed in this The Arduino Uno board is used here as a FDTI
system applied using smart parking, votlDB, vehicle board in order to program the ESP8266 module.
data sets, spark and storm for real time processing
which has the Hadoop framework to make it more iii.) MB102 (as a power supply module i.e. voltage
scalable and efficient [4]. The execution of architecture regulator).
has the process of decision making, filtration, pre-
MB102 is a basic charging circuit is required, that
processing, aggregation, computing, collection and
supports all android devices. The charger should have
classification. In this proposed research,the
3.3V and 5.0 V, a current output less than 750mAh.
implementation is carried out by means of Hadoop with
This device will distribute the input into the ESP8266
Storm or S4, Spark, voltDB to process the real-time IoT
module and the phone, separately. The input to the
data and produce results. The analysis with Hadoop
charging module can be 12V or 5V from an external
with MapReduce programming is done for future
supply.
developments and further enhancements. This work
The power supply module has built-in overload
gives an overview on creating scalable power
protection and voltage regulators, so that makes the
monitoring systems.
smart charger safe to use.
Mohammad Abdur Razzaque et. al [5]
iv.) IRF540 MOSFET (as a switch).
proposed in, a Middleware technology for an ultra large
scale internet of things, a system for connecting IRF540 is used as a switch in this system, it has the
heterogeneous devices like smartphones, TVs, etc. to voltage rating of 100V and current rating of 30A, so it
IoT with an event based, service based and VM based can be used with mobiles and laptops interchangeably,
middleware technologies, as it will save traffic and which is not possible with relays.
power consumption in IoT devices. The final results
portray that the improvement in the entity inter- B. Software Requirements
connectivity issues and the reduction in the energy
costs of the industrial management systems.This works i.) Arduino nightly IDE.
shows the need for middleware in IoT devices.
Arduino nightly is used here in order to flash
Manar Jaradata et. al. [6] have proposed a system
firmware onto the ESP8266 module. Here we will also
which comprises of an IoT based energy management
need the ESP8266 libraries and board installed on it.
platform that runs a DR algorithm to manage the
industrial based tasks. The authors focus on the future ii.) ESP8266 Webserver
of the Internet of Things and smart grid related
applications. They also exploit the various applications The ESP8266 module and its variants are all
of the smart power grid domain networks in the equipped with and support HTML5, JAVA SCRIPT,
different aspects of sensor networks. The meters and Figure 1. System Architecture
sensors for these applications also were discussed with
the help of the techniques in the Big Data.This work PHP, AJAX, etc. Simple webservers can be created on
shows the need for monitoring of energy consumption the ESP8266 module and can be used locally or
in appliances of all scales, small or large. remotely.

3. System Architecture iii.) HTML5 API

566
International Journal of Pure and Applied Mathematics Special Issue

Using the HTML5 API for battery, which is This system will work with a charging circuit
supported on almost all devices, we can interface with and be controlled through the ESP8266 controller,
the device directly and send alerts through the which in turn will be monitored by the mobile which is
webserver to the ESP8266 module. being charged currently. This system can be
implemented easily with any charger and any
i.) There are various modules available, which when smartphone.
paired up with the charging circuit will turn the The power supply going through the charger
charger into an IoT based device, ESP8266 is the degrades a little, due to the voltage regulator’s
most cost effective, has the least power efficiency, but overall, the voltage and current remains
consumption, and the widest operating temperature. constant. In order to avoid degradation of the current,
ii.) The module is controlled through the ESP8266 while charging phones, a secondary supply can be
webserver. The ESP8266 module is equipped with utilized, like in the case of charging laptops. By doing
and support HTML5, JAVA SCRIPT, PHP, AJAX, so, the powers supply going to the device remains the
etc. Simple webservers can be created on the same as the actual charging device’s.
ESP8266 module and can be used locally or The same circuit can be used for charging laptops,
remotely. by just replacing the USB ports with their respective
iii.) The task of charging is controlled by the device charging pins.
which is being charged i.e. the device that has been There are two methods of execution, automatic and
plugged in to the charger. It can also be handled assisted mode. The first method is completely
through the IoT web platform i.e. the web server. automated and doesn’t need user intervention, it’s
essentially plug and play. The second method is based
on timers and takes the timer value in minutes, which
USB female will automatically start once time limit is set and stop
once the time limit is reached.
Switch
led ESP8266 A.) Method 1: Automatic Mode
• CHARGE_STATUS: The mobile phone will
MB102 consist of a preloaded application which will be
Gnd able to monitor the battery status.
• POST: The CHARGE_STATUS will send a
notification to the ESP8266 module when the
Gnd Source CH_PD
CHARGE_STATUS returns 100% or any specified
Vcc threshold.
Drain Gate GPIO2 • DEEPSLEEP: This will be invoked and the module
will switch off and the charger will stop charging
USB micro B the mobile.
Figure 2. Circuit Diagram Pseudocode:
4. Proposed System
//on the client side
Begin
POST(BATTERY_STATUS);
If(BATTERY_STATUS==100)
//send interrupt to ESP8266 with POST
CHARGE_STATUS ();
End

//on the ESP8266


Begin
If(BATTERY_STATUS==100)
// charger control pin shuts OFF
GPIO2=” FALSE”;
Figure 3. Alternate circuit design RST=” TRUE”;
Else
The proposed system works differently from the // charger control pin turns ON
existing system in various aspects like, its operation can GPIO2=” TRUE”;
be completely automated and free from user End
interaction.

567
International Journal of Pure and Applied Mathematics Special Issue

In this mode of execution, if the charger gets uses HTML5, JAVASCRIPT, CSS, etc. in order to
communicate with the client.
When the user enters the IP address of the
ESP8266 module, into the web browser in case of
Laptops and, into the Evothings Viewer in case of
mobile phones, for optimum performance.
Then the client is taken to the login page and
the clients enters the username and password, which is
admin and admin respectively. In this page the cookies
are stored, so the client has to login only once.
The next page is the main part of the system which
helps in automating the whole system. The server
receives the charge value i.e. the percentage, from the
client and sends it to the user at regular intervals.
Screenshot 1- login page
unplugged and plugged-in again, the process resumes i.) The user can control the charger using the
as is, because the process is dependent only on the automated method or the assisted method.
CHARGE_STATUS. ii.) User is supposed to enter the timer value in assisted
mode, in the form.
B.) Method 2: Assist Mode iii.) The timer value is sent to the server, and the
embedded code runs accordingly.
• TIMER_VALUE: The user assigns the time till the iv.) After the time is up the charger stops charging
phone will get charged, regardless of the automatically.
CHARGE_STATUS. v.) In automated mode, the user doesn’t have to do
anything the server automatically receives the
• POST: The TIMER_VALUE is entered it will be
batter y level and performs according to the pre-set
sent to the ESP8266 module and charging will
MAX and MIN charge ranges.
commence.
vi.) If the charge level reaches the MAX level, them the
• HANDLE_TIME: The ESP8266 starts the timer,
charger switches off and after some time when the
when the time is over the charger is switched off.
device discharges and reaches the MIN level it
Pseudocode: automatically turns on the charger /and charging
commences.
//on the client side
Begin Client Module
POST(TIMER_VALUE); In this system, the client module works on the web
//send interrupt to ESP8266 with POST browser or the Evothings viewer. The client enters the
SET_TIMER ();
End

//on the ESP8266


Begin
If (TIMER_VALUE>0)
{// in minutes
DELAY(TIMER_VALUE*60*1000);
// charger control pin shuts OFF
GPIO2=” FALSE”;
RST=” TRUE”;
}
Else
// charger control pin turns ON
GPIO2=” TRUE”;
End

Server Module

In this system, the server is the ESP8266 module which Screenshot 2- main page
hold the code for the webserver, which is used to username and password for the first-time access and
control the ESP8266 using the embedded code, which after a successful login attempt once, all the other
also resides in the ESP8266 module. The webserver

568
International Journal of Pure and Applied Mathematics Special Issue

logins are automatic, as cookies are being stored. The


client side utilizes the Battery API which is a part of the [1] Yu Ping Zhang, Tao Liu, Zhong Xiao Yang, Yi
HTML5 API’s. the battery API has various functions Mou, Yu Hua Wei, Dong Chen. “Design of Remote
like BATTERY LEVEL, CHARGING STATUS, etc. Control Plug”, IEEE International Conference Applied
which are accessed using DOM. Superconductivity and Electromagnetic Devices,2015.
The client side scripts use event listeners, which pass [2] Putta Sindhuja and M.S. Balamurugan, “Smart
values to server i.e. POST the values using forms. Power Monitoring and Control System through Internet
POST occurs on the following events of things using Cloud Data Storage”, Indian Journal of
i.) When the BATTERY LEVEL changes. Science and Technology,8(19), 76698, 2015.
ii.) When the CHARGING STATUS changes. [3] Krupal Kachhia Patel1, Jignesh Patoliya and
Hitesh Patel, “Low Cost Home Automation with
ESP8266 and Lightweight protocol MQTT”,
Transactions on Engineering and Sciences, 3(6), 2015.
[4] M. Mazhar Rathore, Awais Ahmad, Anand Paul
and Seungmin Rho, “Urban planning and building
smart cities based on the Internet of Things using Big
Data analytics”, Computer Networks 101, 2016.
[5] Mohammad Abdur Razzaque, Marija Milojevic-
Jevric, Andrei Palade, and Siobhán Clarke
“Middleware for Internet of Things: A Survey”, IEEE
internet of things journal, 3(1), 2016.
[6] Manar Jaradata, Moath Jarraha,c, Abdelkader
Bousselhamb, Yaser Jararweha, Mahmoud Al-Ayyoub
,“The Internet of Energy: Smart Sensor Networks and
Big Data Management for Smart Grid”, The
Internationa l Workshop on Networking Algorithms
and Technologies for IoT, 2015.
[7] Manan Mehta, “A breakthrough in wireless sensor
networks and internet of things”, International Journal
Screenshot 3- profile customization of Electronics and Communication Engineering &
iii.) When the main page is opened. Technology, 6(8), 2015.
[8] Vítor Monteiro, João C. Ferreira, João L. Afonso,
The POST operation is used to pass the parameters like,
“Smart Platform towards Batteries Analysis Based on
i.) MAX charge limit. Internet-of-Things”, Conference on Electronics,
ii.) MIN charge limit. Telecommunications and Computers, 2013.
iii.) Current BATERRY LEVEL in automated mode. [9] Jalpa Shaha, Biswajit Mishraa,” Customized IoT
iv.) TIMER VALUE in the assisted mode. enabled Wireless Sensing and Monitoring Platform for
Smart Buildings”, 3rd International Conference on
Setting the MAX and MIN is optional as a default is Innovations in Automation and Mechatronics
already set. MAX by default is 100% and MIN is 50%. Engineering, ICIAME 2016.
The client can connect to the IOT Based Smart Charger [10] P. Fang, Y. F. Liu, and P. C. Sen, “A flicker-free
using WI-FI directly, or by connecting the Smart single-stage offline LED driver with high power
Charger to a router through port forwarding and then factor”, IEEE Journal of Emerging and Selected Topics
connecting the phone to that network or even the in Power Electronics, 3(3): 654-655, 2015.
internet. [11] M. Kim, and S. Choi, “A fully soft-switched
single switch isolated DC-DC converter”, IEEE
5. Conclusion Transactions on Power Electronics, 30(9), 2015.
[12] S. Distefano, G. Merlino, and A. Puliafito., “A
This paper has proposed a system that can automate the utility paradigm for IOT: The sensing cloud”, Pervasive
charging process of mobiles and laptops. This system and Mobile Computing, vol. 20,2015
would be capable of turning on and off only when the [13] Martinez, M. Monton, I. Vilajosana, and J. D.
device is connected and charge only when needed, and Prades, “The power of models: modeling power
can be further improved to monitor other appliances. consumption for IoT devices”, IEEE Sensors Journal,
Further improvements to the system can be made in vol.15, 2015.
order to increase the hardware performance. [14] H.J. Dai, S.L. Zhao, J.T. Zhang, M.K. Qiu, and
References L. X. Tao, “Security enhancement of cloud servers with
a redundancy-based fault-tolerant cache structure”,
Future Generation Computer Systems, 2015.

569
570

You might also like