Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Abstract— This paper describes originally designed mono- frequencies lower than the fundamental) or inter-harmonics
phase power quality data logger (PQL), a successor of mono- (components at non-integer multiple of the fundamental
phase power quality analyzer (PQA) presented earlier. The frequency) [2], [3]. A lot of professional power quality
primary purpose of the analyzer was to illustrate the capabilities analyzers do not measure sub or inter-harmonics content [7].
of the used development board to the students of Microprocessor
software and to help the students of Power networks to visualize Harmonic content in current signal is also of interest when
disturbances generated by different electronic devices. Power observing the influence of different loads on the power
Quality Data Logger adds time as another variable and enables network. Some electronic devices can introduce a lot of
students to visualize and measure power quality or distortions “pollution” in power network. Harmonic current distortion
over time. If PQA is compared to a still photo camera, then PQL presents the quantitative measure of that influence.
can be compared to a movie camera. The main idea was to extend
the functionality of the predecessor in the way that data could be Recording power quality data for a longer period (days or
recorded or streamed in real time, allowing the user to analyze months) can be useful for several reasons. One is to establish
them on-site or off-site, in real time or later. An independent the reason of the power network disturbance if it occurs
network module has been added to the device, making it capable suddenly and unexpectedly. Another reason can be simply to
to stream data over the LAN or the Internet. track the power consumption of the device.
Keywords—Power Electronics; Quality Analizer; Data Logger; II. DESCRIPTION OF THE DEVICE
DSP; Microcontroller; IoT; MQTT; Blynk
This paper displays the original design of a mono-phase
I. INTRODUCTION power quality data logger (PQL). It is a successor of mono-
phase power quality analyzer (PQA) presented earlier [4], a
Voltage (its amplitude and shape) and frequency are the compact device based on Mikroelektronika’s Mikromedia Plus
two basic parameters that characterize operation of a power [8] STM32 board. SPI (Serial Peripheral Interface) is used for
system and the quality of the power supplied to consumers. interconnection with ESP8266 [5] utilized for Internet and Wi-
These parameters should be as close to the nominal values as Fi communication. The main idea was to extend the
possible. However, for practical and economic reasons, some functionality of the predecessor in the way that data could be
deviation must be accepted and tolerated [1]. recorded or streamed in real time allowing users to analyze
The deviation from the desired voltage shape can be them on-site or off-site in real time or off-line. An independent
described by harmonic distortion. Voltage spectrum can network module is added to the device, enabling it to stream
contain harmonics (components at integer multiple of the data over the LAN or the Internet without a significant impact
fundamental frequency), sub-harmonics (components at on the MCU performance.
The same as the predecessor, this device is placed between
the power network and the load (Figure 1) thus enabling users
to obtain an instant image of the principal characteristics of the
load, as well as information about how it affects the system
over time.
The new software version implements some additional
functionality compared to its predecessor:
• Measurement, storage, streaming and visual representation
of voltage and current of three sub-harmonics and first 128
harmonics with their three inter-harmonics. In other words,
it measures spectrum in 12.5Hz steps. Harmonics, sub-
Fig. 1. Illustration of the device placement harmonics, and inter-harmonics are presented by a ratio of
the harmonic amplitude and the amplitude of fundamental.
• Measuring frequency has been changed according to frequency. The refresh rate of the screen is 12.5 fps (frames per
standard [11], which means that it is measured as moving second).
average in the 15 second time frame.
Power log shows all three power types over time. The user
• All measured and calculated values can be stored on the SD can detect the changes in power instantly.
card or sent over the USB or Wi-Fi as a real-time data The VCF log (Figure 3) shows voltage, current and
stream. It enables the user to monitor, record and measure frequency changes, simultaneously, over time. In this case,
transitions. power consumer is a two-speed hair dryer.
• Implementation of MQTT protocol [6] in ESP8266
transforms PQL to an IoT (Internet of Things) solution. IV. HARDWARE DESIGN
The hardware (Figure 4) is almost the same as its
• Improved calculation of all power types. predecessor’s [4]. It means that the signal conditioner is the
same, based on LEM LA25-NP transducer for measuring
current, and LEM LV-25P transducer for measuring voltage
[10]. Also, MCU stage, which performs AD conversion, data
storage, processing, visualization and streaming, is the same.
The ESP8266 module has been added and connected to the
SPI port of the MCU. The ESP8266 [5] module is a self-
contained SOC with an integrated low power 32-bit CPU and
TCP/IP protocol stack that provides any MCU with access to
Wi-Fi network. The ESP8266 is capable of either hosting an
application or offloading all Wi-Fi networking functions from
another application processor. In this case, it is used for
offloading networking functions. This module has been chosen
because of its ever-growing users’ and developers’ community.
Fig. 2. Photo of the scope screen
V. SOFTWARE DESIGN
III. USER INTERFACE
The software included with the device can be divided into
The user interface has been slightly changed. The main three parts: firmware, data viewer, web service.
screen resembles a user menu in which the user can choose:
data presentation style and medium for data storage or A. Firmware
streaming. The prime spot of the device is its embedded software
(firmware), which can also be roughly divided into three parts.
Some basic measured and calculated values are shown on Those parts are: Data acquisition, Data processing and Data
the main screen. The device presents the results after four full presentation
periods (80ms) have been read.
The data acquisition part is used for data sampling. The
The data can be presented as: Scope, Power log and VCF CPU samples 12-bit data from two channels at the sampling
log. rate of 25.6 kHz. It allows capturing of up to 128 harmonics of
The scope screen (Figure 2) is similar to the main screen of current and voltage signals, their corresponding three inter-
the predecessor. The waveforms of two and a half periods of harmonics, and three sub-harmonics.
current and voltage signal are shown in the upper half of the PQL captures 2048 values of voltage and current
screen. The bottom half of the display presents the harmonic
content of both signals. Also, RMS and THD values of current
Fig. 3. Photo of the display of voltage, current and freq. over time
and voltage are shown, as well as the value of measured Fig. 4. Illustration of the device
2
19th International Symposium POWER ELECTRONICS Ee2017, October 19-21, 2017, Novi Sad, Serbia
3
19th International Symposium POWER ELECTRONICS Ee2017, October 19-21, 2017, Novi Sad, Serbia
First, the entire daemon, as well as all dependencies, live in to control IoT devices. Also, it is a digital dashboard for
the Docker image. This means that it will function correctly on building a graphic user interface for any IoT project by just
all Linux distributions. Everything for the Docker container is dragging and dropping widgets. It is successfully funded on the
contained in one or two images. There are some security Kickstarter [17]. It is not tied to some specific hardware. Blynk
benefits. The main is that compromising the container may platform consists of Blynk server and Blynk mobile
prevent additional compromise of the server. And finally, application.
scalability is easily achieved with Docker containers. In this
Even though Blynk server can be used as a message broker,
case, lack of resources can be easily compensated, only by
distributing containers over different virtual machines. The
technology called "Swarm" allows easy management of a
cluster of Docker Engines.
RabbitMQ [14] is used as the message broker. It is open
source message broker software that implements message
queue protocols such as AMQP and MQTT. The RabbitMQ
server is written in the Erlang programming language and is
built on the Open Telecom Platform framework for clustering
and failover. Client libraries interfacing with the broker are
available for all major programming languages.
The broker's primary task is to manage messages between
publishers and subscribers. PQL publishes messages to the
broker. The broker has at least one subscriber, which is another
microservice, made using NodeRed. Also, because MQTT
protocol is exposed outside the service, there can be other
subscribers. An example is an Android application called
Fig. 7. , Blynk Dashboard (right) and MQTT Dashboard (left)
“MQTT Dash” which is one of the applications used for data
monitoring (Figure 7). RabbitMQ is used instead. This decision has led to a significant
Node-RED [15] is a programming tool for wiring together improvement of performance. The beautiful design of the
hardware devices, APIs and online services in new and exciting mobile application and some useful features made Blynk a part
ways. It provides a browser-based editor that makes it easy to of the service (Figure 7). It has been used for serving data to
wire together flows using the wide range of nodes in the palette the mobile application, storing data to the PostgreSQL database
that can be deployed in a single-click. and as a web API.
PQL uses Node-RED as a bridge between RabbitMQ and API outsources measured data and enables a user to
Blynk server. It also presents real-time data over the web in the develop other, remote, off-site applications which will handle
form of a dashboard. Received message, from MQTT node, that data measured in real-time differently.
travels, as payload, to JSON parser. From the JSON parser, it
VI. EXPERIMENTAL RESULTS
goes as an object to the function node, which sends it further to
gauge, text, graph and Blynk nodes. Gauge, text and graph Experimental results presented here are from a remote
nodes are used to present real-time data at the dashboard location over the three-day period. It is well-known that the
(Figure 6), and Blynk node is used for connection with Blynk chosen location has some issues with power quality. PQL has
server over a web socket. been set to send averaged data from 125 measurements every
10 seconds. Voltage frequency, amplitude and harmonics of
Blynk [16] is a Platform with iOS and Android applications one phase are measured. The given data is compared with the
standard (SRPS EN 50160:2012) [11] for voltage
characteristics of electricity supplied by the public distribution
network and with the measurements from another location.
The remote location is placed in the unpopulated rural area.
There is no nearby industry. Measurement point is about 2.5km
away from the power transformer station. The other location is
placed in the metropolitan area. Measurements from this
location are used for the purpose of comparison.
4
19th International Symposium POWER ELECTRONICS Ee2017, October 19-21, 2017, Novi Sad, Serbia
Fig. 7. Measured voltage over time (upper – remote location, bottom – local measurement)
D. Power measurement
Current and power consumption over time, total harmonic
distortion and harmonic analysis of current and all three types
of power were monitored.
Figure 10 shows all three types of power (active (blue),
reactive (purple) and apparent (green)) averaged over a minute
in the 24-hour period. The consumer in the example is a
refrigerator with 300W compressor.
Fig. 8. Harmonics values of voltage
5
19th International Symposium POWER ELECTRONICS Ee2017, October 19-21, 2017, Novi Sad, Serbia