Content uploaded by M. Tariq Iqbal
Author content
All content in this area was uploaded by M. Tariq Iqbal on Oct 07, 2021
Content may be subject to copyright.
Content uploaded by M. Tariq Iqbal
Author content
All content in this area was uploaded by M. Tariq Iqbal on Dec 17, 2020
Content may be subject to copyright.
IoT based Renewable Energy Management and
monitoring system for the Frist Passive House in
Newfoundland
Sabir Manzoor, Tariq Iqbal
Faculty of Engineering and Applied Sciences, Memorial University of Newfoundland.
Sabirm@mun.ca
Abstract- This paper presents a prototype of an Energy
Management and Monitoring System (EMMS) for the first house
in Newfoundland built under PHIUS+2015 standards. The
proposed Supervisory Control and Data Acquisition (SCADA)
system is based on the Internet of things (IOT) and is designed to
minimize electricity usage through self-consumption. It comprises
of PZEM004T current and voltage sensor with ESP32 as the first
layer controller. The controller also has control relays and a web-
based monitoring and controlling platform using Ubidots
development platform. The overall system can be controlled and
monitored remotely with advanced web-based systems powered
by Ubidots and set up triggers for excess usage of electricity by the
boiler system. The user can then manually load the wood into the
boiler to reduce electricity consumption. Overall, this system is
scalable and can be implemented to transform the house into a
smart home, which will eventually generate cost savings and
promote sustainable living.
Keywords— Internet of things, SCADA, home automation, ESP32,
instrumentation and control, energy management.
I. INTRODUCTION
Electricity is the most useful form of energy, and the current
lifestyle has been dependent on electricity. Recent trends have
shown that solar electricity generation, with the help of a
Photovoltaic (PV) system, is one of the most economical
sources of alternative energy. PV Self-consumption methods
have proven to be the only way to efficiently utilize electricity
produced from solar energy [1]. Not only this, but there are
multiple other reasons why monitoring and controlling energy
produced from solar energy could be highly beneficial in both
domestic and commercial environments. Several data
acquisition and monitoring systems have already been
developed, which are either expensive or not customizable. To
address this problem, a low-cost Supervisory Control and Data
Acquisition (SCADA) has been designed and produced, which
can take input from multiple things (sensors, controllers, etc.)
and present on a dashboard to analyze and perform specific
tasks according to the requirement.
Supervisory Control and Data Acquisition (SCADA) is a
technology that provides users with real-time data exchange in
a control center and things/devices working in the field. The
proposed SCADA system has been implemented to monitor and
control components of the already designed renewable energy
system. So, this proposed system can be considered as a master
controller to the existing renewable energy generation grid-tie
system. The design of the system mainly consists of an
examination, collection and processing of data in real-time and
the overall energy management system consists of three main
components;
o The Master Logic Controller (MLC)
o Remote Terminal Units (RTU)
o Human Machine Interface (HMI)
The logic controller can also be considered as a master control
for all components involved. This controller also helps create a
bridge between the FID and RTU. FID consists of sensors,
actuators and intelligent signal processing modules, and there
can be multiple FIDs communicating with the central controller,
which is ESP32 development kit in this case. These FIDs can
include but are not limited to sensors such as power
measurement, in this case, relays acting as actuators, and other
switches/devices installed. RTU can also be a part of each
device and has its own Human Machine Interface (HMI) system
to give control to the user. All these devices send data to MLC,
and then data is communicated to the SCADA system through
a secure SCADA communication channel and stored on the
cloud and used by the central HMI system, which is powered
by Ubidots in this study. Eventually, the user can use this
SCADA system to monitor and control all connected devices
remotely using either a computer or mobile app using an HMI
platform where all the variables and controls are displayed in
real-time and chart can also be observed to view the history of
the data. This HMI sends instructions back to the MLC to either
turn on or off.
II. LITERATURE REVIEW
SCADA systems are one of the most important parts of solar
energy and renewable energy production systems.[2] The main
problem with the advanced SCADA system is the associated
high price tag and compatibility issues, which makes it difficult
for small-scale users and research communities all over the
world to strive to develop more accessible and advance
SCADA solutions [3] with each having different functionalities
and varying cost. For a low-cost, open-source SCADA system
using the Arduino Uno controller with the Zigbee radio module
to transfer the data has been studied. The data is collected from
different devices such as temperature sensors, flow sensors,
pumps and control valves and software developed in java. This
data is used to generate reports with an overall system that is
not compatible with a number of low power controllers.
Another study [4] uses a slightly different approach by using a
system developed in Python. This system uses three layers
approach similar to our proposed system but using Python Open
Platform Communication Unified Architecture and MySQL
database language. Raspberry Pi3 and PLC are also added for
control and supervision layers, respectively. This system design
has greater power consumption than the proposed system.
There have also been attempts to use low power electronics
ESP32 boards to develop the SCADA system [5]. This study
uses a subscription-based HMI system that limits the number of
devices for free users, and pricing depends on the number of
devices added to the system. Other studies using SCADA
technology for devices/things connected through the Internet
have been found to have a similar concept with implementation
using Honeypots [6]. Cloud-based Amazon Web Services
(AWS) have also been reviewed [7] in comparison to the
private network-based system [8], which does not give a whole
lot of flexibility to the end-user for IoT management.
Studies have also been reviewed, which are using artificial
intelligence for automated control of all the devices connected
in a house, which can also be called the Internet of Things (IoT).
In this methodology, less control to the end-user is given for
manual control of the devices [9], which can be programed
afterward using hybrid simulation system prototypes that has
been studied [10]. Transferred data of the daily usage and
patterns can be stored in huge databases to train and optimized
machine learning algorithms [11] for high accuracy and
automated control to save energy expenditure for cost saving in
an IoT based smart home system.
An advance approach seen in the previous study [8], which has
also adopted in our project, is to combine different small scale
RTUs to communicate to a central SCADA system [12] and
using an open-source SCADA system can save cost and time
for development and gives flexibility to the end-user to add
more functionality on the later run. Mayur et al. [13] and Ikhsan
et al. [14] has proposed an open-source system using micro-
controller AtMEGA 2560 with SCADA Vijeo Citect and
ArchestrA System Management Console, respectively. As the
RTU operates independently operated with either own
controller collects data from sensors and using Modbus
protocol as the communication channel between the MLC and
the RTU. Similarly, authors in recent studies [15][16] have
developed a low-cost SCADA system based on IoT technology,
where RTU is communicating through TCP/IP to the field
devices, which eventually is management by a data traffic
management system process. The major problem with these
types of designs is as the system gets complex with multiple
devices, it would be difficult for an end-user to troubleshoot.
III. PROPOSED SCADA DESIGN
The system proposed system architecture is based on a SCADA
system that incorporates IoT using a low-cost ESP32
microcontroller and implementing recent research SCADA
architecture discussed earlier [5,8,12,15]. For a general
understanding of the system, Figure 1 presents a high-level
description of where the proposed approach is represented as an
Energy Management System (EMS). PV array inputs the
inverter MPPT, which is then converted into pure sine wave AC
to supply to the grid as well as house load, including a water
heating system. There is a gird-tie inverter that supplies
excessive energy to the grid as well as takes the energy from
the grid when there is not enough solar irradiance to produce
enough power for the connected load. This DC generated power
is fed to the battery bank and also provided to the energy
management system. There are current sensor and voltage
sensor, which gives the analogue signal to the Master Logic
Controller (MLC) with a built-in analogue to digital converter.
MLC consists of KeeYees development board 2.4GHz Dual
Core with WLAN WiFi capabilities with Microcontroller ESP-
WROOM-32 Chip CP2102 for ESP32.
PV Array Grid
General
house load
Battery
Bank
Energy Management
system
MPPT and Inverter
Hosue water
heating system
Sensors
On/Off Relays
The other task for the MLC is to get energy consumption data
for the water heating system and display it on the HMI system.
Part of this HMI system consists of a dashboard board powered
by Ubidots IoT platform and free for educational use. This HMI
system will let the user see the historical data and control
specific home appliances which are categorized under non-
critical load for the house. The overall approach is explained in
the following section.
A. Working of the SCADA system:
To understand more in-depth, EMS shown in Figure 1 can
further be expanded into Figure 2, which represents a more
detailed version of the proposed system. Here it can be seen that
power consumption from PV is monitored with ACS172
current sensor and voltage divider circuit for a level of voltage.
This parameter is later used to monitor the power supplied by
the grid. If there is a significant drop in power while it is still
daytime, it is clear that there is snow blocking the PV panels,
and the manual process of snow clearing is initiated by sending
an email to the house owner. This HMI system is flexible
enough to give freedom to an end-user with other ways of
notification since the data is already being monitored.
Secondly, power consumption by the water heater is also
monitored by the MLC with the help of PZEM-004T 3.0
version TTL Modbus-RTU power meter. This power meter has
a measurement accuracy of 0.5% and can measure AC current
up to 100A with other variables like voltage, power and
frequency. This water heater uses both wood and electricity for
water heating, so there is a potential to monitor and save
electricity if it is being used more than usual. Also, other house
Figure 1 High level design of the complete system.
loads can be controlled and monitored from the Dashboard of
the SCADA system. Instead of publishing the value on the
Dashboard, Ubidots and Arduino library for ESP32 let you
subscribe to the variable for continuous monitoring and control
of the variable. As this variable changes values from the
Dashboard when the user decides to turn off/on a switch
remotely, ESP32 fetches the value of the respective variable,
and an immediate signal is sent out to the output pin of the
ESP32 controller. This whole process activates the relay to turn
on/off the appliance.
Master Logic
Controller
(ESP32)
General
house load
PV Analog
input
Current sensor
ACS 172
Voltage Sensor
Water heating system
Power
measurement
PZEM004T
Relay
Relay
240/120V
HMI
connection
through MQTT
B. Description of SCADA
Sensors feeding information to the SCADA system are the FIDs
for the RTUs to get real-time data for users which can be remote
to monitor and control the system. The EMS follows a three-
layer SCADA system [17], where the current and voltage
sensors are at the base layer. There can be temperature or
humidity sensors added to the system using a similar
framework.
For analogue signals coming out from the PV generation
system, a step-down resistor arrangement has been used, which
can be seen in Figure 3. Equation 1 is used to calculate the
voltage, which uses a voltage divider circuit. A similar circuit
is used for voltage sensing. ACS712 takes 5V input to operate
and uses series connect for power in and power out to generate
the voltage ratio accordingly.
𝑉
𝑜𝑢𝑡 =𝑅1
𝑅1+𝑅2
× 𝑉
𝑖𝑛 (1)
R1 = 20K
R2 = 10K
ACS712
5V
GND1
Out (0V-5V) ESP32 ADC
Current out
Current in
Figure 4 shows the circuit diagram of the power meter IC
PZEM004T. There is a potential divider logic shifter circuit that
has been used to shift the voltage from 5V to 3.3V. PZEM004T
provides output in the form of 5V and 0V during serial
communication, and ESP32 has a standard operating voltage of
3.3V. All inputs to ESP32 should be 3.3V; for that purpose,
equation 1 has been used, which gives 3.3V when there is 5V
applied.
5V
3.3V
GND1
PZEM004T
1 VDD
20K
3 TX
2 RX
4 GND
10K
C. Approach and methodology
After a clear understanding of the system requirement and
architecture, it is time to understand the programming approach
and what is going on behind the scene. Figure 5 describes the
exact flow of the SCADA system's data and processes, as
explained earlier.
Start
Power Consumption and
Power Generation data
ESP32 Receives the data
Calculation is done and data
is assigned to the variables
ESP Connection to
WIFI Netwrok
Data is Published to
the HMI Variables
Variable subscribe to
the appliance control
Read
changes on
HMI
Yes
No
Instructions to change
status of appliances
Figure 2 Detailed structure of the Energy Management System (EMS).
Figure 5 Flow chart of the SCADA system.
Figure 3 ACS 712 Pin configuration.
Figure 4 PZEM004T Pin Configuration .
Firstly, analog and digital sensor data is read, which is collected
from the PV system and water heater. ESP32 reads the sensor
values on analog pin 26 and 25 for the calculation of the value
of power supplied by the solar system. 27 Pin is connected to
the PZEM-004T for serial communication to get the power
value for later to show on Dashboard. ESP32 then connects to
the WiFi, which is local TCP/IP, using a unique WiFi name and
password that throughout remains unchanged. ESP32 uses the
MQTT protocol to connect to the Ubidots platform, where
similar variable names take the value to publish on the
Dashboard. MQTT client identifies the MLC with a unique ID
referred to as a Token number. The HMI system provides this
Token number for security and authentication purposes and
remains unchanged for the account.
As the user interacts with the Dashboard and values changes for
the on/off control of the appliances, these values are then sent
out automatically to the variables subscribed for the values. Pin
12 and 13 send a signal that activates relays to turn on/off
sequence for respective appliances. Figure 6 shows the
prototype testing setup for the SCADA system. Two electric
bulbs are being used
IV. SIMULATION AND RESULTS
Ubidots IoT platform provides a user-friendly Dashboard
where real-time data can be seen, and charts can be accessed
remotely. Figure 7 shows a screenshot of the Dashboard for the
prototype of the proposed SCADA system using Ubidots IoT
platform. As can be seen, a real-time graph can be seen, which
shows the historical data stored in the cloud as well. There is a
demo of real-time power consumption data for the water
heating system. Users can create multiple kinds of real-time
visualization, and all this can be done remotely using an internet
connection and an online Dashboard. Ubidots also have an
android as well as an iOS app to support all kinds of
environments and provide accessibility to the end-user. Finally,
there can be seen two switches in a gray circle that can give live
feedback to ESP32 controller's variables subscribed to these
switches. An operator can also initiate automated supervisory
checks and control actions where a particular script or task can
be performed at the given condition. An email is sent out to the
user, reminding them to clear the snow if solar power
generation is less than a threshold of 0.1kWh. This alert can be
changed to a text message with the option provided by the HMI
system.
V. CONCLUSION
The idea of the SCADA systems have revolutionized the
industrial systems for complex automation control, visual
inspection and monitoring. This idea comes in great help when
there are multiple systems from different manufacturers that
need centralized management and monitoring. For a futuristic
house design where various appliances are connected from
different manufacturers, and there is a need for efficient control
and monitor of energy expenditure. The proposed system is
scalable and, most importantly, affordable, with the overall cost
of implementation to be below $300CAD. Moreover, acquiring
real-time data from PV and water heater and remotely
monitoring it on the Dashboard can improve the efficient usage
of Photovoltaic electricity. Not only that, but the system also
enables end-users to turn off home appliances with the ability
to gain more control over the energy expenditure. This is going
to be another step closer towards sustainable living.
VI. FUTURE WORK:
This system has been designed as a prototype with the ability to
add more devices in the future. This will enable the user to gain
full control of the house and make it more smarter with an
automated check and conditional algorithms. Multiple devices
can be turned off when they are not being used, or multiple
houses can be connected and monitored simultaneously. Most
Figure 6 Experimental setup for the SCADA system testing.
Figure 7 Ubidots Dashboard prototype for the proposed SCADA system.
importantly, this idea is not only limited to an energy
management system for a house. A lot of industries like
pharmacies, traffic control systems, data centers and small
businesses can implement this system with added security using
encrypted communication between HMI and MLC.
VII. REFERENCES
[1] R. Luthander, J. Widén, D. Nilsson, and J. Palm, "Photovoltaic self-
consumption in buildings: A review," Appl. Energy, vol. 142, pp. 80–
94, 2015, doi: 10.1016/j.apenergy.2014.12.028.
[2] A. Tahri, T. Oozeki, and A. Draou, "Monitoring and evaluation of
photovoltaic system," Energy Procedia, vol. 42, pp. 456–464, 2013, doi:
10.1016/j.egypro.2013.11.046.
[3] A. Sajid, H. Abbas and K. Saleem, "Cloud-Assisted IoT-Based SCADA
Systems Security: A Review of the State of the Art and Future
Challenges," IEEE Access 2016, 4, 1375–1384,
[4] R. I. Rajkumar, T. J. Alexander and P. Devi, "ZigBee based design of
low cost SCADA system for industrial process applications," 2016 IEEE
International Conference on Computational Intelligence and
Computing Research (ICCIC), Chennai, 2016, pp. 1-4.
[5] L. O. Aghenta and M. T. Iqbal, "Low-cost, open source IoT-based
SCADA system design using thinger.IO and ESP32 thing," Electron.,
vol. 8, no. 8, pp. 1–24, 2019, doi: 10.3390/electronics8080822.
[6] M. H. Alquwatli, M. H. Habaebi, and S. Khan, "Review of SCADA
Systems and IoT Honeypots," ICETAS 2019 - 2019 6th IEEE Int. Conf.
Eng. Technol. Appl. Sci., 2019.
[7] R. Dugyala, "Implementation o f SCADA Through Cloud Based Io T
Devices – Initial Design Steps," 2019 Fifth Int. Conf. Image Inf. Process.
Implement., pp. 367–372, 2020.
[8] K. Medrano, D. Altuve, K. Belloso, and C. Bran, "Development of
SCADA using a RTU based on IoT controller," IEEE ICA-ACCA 2018
- IEEE Int. Conf. Autom. Congr. Chil. Assoc. Autom. Control Towar. an
Ind. 4.0 - Proc., pp. 1–6, 2019, doi: 10.1109/ICA-ACCA.2018.8609700.
[9] L. M. Gladence, V. M. Anu, R. Rathna, and E. Brumancia,
"Recommender system for home automation using IoT and artificial
intelligence," J. Ambient Intell. Humaniz. Comput., no. 0123456789,
2020, doi: 10.1007/s12652-020-01968-2.
[10] S. Bicakci and H. Gunes, "Hybrid simulation system for testing artificial
intelligence algorithms used in smart homes," Simul. Model. Pract.
Theory, vol. 102, no. September 2019, p. 101993, 2020, doi:
10.1016/j.simpat.2019.101993.
[11] I. Machorro-Cano, G. Alor-Hernández, M. A. Paredes-Valverde, L.
Rodríguez-Mazahua, J. L. Sánchez-Cervantes, and J. O. Olmedo-
Aguirre, “HEMS-IoT: A big data and machine learning-based smart
home system for energy saving,” Energies, vol. 13, no. 5, 2020, doi:
10.3390/en13051097.
[12] A. S. Prokhorov, M. A. Chudinov, and S. E. Bondarev, “Control systems
software implementation using open source SCADA-system
OpenSCADA,” Proc. 2018 IEEE Conf. Russ. Young Res. Electr.
Electron. Eng. ElConRus 2018, vol. 2018-Janua, pp. 220–222, 2018, doi:
10.1109/EIConRus.2018.8317069.
[13] M. Avhad, V. Divekar, H. Golatkar, and S. Joshi, "Microcontroller
based automation system using industry standard SCADA," 2013 Annu.
IEEE India Conf. INDICON 2013, pp. 1–6, 2013, doi:
10.1109/INDCON.2013.6726082.
[14] A. F. Ikhsan, A. Rukmana, A. C. Suarsa, M. Masykur, and T. A. Wiharso,
"The prototype of SCADA application in the school building," J. Phys.
Conf. Ser., vol. 1402, no. 3, 2019, doi: 10.1088/1742-
6596/1402/3/033089.
[15] T. Mononen and J. A. Mattila, "low-cost cloud-extended sensor network
for supervisory control," In Proceedings of the 2017 IEEE International
Conference on Cybernetics and Intelligent Systems (CIS) and IEEE
Conference on Robotics, Automation and Mechatronics (RAM), Ningbo,
China, 19–21 November 2017; pp. 502–507,
doi:10.1109/ICCIS.2017.8274827.
[16] K. Medrano, D. Altuve, K. Belloso and C. Bran, "Development of
SCADA using a RTU based on IoT controller," In Proceedings of the
2018 IEEE International Conference on Automation/XXIII Congress of
the Chilean Association of Automatic Control (ICA-ACCA),
Concepcion, Chile, 17–19 October 2018; pp. 1–6.
[17] M. Endi, Y. Z. Elhalwagy and A. Hashad, "Three-layer PLC/SCADA
system Architecture in process automation and data monitoring," In
Proceedings of the 2010 the 2nd International Conference on Computer
and Automation Engineering (ICCAE), Singapore, 26–28 February
2010; pp. 774–779.