Anda di halaman 1dari 41

Pontifícia Universidade Católica do Paraná

João Paulo de Melo


Matheus Eduardo Garbelini

Low Cost Transformer Monitorig System with Lora/LTE


Connectivity

Orientador Ivan. J. Chueiri


_____________________

Curitiba
2018
João Paulo de Melo
Matheus Eduardo Garbelini

Low Cost Transformer Monitorig System with Lora/LTE


Connectivity

Trabalho apresentado como requisito do 1º semestre da


disciplina de Trabalho Final de Graduação 1 do Curso
de Engenharia Eletrônica da Pontifícia Universidade
Católica do Paraná.

Field area: Engenharia Eletrônica.

Advisor: Ivan J. Chueiri.

Coadvisor: Marcelo E. Pellenz.

Curitiba
2018
Abstract
The project consists of using new available wireless communication technologies applied to
energy monitoring in low voltage local area transformers. The hardware measures the voltage
and current of each phase of a 3-phase transformer, allowing to obtain energy quality parameters
like active, reactive, and apparent energy on each phase and on the overall system. Concepts of
signal processing and electrical power systems are applied in the embedded hardware in order to
provide the necessary behavior, informing when something in the measured transformer is wrong.
Lora/LTE communication is presented to be the main features to access the hardware remotely.

Keywords: Transformer Monitoring, Lora, LTE.


List of Figures

2.1 General project diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8


2.2 Energy measuring system and processing system. . . . . . . . . . . . . . . . . 11
2.3 ATT7022EU. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 ESP32 Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.5 Microcontroller Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.6 Microcontroller Auxiliary Circuit . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.7 Bootloader circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.8 GPS Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.9 System Supply Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.10 Battery Management circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.11 The charging profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.12 Lora SX1278 Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.13 LoRa Radio Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.14 ZTE MF823L 4G Modem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.15 Orange Pi Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.16 Orange Pi Zero connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.17 RS485 Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.18 USB Circuit Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.19 Nextion Display. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.20 HMI Connector. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.21 High Charts Javascript Graph Library example. . . . . . . . . . . . . . . . . . 27
2.22 Loopback Rest Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.23 Web Server architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.24 Digital Board Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.25 Digital Board 3D Mounting. . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.26 Testing and Validation flowchart. . . . . . . . . . . . . . . . . . . . . . . . . . 32
List of Tables

2.1 Project Risks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33


2.2 Project schedule and description . . . . . . . . . . . . . . . . . . . . . . . . . 36
List of Acronyms

MCU Alternate Current


MCU Microcontroller Unity
LTE Long Term Evolution
HMI Human Machine Interface
PCB Printed Circuit Board
TTL Transistor-Transistor Logic
USB Universal Serial Bus
Summary

1 Introduction 7

2 Project Planning 8
2.1 Project Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.1 AC Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.2 Energy Meter Hardware . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.3 Analog Front-End . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.4 Processing Unity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.5 Local Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.6 Remote Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.7 Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Project detailed description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.1 Main micro-controller . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.2 System Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2.3 External communication interfaces . . . . . . . . . . . . . . . . . . . 20
2.2.4 Web User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2.5 Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.3 Printed Circuit Board Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.3.1 System Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4 Risk Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4.1 General Risks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.4.2 Hardware Risks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4.3 Software Risks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.5 Project schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.6 Software and tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

3 Conclusion 38

References 39
7

Chapter 1

Introduction

Connectivity, undoubtedly, is the word of our century until then (2018). To share
something, perform the remote control of some device or to do the control/supervise something
remotely is becoming easier, cheaper and and widely used today. Even when we do not realize
that we are doing it, indirectly, we are sending or receiving something to/from someone. The use
of the Internet and other resources allowed us to carry out the supervision of a process remotely
to allow activities that were previously not possible.
Connecting things is the future. Even if that future is not too far away, there are still
many technologies to be developed. The use of smart meters that are capable of communicating
with a management center is another important tool in these innumerable connectivities that we
see in our daily lives and that can positively impact all the people involved. This device, thus,
can be seen as a tool capable of increasing efficiency and cost reduction by the companies that
use it and also impact the services used by the final consumer. It can be considered as one more
important tool in the revolution called Internet of things (IoT).
This project has a final goal of producing a hardware able to do electricity measurement,
anomaly detection and remote data sending to a management center using Lora or LTE
technologies. Our challenge and goal is in the search for new and alternatives technologies
that make our hardware technological, efficient, robust and more cost-effective compared to
preexisting technologies.
The following chapters are presented as the following: A description of the problem
involved in the project; Technologies that have a potential to be used in our final physical project;
The test procedures used to test and validate the component parts of the project; The risk analysis
of the main problems that we may face during development; The project schedule and finally a
conclusion pointing the principal project aspects.
8

Chapter 2

Project Planning

2.1 Project Overview


The Project general diagram is shown below in figure 2.1.

Fig. 2.1: General project diagram


Source: The authors

As discussed in other topics, the project goals is to provide not only the energy
measurement of a three phase power transformer but also to provide a simple and easy solution
to read those measurements through the use of remote connectivity. This is accomplished by
organizing the project in functional blocks which are described in the following subsections.
9

2.1.1 AC Sensors
In order to measure the higher electrical voltage and current flowing through the
three-phase power transformer, external current and voltage transducer sensors are used in this
step to ensure that next functional block will receive according low voltage signals.

2.1.2 Energy Meter Hardware


The Energy meter hardware is divided into two main blocks. The first is related to where
the AC sensors are connected and from which the analogical integrated circuit is responsible for
the signal processing, informing it’s results to the second hardware block where the processing
unity where the microcontroller resides.

2.1.3 Analog Front-End


This block is responsible to adequate signals from ac voltage and current transducer to
compatible voltage level supported by the analog integrate circuit that is responsible to process
these signals into other energy measurements. As this block is directly connected to the AC
electrical network, it must be isolated from all the other blocks to avoid possible electrical surges
from damaging them. Also, the hardware it must be correctly designed in order to avoid that
high currents can interfere with it’s measurements.

2.1.4 Processing Unity


The processing unity uses a microcontroller to read the three-phase energy metering
IC information through an isolated interface and stores them in it’s main flash memory. The
stored values can be polled by optional interfaces like RS485, USB or sent remotely via a LoRa
Radio or a 4G connection (indirectly through another serial interface). The memory behaves
like a FIFO memory in a measurement can be stored for a certain amount of time before being
overwritten by a new value.
The MCU also includes an real time clock for generating a timestamp of the measurement
so it can be further analyzed. A low power mode is also necessary to maintain maximum battery
life in situations where main power supply Is not available. This allows the MCU to alert the
situation of the power transformer for a certain time before the energy meter shuts down entirely.
Power Supply
The supply block is responsible to provide appropriate voltage and current to the circuit.
It supplies other blocks such as the Analog Front-End, Processing Unity and remote connectivity.
It also must isolate the Analog front and supply from other blocks and contain necessary circuit
protection to possible high voltage surge. Optionally, a 2-Cell Lithium-Ion battery backup system
can be used when there’s no AC Supply available.
10

2.1.5 Local Connectivity


The local connectivity with the proposed hardware is an extremely important component
of the system as it enables user interaction, whether it is for configuration, manual data receiving,
visualization of stored information or simply to ease development. The RS485 Communication
enables the use of MODBUS RTU communication protocol so the data can be polled by a
master that is connected to a Scada system; The USB enables to only communication to a nearby
computer but also helps developing the system; Finally, the optional HMI enables fast interaction
with the system, informing its current configuration and main measurements received from the
electrical network.

2.1.6 Remote Connectivity


Through an external connection, the processing unity sends energy information to the
communication processor that is responsible to forward them using a Lora radio or 4G LTE
connectivity. Optionally, ethernet cable can be used to enable internet connection or MODBUS
TCP communication.

2.1.7 Web Application


The Web application is composed of two parts, the application framework and the Web
server: The application framework is an intuitive graphic interface that enables the user to interact
with the hardware such as graphical visualization, parameters and connectivity configuration;
Finally, the web server allows remote access to this framework and to receive remote information
from the energy meter system via 4G or Ethernet cable. To be able to receive Lora radio
information, a dedicated Lora gateway or a host computer with a Lora USB stick attached to it
must be used.
Regarding the user interface, the following measurements information related to the
power transformer shall be presented in it’s graphical visualization tool:

• RMS voltage of each phase;

• RMS current of each phase;

• Active power of each phase;

• Reactive power of each phase;

• Phase lag of each phase;

• Frequency;
11

2.2 Project detailed description


The main hardware not including the communication processor consists of blocks
presented in 2.2.

Fig. 2.2: Energy measuring system and processing system.


Source: The authors

Most of the technologies chosen in the development of this project took into the
consideration of the principle of using electronic components, boards, modules etc., that meets
the technical needs, robustness, technology and costs. Since there are already some solutions on
the market in the application’s area of our device, we will seek alternatives, add new technologies
and always look for an optimized way to implement them - either by manufacturing new circuits
or purchasing existing modules.

Analog Front-End

We are studying the feasibility of using the ATT7022 (Figure 2.3) 3-phase electronic
energy metering chip. We are interested in this integrated chip because it is suitable for measuring
active power, reactive power, apparent power and reactive energy for each phase and 3 phases
combined; it is also suitable for measuring voltage RMS, current RMS, power factor, phase
difference, and frequency - that is, a wide range of things that demonstrate the quality of the
measured energy.
12

Fig. 2.3: ATT7022EU.


Source: https://lcsc.com/

The big difference of this chip is the cost-benefit ratio. With the use of this, we will
reduce the cost, when compared to the solutions of meters already available in the market, and
we will have access to the quantities that we have interest. Other peripheral parts, such as the
sensors that will be used in the line of the voltage network, the entrance protection part and the
insulation circuit, among others, are in the process of being studied if it will be economically
interesting to acquire them in already ready modules or to make them according to our necessity.
Similar projects used this IC to provide solutions in intelligent energy metering solutions
as can be seen Xupeng e Xiu (2010) and Qi et al. (2015)
Alternatives to this chip exists such as ADE7868 form the ADE78XX series (Mhetre
et al., 2015) but they are at least 5 times expensive than ATT7022.

2.2.1 Main micro-controller

Fig. 2.4: ESP32 Module


Source: Kolban (2017)

The main controller needs to be fast in order to receive and process the signals in real
time. Thus, Espressif devices could allow high performance with a reduced cost.
13

Due to the project requirement of being innovative, low cost and robust, Espressif’s
ESP32 (Figure 2.4) is used as the most viable option, it’s is very cheap compared to micro-
controllers of the same category (Cortex-M7 form STMicroelectronics) at around 5 dollars each
at current year of this paper. Furthermore, it includes WiFi that can benefit in development as it
support over the air upload and flexible boot-loader schemes. It’s also very successful in current
IoT application as can be seeing in Maier et al. (2017).
ESP32-WROVER module specifications are listed below:

• 240M HZ System frequency;

• 4MB of SRAM + 512KB of System RAM;

• Dual core Xtensa 32-bit LX6 microprocessor;

• Integrated RTC;

The Schematic of the microcontroller unity is presented in Figure 2.5. U1 is the ESP32
itself (Figure 2.4). Other connections are organized as yellow labels and C2 and C3 are filter
capacitors for the MCU supply.
The jumpers K1 and K2 allows to select serial lines to be used for USB connection or
the IHM, as it’s optional.
To allow correct behavior of the MCU during supply startup, guarantee correct operation
under rough circumstances and some indication during development, the circuit of Figure 2.6 is
used.
14

Fig. 2.5: Microcontroller Schematic


Source: The authors
15

Fig. 2.6: Microcontroller Auxiliary Circuit


Source: The authors

The boostrap circuit is made of some resistors (R1-R3) that enables the MCU to correctly
power up. The external watchdog such as the U2 prevents the internal MCU to fail due to some
not planned internal software loops; the RTC Oscillator X1 enables the ue of the internal MCU
RTC and finally status LEDs D2 and D1 enables visual confirmation that the supply and MCU
are working.
16

Bootloader support

To fast development, there’s a need to use a bootloader. ESP32 MCU supports this by
deault in it’s main serial, but some external circuit must be used in order to interface with a USB
serial converter in order to reset and make the device enter in bootloader state automatically
without needing to reset the board. This can be shown in Figure 2.7.

Fig. 2.7: Bootloader circuit


Source: The authors

The idea of the bootloader circuit is to whenever bootloader signals 0 and 1 are in zero
state, RST or GPIO0 will receive a 0V voltage. Fir instance, if and only if boot0 are in 0V,
GPIO0 will also be 0V. In contrast, if and only if boot1 is 0V, RST will also be 0V making the
esp32 reset. If the ESP32 resets and GPIO0 receives zero signal during some initial time, ESP32
will enter bootloader mode, thus allowing to received flash programs through the serial line 0
(UART0).

GPS Time Synchronization

To capture energy measurements with a precise time stamp, a GPS can be used as can
be seen in the schematic of figure 2.8. The PPS signals allows the MCU to receive each second a
precise interrupt while the GPS Serial line sends NMEA messages so the MCU can know not
only it’s position but also it’s UTC Time.
17

Fig. 2.8: GPS Schematic


Source: The authors

2.2.2 System Supply


The circuit of the supply of the MCU and Communication circuits are shown in figure
2.9.
The supply circuit uses a switched regulator U7 to power the system as it can consu-
mes large current depending on what he communication processor is doing or what remote
communication is used, so efficiency is taking into account here.
A basic protection circuit is used in for the input voltage VIN coming from the J4
connector, so a resettable fuse F1 and a voltage transient suppressor (TVS) D8 is used to cut
spikes above 13V that can harm the system.
The ferrite beads FB1 and FB3 after the switching regulator allows some input filtering
for the linear 5V-3V3 regulators U6 and U8.
Additionally, there’s circuits that allows a change in the supply logic when the board is
not powered by main supply connector, but instead by a battery in emergency situations: The
switched regulator is shut down when the battery is in a low voltage level by the BuckCTRL
signal with uses a P and N Channel mosfets for it’s logic (Q7 and M3).
If only a battery is used to power the system and it has maximum charged voltage less
than 6V, the conditional supply circuit allows the battery to bypass the switched regulator in
order to avoid voltage dropout via the BatteryDetect Signal.

Battery Supply circuit

The hardware can be optionally powered by an alternative 2 cell Lithium-ion, or a


super capacitor bank. Both technologies are considered to be included as factors such as battery
longevity and high temperature operation are important.
18

Fig. 2.9: System Supply Circuit


Source: The authors

The schematic of the battery charging circuit is shown in Figure 2.10. The CN3705
(U3) is a switched buck controller that allows to charge a multi cell battery as it allows to regulate
the maximum voltage that it charges.
Also a commom NTC sensor can be used alongside the battery via the connector J2 to
shutdown the charging process if an over temperature is experienced to the battery.
To allow maximum power transfer from the battery to the circuit, a perfect diode circuit
is used (M2, Q4A, Q4B).
19

Fig. 2.10: Battery Management circuit


Source: The authors

The charging curve that the IC follows are depicted in Figure 2.10. Note that even tough
the graph indicate charging end at 4.2V, this can be adjusted for any voltage based on the feedback
resistors R12 and R14.

Fig. 2.11: The charging profile


Source: http://www.consonance-elec.com
20

The bottom half of the charging circuit uses constant voltage comparators to detect if
the battery is low (U5, below 7.4V for 2 cell 4.2V batteries) and the type of the battery (U4, for
less than 6V batteries such as 2 series super capacitors). If the battery detected is less than 6V,
the Q3 transistor are enable, changing the feedback network so the maximum charger voltage is
around 5.5V.

2.2.3 External communication interfaces


Lora communication

The popular module SX1278 is used in this project (Figure 2.12).

Fig. 2.12: Lora SX1278 Module


Source: https://lcsc.com

Besides the SX1278 low cost, a variety of selectable base frequency modules from the
supplier can be bought. Furthermore, it’s a well tested device in IoT applications such as depicted
in Daud et al. (2018). The schematic of the module in this project can be seen in Figure 2.13.

Fig. 2.13: LoRa Radio Schematic


Source: The authors
21

LTE connectivity

The connectivity with a 4G/3G network can then be made with a USB modem such as
the ZTE MF823L 4G Modem (Figure 2.14). They are very cheap and can be found in national
market. It also supports external antennas to achieve better reception and transition.

Fig. 2.14: ZTE MF823L 4G Modem.


Source: http://www.ztebrasil.com.br

Communication processor

The application of a communication processor for this project is essential as it in-


dependently isolates the communication tasks from the main processor responsible for the
energy readings. Due to this reason and 4G/LTE support pricing options, the best solution we
encountered so far is the use of cheap embedded linux module called Orage Pi Zerop depicted
in Figure 2.15.
The Orange Pi Zero is a board that costs only 10 dollars with 512MB of RAM, has
a quad core ARM processor and wifi capabilities by default. It’s board size is very short and
a single USB and Ethernet connector is present - Just as this projects needs according to the
general diagram showed in Figure 2.1.
22

Fig. 2.15: Orange Pi Zero


Source: http://www.orangepi.org/

It’s integration in the schematic is showed in the schematic of Figure 2.16. The connector
J5 is a 10 pin female header in which the OrangePi Zero is inserted above.

Fig. 2.16: Orange Pi Zero connector


Source: The authors

RS485

The use of a isolated RS485 IC is a must for a project involving power transformers as a
transient in the communication cable cannot damage the board. The commercial used for this is
the ADM2484 IC, which can be seen in the schematic of Figure 2.17.
23

Fig. 2.17: RS485 Schematic


Source: The authors

For line termination, a 120Ohm resistor can be added by soldering the jumper J11; Dual
TVS D13 is used to protect the lines for voltages over RS485 levels (+12V/-7V) and an on-board
5V regulator U12 allows to use an isolated supply in order to communicate with the digital board.

USB

To allows easy hardware setup and programming, a USB is be included on the board.
As the onboard MCU doesn’t have a internal USB controller so an external serial-USB controller
ICs is be used such as the CH340C. The circuit can be seen in the schematic of the Figure 2.18.
USB protection is also included by using a bidirectional TVS D12 and a perfect diode
circuit which allows almost all the USB voltage to power the system and protect the USB against
reverse current.
24

Fig. 2.18: USB Circuit Schematic


Source: The authors

Human machine interface

The Nextion displays (Figure 2.19) is presented to be the best and cheapest solution to
integrate in this project as an optional interface that allows the user to configure some hardware
aspects.
25

Fig. 2.19: Nextion Display.


Source: https://nextion.itead.cc

The connector schematic used in the project is presented in Figure 2.20.

Fig. 2.20: HMI Connector.


Source: The authors

A TTL serial interface is used to communicate with hardware or to program the display.
The HMI interface is programmed using a specialized editor (Nextion Editor) provided by Nextion
free of charge. It allows to simulate the user interface before deploying to the display itself via a
SD card integrated in the display.
Nextion also provides a lot of libraries to allow integration with the project hadware as
easy and fast as possible.
26

2.2.4 Web User Interface


The web user interface needs to be a clean and easy to depict data coming from the
hardware. Thinking of that Quasar Framework is a open source web framework that help
developers to create responsive websites that look native. It means that the same web page can
be showed in desktop or mobile devices without the need to rewrite the code.
Quasar is built on top of technologies such as VueJS to allow HTML and Javascript
interaction to be as clean and complete as possible. For that reason this framework was chosen
instead of similar alternatives like React, Ionic or AngularJs.

Desktop and Mobile Application

The web application development framework discussed above can also run as a native
desktop or mobile application. In the case of a desktop application NWJS enables web pages
to be executed as normal applications operational system like Windows, Linux or MacOS. It
uses an integrated chrome + NodeJS runtime to allow the page to also interact with the system
hardware like Serial Ports (Benoit, 2015).
Mobile applications can benefit from Cordova to run web pages as native applications.
It’s currently very popular and deeply supported by quasar framework in android, windows phone
and IOS smart phones (Brucker e Herzberg, 2016).

Measurement Graphs

In order to present a clean and easy to understand measurement information to the user
trough the web user interface, a javascript charting library such as High Charts is used (Figure
2.21).
High chart is very well know by the web community, it’s very reliable and easy to use
(Kuan, 2012).
27

Fig. 2.21: High Charts Javascript Graph Library example.


Source: https://www.highcharts.com/

2.2.5 Web Server


Currently this project are using a virtual private server (VPS) that is located in New
York Through the RamNodes Service. This allows to easily test web ideas such as the application
data base.
There’s alternatives that helps building the infrastructure of the webserver application
such as hapijs, expressjs, Restify, Strapy, Sailsjs, ActionHero but the most applicable for our
project in consequence of it’s flexibility, ease to use and documentation support is the LoopBack
rest framework.
Loopback allows to focus on writing reusable application logic instead of spending time
building infrastructure. Also, it generates beautiful API’s documentation as can be seen in Figure
2.22.
28

Fig. 2.22: Loopback Rest Framework


Source: https://loopback.io/

The Web Server architecture is shown in Figure 2.23. The communication processor
(Orange Pi Zero) sends it’s local information through a private port that can only be accessed
through a VPN connection.
The LoopBack framework handles the logic between inserting new data using generic
access to a database such as MySQL. This API access can be made through normal API calls in
NodeJS.
The communication processor will also use LoopBack Framework for it’s interaction
with database, allowing a more robust access to configure the digital board and so on. A
configuration JSON file is used to store OrangePi configuration so it’s connectivity can be
configured.
29

Fig. 2.23: Web Server architecture.


Source: The authors

2.3 Printed Circuit Board Design


The Layout of the digital board is depicted in the Figure 2.24. The layout involves
deferent ground plans in order to best avoid noise and to shield the board.
30

Fig. 2.24: Digital Board Layout


Source: The authors

A 3D Overview of the board is also generated and is shown in Figure 2.25.


31

Fig. 2.25: Digital Board 3D Mounting.


Source: The authors

2.3.1 System Validation


The basic flowchart of the testing and validation procedure is presented in Figure 2.26.
The first steps involves the schematic and layout validation trough simulations whether
they are possible. Following this, the PCB Layout must be verified with the dewsired PCB
manufacturer service do guarantee correct fabrication.
When the board and the components arrives, the PCB is soldered and each part of the
circuit is independently verified in order to validate all it’s components behavior.
If during initial tests (including fast software IC tests) something goes wrong, a hardware
analysis must be used in order to apply an workaround, getting back to the component validation
step.
An important step that must done in the initial test is the use of a three phase signal
generator. It allows to test the energy measurement IC by generating the necessary signals of
voltage and current with a lag of 120 degrees of each other.

2.4 Risk Analysis


To ensure that the project development occurs with the least number of surprises, a risk
analysis must be done to all it’s possible scenarios and factors that could make the development
slower or not feasible. There are two main topics to cover in this analysis: The first is related
32

Fig. 2.26: Testing and Validation flowchart.


Source: The authors
33

to general project factors regarding this final year undergrate project; The second is related to
specific details about the type and complexity of an energy meter hardware proposed in this work.
A table containing a summary of all the listed risks and avoidance difficult is depicted
in Table 2.1.

Table 2.1: Project Risks

2.4.1 General Risks


In the end of the analysis, some solutions must be proposed to avoid or create an action
plan to achieve the project goal. Below are presented some general risks regarding the project
subject:

• Components Supply: As this project involves the use of components that are not available
in the country of this project (Brazil), international components supplier alternatives
must be used. There are well knows companies such as DigiKey, Mouser, Farnell, LCSC
and RC Components. In order to avoid initial hardware development time, an supplier
must be chosen according to it’s arrival time and price.

• Printed circuit board: Most of the problems can occur in an initial prototyping stage of
the hardware. The use of inadequate or low quality printed circuit boards can affect
significantly the development time due to issues such as electrical issues on the board,
poor signal integrity, limited board options, etc. To avoid those problems, professional
printed circuit company must be used such as JLPCB, AllPCB, PCBWAY. Combined
with DHL courier as the shipping option, the board can arrive in maximum of one and a
half week.

• Project Complexity: There are 3 main system blocks in the project: Low voltage Energy
measurement, Hardware processing unity and local/remote LTE communication. In
each one there are specific critical details that if not followed would imply incorrect
or faulty behavior of the hardware. The project complexity is also product of how
much tasks are necessary to conclude each project part and how familiarized and skilled
are the students with the concepts and procedures involved contained in the project
development.
34

• Project cost: There is a maximum amount of resources available that can be spent in
development. Each development phase must agree with a maximum cost. This problem
consists of expenses in electronic components, shipping, software, PCB manufacturing,
manufacturing materials, sensors, modules, etc. Exceeding the maximum quota would
imply in not being able to conclude the project with integral hardware and functionalities.
The cost must always be aligned with each development step, choosing the only necessary
resources that will be used in order to achieve the goals.

2.4.2 Hardware Risks


Besides the general risks listed above, there’s also hardware and software specific risks
that must be taken in account. Starting with the hardware risks, a list is presented below:

• Low Voltage: The front end of the hardware must deal with voltages in the range of
110-240Vrms. Thus, must be developed solutions not only to support the specified
voltage limit, but also provide protection and suppression from electrical network surges.
Not being able to develop this solution would imply in damaging the hardware in a
possible transient scenario. In order to avoid this problems, guides and components
specifications must be followed.

• Electromagnetic Interference: As the hardware will be near a power transformer, high


currents may interfere with the energy monitoring circuit and communication. EMI
suppression techniques must be used such as RF shield to suppress interferences. Also,
modularizing the hardware to separate vital parts can help eliminate the problem if such
techniques are not enough.

• LTE Connectivity: Depending on the region in which the hardware is installed, internet
connectivity or bandwidth is not always guaranteed, even if dedicated receiver antennas
are used. In order to solve this issue, a third communication option must be used to
poll the energy metering data from the hardware. For instance, RS485 and Lora radio
communication could be added.

• Energy fault: There’s a risk that a electrical network measured by the hardware is turned
off intentionally or by some accident. If the hardware doesn’t detect this, faulty behavior
would occur in the measuring system. To avoid this issue, the main measuring integrated
circuit must provide some mechanism. This must be used as one of the main project
criteria for the components selection.

• Integrated Circuit malfunctioning: There is a possibility that a faulty component is used.


It’s difficult to identify this kind of problem as other similar issues could present similar
behavior. In order to also avoid this problem and also non intentional components
shortage or maximum parameters exceeding, redundant components must be bought.
35

• Schematic and Layout validation: Besides the need of a correct and clean schematic
and layout project according to the project criteria’s, if a further validation step is
not done in early hardware step, the possibility in hardware faulty behavior that is
difficult to find such as incorrect pin placement, incorrect expected signals, incorrect
supply voltage. In order to avoid those problems or to at least help to identifying them,
montecarlo simulation must be done whether is possible and the schematic and layout
must additionally be organized in isolated blocks and include testing probes, jumpers
and extra components. This helps to better test the hardware when mounted and to
promptly identify the origin of a issue. Furthermore, with extra redundant components
included in the schematic, it gets easy to rework some circuit block for instance.

2.4.3 Software Risks


With all those possible hardware risks mentioned, there is the software side of the
project that itself contains equally important development steps that could be prune to some risks:

• Micro-controller peripherals support: There’s a common risk that even tough using
a micro-controller with initially all it’s available peripherals that the project needs, in
practice, an incomplete or faulty peripheral behavior is supported on software. To avoid
this issue in the micro-controller selection, the errata of it must be read and also official
forums must be searched to detect if anyone is having some problem or hardware conflict
in a specific peripheral and also if there’s a software workaround to use it normally
use. This present initially as low risk as can be done early in the project, but if for
some reason this step is overlooked, the consequences are catastrophic in later hardware
validation. Official sample codes for the targeted micro-controller also must be seen.

• Software feasibility and complexity: The software running on the microcontroller


must support a complete mathematic library and the manufacturer must support a
compiler with C++11 enabled. If using an ARM Cortex-M architecture as target
micro-controller, the ARM tool-chain must allow Newlib nano (nano.specs enabled).
As nowadays micro-controllers supporting these features are getting more cheaper,
the preferable micro-controller must depict those capabilities in order to avoid future
problems with libraries support such as JSON parsing and remote communication. This
allows major timing reduction in project development and avoid libraries incapability
and implementation complexity. One could argue that C++ is too heavy for a micro-
controller, but with the correct compiler optimization and light-weight standard library
usage this is not true anymore.

• Integrated circuit support: By using a dedicated integrated circuit to measure the energy,
a communication to the micro-controller is needed. To avoid development slow downs
in IC communication testing and configuration, sample codes from manufacturer must
36

be used as reference implementation. This also reduces the chance in generating bugs
that causes undefined behavior when reading or configuring the IC.

2.5 Project schedule


The project schedule dates and description is presented in Table 2.2.

Table 2.2: Project schedule and description

2.6 Software and tools


In order to develop the prototype of this hardware, certain softwares are needed as listed
and described bellow:
• Altium Designer: The PCB design and 3D planning is realized in this application;

• Circuit maker: A collaborative schematic tool to allow this project teammates to


concurrently design the hardware;

• LaTex: Used to generate documentation of this project;

• Natural Docs: Used to generate documentation of all source code created in this project;

• Multisim, SIMetrix and PSpice: Allows the simulation of digital and analog circuits
behavior;

• WebStorm IDE: Web application development IDE that also enables remote debugging;

• NWJS: Template for a web executable application;

• RamNodes Webserver: The current project’s Virtual Privet Server used to test the web
server application frameworks and cutom linux kernel compilation if needed.
37

Programming languages

Currently, this project involves the use of programming languages (or auxiliary languages)
such as C/C++, Python (Maybe), Javascript, HTML, CSS and SQL. The authors of this project
also have experience or familiarity with this languages.
38

Chapter 3

Conclusion

The preparation of this report was extremely important for the organization of our work
project. With the realization of it, we had to search more about the subject and we had looked
for existing technologies in this field, to better understand the problem to which our solution
will be inserted. This was important also for a maturation of the idea of the project that we will
develop and a better collaboration with the involved students, since we had to discuss several
times, punctuate some things to reach some consensus.
It will be also a big challenge to meet the deadlines and the purchase of components
from international suppliers. For this to be achieved successfully, we observe that we will have to
work on our project with discipline, caution, respect for the time-line and anticipate things that
involve procedures that depend on other people or organizations: components imported as are
one example of it.
After completing this report, we have seen that it will be a great challenge. However, we
are motivated by our desire for optimization, implementation of new technologies in pre-existing
solutions and problem solving.
39

References

Benoit, A. (2015). NW. js Essentials. Packt Publishing Ltd.

Brucker, A. D. e Herzberg, M. (2016). On the static analysis of hybrid mobile apps. Em


International Symposium on Engineering Secure Software and Systems, páginas 72–88.
Springer.

Daud, S., Yang, T. S., Romli, M. A., Ahmad, Z. A., Mahrom, N. e Raof, R. A. A. (2018).
Performance evaluation of low cost lora modules in iot applications. Em IOP Conference
Series: Materials Science and Engineering, volume 318, página 012053. IOP Publishing.

Harlow, J. H. (2012). Electric power transformer engineering. CRC press.

Iniewski, K. (2013). Smart grid infrastructure & networking. McGraw-Hill.

Jung, W. G. (2005). Op Amp applications handbook. Newnes.

Kolban, N. (2017). Kolban’s book on esp32.

Kuan, J. (2012). Learning Highcharts. Packt Publishing Ltd.

Leão, R. P. S., Sampaio, R. F., Antunes, F. L. M. et al. (2014). Harmônicos em sistemas elétricos.

Maier, A., Sharp, A. e Vagapov, Y. (2017). Comparative analysis and practical implementation
of the esp32 microcontroller module for the internet of things. Em Internet Technologies and
Applications (ITA), 2017, páginas 143–148. IEEE.

Mhetre, S. B., Kulkarni, H. H. e Bharadwaj, D. (2015). A simple and low cost solution for
measurement of harmonics in distribution sector. Em Computing Communication Control and
Automation (ICCUBEA), 2015 International Conference on, páginas 499–505. IEEE.

Qi, H., Gao, N. e Zhang, Y. (2015). Design of intelligent power supply unit based on zigbee
technology. Em 2015 International Conference on Education, Management, Information and
Medicine.

Saha, M. M., Izykowski, J. J. e Rosolowski, E. (2009). Fault location on power networks. Springer
Science & Business Media.
40

Sheingold, D. H. e Devices, A. (1986). Analog-digital conversion handbook, volume 16.


Prentice-Hall Englewood Cliffs, NJ.

Shelby, Z. e Bormann, C. (2011). 6LoWPAN: The wireless embedded Internet, volume 43. John
Wiley & Sons.

Toledo, F. (2012). Desvendando as Redes Elétricas Inteligentes-Smart Grid Handbook. Brasport.

Vasseur, J.-P. e Dunkels, A. (2010). Interconnecting smart objects with ip: The next internet.
Morgan Kaufmann.

Xupeng, C. e Xiu, J. (2010). Application of the wireless sensor network topology based on the
power acquisition system. Em Electrical and Control Engineering (ICECE), 2010 International
Conference on, páginas 2671–2675. IEEE.

Anda mungkin juga menyukai