You are on page 1of 4

2017 International Conference on Electrical and Computing Technologies and Applications (ICECTA)

Design and Implementation of Smart Plug: An


Internet of Things (IoT) Approach
Ahmed S. Musleh1, Mahdi Debouza1, Mohamed Farook2
1
Department of Electrical and Computer Engineering, Khalifa University of Science and Technology
2
Ministry of Foreign Affairs and International Cooperation
Abu Dhabi, United Arab Emirates
ahsmusleh@pi.ac.ae

Abstract — In this paper, we propose an advanced method in that the whole world is looking forward to solve it. People,
solving electrical power monitoring and managing problems. nowadays, are increasing their electrical power consumption
Smart Plug is a power monitoring and management system. It significantly. Second, through this project we wanted to solve
will target the problem of energy saving by enhancing the user's the lack of electrical power consumption awareness
knowledge of energy consumed by the appliance connected to the technologies. Right now, there are many campaigns that are
plug. In addition, the plug user will be able to control the plug interested in reducing electrical power consumption and
from his mobile phone by turning it on and off and setting encouraging people to do so; however, these campaigns lack
operation schedules. The system consists of one master and the required technology which will help them aware the public
several slave sockets. The master will have Wi-Fi access, and it
toward their power consumption as words are never enough to
will coordinate connections between the several slave sockets.
The slave sockets are less complicated and will receive commands
aware the public. The third problem we are addressing is the
from the master and send back power measurements using increased environmental issues that are related to the increased
ZigBee communication. Data collected from the Smart Plug power consumption, and the fourth problem we are after is the
system will help in analyzing and under- standing real-time need of power consumption patterns by the various power
power consumption behaviors, opening doors for future companies around the globe. Power companies would like to
researches related to energy consumption, and assisting modern have the enough knowledge about how people consume their
smart grids efficiency, reliability, and sustainability features. electrical energy.

Keywords — Power monitoring and management; internet of


Many devices have been designed so far to address these
things (IoT); smart plug; WiFi, Zigbee, smart grid. problems. However, the several drawbacks presented in them
rose the importance to designing an advanced smart plug
system. Smart Plug Outlet MZ701 is one of the devises that are
I. INTRODUCTION related to power measurement technologies. MZ701/702 smart
Nowadays, power is the backbone of all modern societies. plug outlet is an AC power outlet with relay control and over
It is the crucial ingredient for the economic growth and the current protection device designed to apply 2.4GHz bend
comfort of every nation and the people it supports. Right now, wireless remote control. The power circuit is of a free design
electricity is consumed in everything we do. It is the with the advantage of being remote able via the proprietary
synonymous of life in the industrialized world. Our network interface. MZ701/702 applies to receive RF command
communication, industries, transport, and whole of our life from the remote controller or advance remote management by
depend on the reliable supply of electrical power. PC application software.MZ701/702 is power saving by its idle
Consequently, power consumption has been the most growing current detection which breaks AC output when the plugged
issue around the globe. Most of nations, if not all, alongside electrical appliance staying no operation [1]. Another of the
with the scientific societies are increasing their attention and related projects that have been published in the markets is
concern toward this phenomenon in order to find a suitable called the Plug-In Power and Energy Monitor. This device is
solution which will insure the permanence and the endurance capable of power measurement of the loads connected to it. It
of the electrical power supply in the future. In other words, we can measure the voltage, the current, and the power of the load
can say that the challenge is to come up with innovative ideas connected to it. Consequently, we may say that this device is
and solutions which will help monitoring and managing really that mush advance form the measurement point of view;
electric power usage, which will consequently lead to reducing however, it cannot send theses data that it measures elsewhere.
power consumptions and improving power grids. In other words, it only measures and monitors the power
readings without providing any kind of control features [2].
Through this project, we are addressing a variety of
considerable problems which we hope to find a suitable This designed plug of ours shall be able to combine the
solution for. These problems are basically related to electrical many features of the devices designed earlier. By utilizing the
power consumption and electrical power grids. First, one of the internet of things (IoT), our device shall be able to measure,
problems that we wish to solve is the increased power control, and communicate power consumption behaviors. The
consumption trends. This could be the most important problem rest of the paper is organized as follows: section two discusses

978-1-5386-0872-2/17/$31.00 ©2017 IEEE


2017 International Conference on Electrical and Computing Technologies and Applications (ICECTA)

the power measurement algorithm employed, section three


shows the communication infrastructure implemented, section
four shows the mobiles application development, and the
conclusions are drawn in section five.

II. POWER MEASUREMENT IMPLEMENTATION


ACS712 is an AC-DC current sensor that give a voltage
output which is proportional to the current going in it. With
zero current passing in it, it gives an output of 2.5, and with the
current passing in it, it gives an output voltage that varies from
0 to 5 volts [3]. It is a very precise chip, yet we needed an
amplifying circuit to amplify the signal coming for the current
sensor so that we get better resolution. Figure 1 shows the
current sensor amplifier circuit.
Fig. 3. Voltage and Current Waveforms
Figure 4 illustrates the instantaneous voltage, current and
power waveforms of a 12W fluorescent lamp. It must be noted
that the current signal is not pure sinusoidal due to the physical
characteristics of the fluorescent lamp.

Fig. 1. Current Sensor Amplifier Circuit

Fig. 4. Voltage, Current, and Power Waveforms of 12W fluorescent Lamp.


Voltage sensor was basically designed via voltage divider
circuit as shown in the figure below: Now that the power measurement is designed, the next step is
to design the communication infrastructure.
III. COMMUNICATION INFRASTRUCTURE IMPLEMENTATION
For the ZigBee communication, we had to establish the
network that will connect all the sockets together. We had to
use a special tool (XBee explorer) for connecting the XBee to
the computer in order to configure the device. Then, we had to
use the XCTU software to configure all the XBees that have
used. Mesh configuration was used in designing the ZigBee
communication infrastructure. The XBee module is
communicating with the microcontroller through serial
communication or UART [4]. The raspberry pi was to be the
master unit in our system [5]. Its job was to establish a channel
between the slave sockets and the web server. In the raspberry
pi, we had to write our own program in Python language.
Fig. 2. Voltage Sensing Circuit Raspberry pi is a single board computer designed and
developed by Raspberry Pi Foundation in UK. Even though it
Note that we added protection means. First, we added a is considered as low performing unit, it is still capable of
voltage follower in order to protect the micro-controller. handling simple tasks associated with simple projects such as
Second, we added a fuse for the sake of protecting the entire ours. Via this device, we are able to connect the plugs to the
circuit from the main AC line. The following figure shows the mobile application and the web server using the Wi-Fi
waveforms of the voltage and current signals sensed. communication. Multithreading was used in the program to
facilitate its operation [6]. Figure 5 shows the overall
communication structure utilized in this project.
2017 International Conference on Electrical and Computing Technologies and Applications (ICECTA)

schedule may be daily, monthly and even yearly schedule.


After placing the plugs into the house map, the next step is to
monitor and control the plug. Figure 7 shows the house layout
page as well as the plug page of the mobile application in (a)
and (b), respectively.
Our product also features a full-fledged interactive web
application which can be used by the Power Distribution
companies to analyze the power consumed by different houses
in a specific grid. The application is also smart enough to
cluster different localities to different grids so as to produce
weekly/monthly analysis. While this mobile application if for
the house dwellers, we implemented the basic application for
Fig. 5. Overall diagram of the designed system’s communication
the electrical authorities which will get all the power readings
After combining all of the desired communication and the from the master from different houses and then plot it in a nice
power measurement attribute together, the following PCB was interactive graph. Figure 8 shows a screen shot from the web
implemented. application developed.

(a) (b)
Fig.7. Plug page

Figure 6. Implemented Plug PCB


It must be noted that the control attribute is added to the
plug via utilizing the solid state relay [7], and the
microcontroller utilized is ATMEGA32 [8].

IV. MOBILE APPLICATION DEVELOPMENT


Our application was built on Windows phone platform. The
architecture used to develop for windows phone is called
Model View Model which is similar to MVC (Model View
Controller). Multi-platform mobile applications have been
developed with features to design a layout of users’ house, by
providing a list of pre-designed pictures of rooms. It just takes
few drag and drops to complete this initial configuration. The
other key feature that has to be mentioned about this project is
that it does not require any breaking the wall or removing
already installed sockets. This is achieved by an innovative Fig. 8. Map Page of the webpage developed
design and use of a special wireless component that entirely
removes the need of explicit cables/wires to communicate with
the main control center or master. Also, the user can set an V. CONCLUSION
operation schedule to the sockets. For example, he or she can In this paper, our system had basically five main tasks,
set a schedule for socket to turn on or off. The operation electrical power measurement, ZigBee communication, Wi-Fi
2017 International Conference on Electrical and Computing Technologies and Applications (ICECTA)

communication, mobile application, and Web server. Each of Department under the supervision of Dr. Riad Kanan, Dr.
these tasks was a must for the whole system to operate Mohamed Ghazal, Eng. Ahmed Sweleh, and Eng. Ibrahim
successfully. In the power measurement, we had to find the Ibrahim.
power readings from the current and the voltage signals, and
the purpose here was to get the most accurate result possible.
On the other hand, the ZigBee and the Wi-Fi communications REFERENCES
had to be a reliable path which could be used to transmit and [1] JETYOUNG Zigbee Smart Measure Power Socket. ONline Trade, 2014.
receive the commands and data. Multi-platform mobile URL: http://goo.gl/XWR9u0.
applications have been developed where the user could monitor [2] Plug-In Power and Energy Monitor. Amazon, 2014. URL
http://goo.gl/0xXVy.
and control his power consumption easily. On the other hand,
web application has been designed to help power distribution [3] ACS 712 data-sheet. Allegro, 2014. URL http://goo.gl/t4FLxx.
utilities further analyze and study consumption behavior of the [4] Serial Communication. Silicon Labs, 2014. URL
http://goo.gl/rWwVWJ.
consumer. Hopefully, this system will increase the awareness
[5] Peter Membery and David Hows. Learn Raspberry Pi with Linux.
of energy conservation in UAE and will guide its people to Apress, 2013.
reduce their electricity consumption; furthermore, it will assist
[6] Multithreaded Programming. Buyya, 2014. URL http://goo.gl/1tsI9l.
in developing smart grids researches and technologies.
[7] Sharpe Relay data-sheet. Sharpe, 2014. URL http://goo.gl/4Vrr9e.
[8] Atmega 328 data-sheet. Atmel, 2014. URL http://goo.gl/VfVV3
ACKNOWLEDGEMENT
This Project was designed and implemented at the Labs of
Abu Dhabi University Electrical and Computer Engineering