Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

An Arduino-Based System For Monitoring and Protecting Overvoltage and Undervoltage

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

Engineering, Technology & Applied Science Research Vol. 9, No.

3, 2019, 4255-4260 4255

An Arduino-Based System for Monitoring and


Protecting Overvoltage and Undervoltage

Doan Duc Tung Ngo Minh Khoa


Faculty of Engineering and Technology Faculty of Engineering and Technology
Quy Nhon University Quy Nhon University
Quy Nhon City, Binh Dinh, Vietnam Quy Nhon City, Binh Dinh, Vietnam
doanductung@qnu.edu.vn ngominhkhoa@qnu.edu.vn

Abstract—In this paper, an experimental system based on classified according to IEEE Std. 1159-2009. Authors in [5]
Arduino Uno microcontroller board was developed for proposed an algorithm based on a deep belief network for
measuring electrical quantities and protecting overvoltage and online voltage sags recognition. The causes and waveform
undervoltage conditions in a single-phase power supply. The characters of voltage sags were analyzed. Then according to the
main components are described in detail, including the hardware characters of different sag waveforms, ten voltage sag
and software to build the system in which an Arduino Uno characteristic parameters were proposed and proven to be
platform is implemented as a vital microcontroller to read effective, and finally a deep belief network model was built
voltage and current measurement from a voltage sensor using the parameters to complete automatic recognition of the
(ZMPT101B) and a current sensor (ACS712) respectively. In sag event types. An adaptive approach for voltage sag
addition, the Arduino is also used to send all measurement to a
automatic segmentation was presented in [6]. An adaptive
PC through a serial port for monitoring the measured data
graphically. The proposed method for designing the software uses
threshold for different waveforms was addressed, in which sag
the root mean square (RMS) method for measuring electrical depth, mean square error, and entropy of the sag waveform
quantities and then the RMS voltage measurement is compared were considered. Because of the effects of voltage sags on
with the minimum voltage and the maximum voltage to switch on power system operation, the dynamic voltage restorer, one of
or switch off the load. The monitoring GUI is designed with the the most effective solutions for mitigating voltage sag in power
use of the free and open-source Telemetry Viewer v0.5 software system, was proposed in [7-8]. Authors in [7] presented a
to monitor RMS voltage, RMS current, active power, and trip configuration and control strategy for dynamic voltage restorer
signal of the experimental system. The experimental results in which used a closed-loop PI control law in the d-q reference
this paper demonstrate that the system operated correctly. frame and a linear Kalman filter was employed to estimate
three-phase voltage sag. In [8], a new control method of
Keywords-experiment system; overvoltage; undervoltage; real- multifunctional dynamic voltage restorer for voltage quality
time measurement; voltage relay correction was presented. The control method was designed in
the stationary frame by combining proportional resonant
I. INTRODUCTION
controllers and sequence-decouple resonant controllers. The
In modern power systems, voltage quality is becoming method can mitigate many different conditions such as voltage
increasingly important with their growth in power electronics swell, voltage sag due to symmetrical and unsymmetrical short
and their high sensitivity of electronic equipment. Voltage circuit, starting of motors, and voltage distortion. The aim of
quality covers a wide range of voltage disturbances and this work was to design and implement an experimental system
deviations in voltage magnitude or waveform from the based on an Arduino Uno microcontroller board that can
optimum values. Disturbances related to voltage quality could monitor electrical quantities and protect over/under voltage in a
occur as a consequence of the operation of the power grid power supply. The voltage sensor (ZMPT101B) and the current
and/or of units connected to the grid. On the other hand, sensor (ACS712) are embedded as the sensors which transmit
voltage irregularities are the major issues the industry and continuously real-time data of a single-phase power supply to
home users are facing and are often responsible for damages in the Arduino Uno board, and then the data are processed to
sensitive equipment [1-2]. Overvoltage or undervoltage often measure all necessary measurements.
result in damaging equipment. Electronic loads increase day by
day and they are very sensitive to voltage variations [3]. II. HARDWARE DESIGN
In [4], authors proposed a method for monitoring voltage The hardware of the experimental system is designed to
disturbances based on discrete wavelet transform and adaptive measure electrical quantities and then to protect overvoltage
linear network. The types of voltage disturbances studied and undervoltage conditions in single-phase power supply as
included voltage sag, voltage swell and voltage interruption. shown in Figure 1. It includes the following main components:
After applying the method, the voltage disturbances were The voltage sensor ZMPT101B used in this work is a voltage
transformer ideal to measure the single-phase AC voltage. It
Corresponding author: Ngo Minh Khoa
www.etasr.com Tung & Khoa: An Arduino-Based System for Monitoring and Protecting Overvoltage and Undervoltage
Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4255-4260 4256

has high accuracy, good consistency for voltage and power duration is 20ms. This means there are 5 samples per cycle of
measurement and it can measure up to 250V AC. It is simple to the fundamental frequency.
use and comes with a multi turn trim potentiometer for
adjusting the analog-digital converter output. Its features
consist of measurement within 250V AC, onboard micro-
precision voltage transformer, analog output corresponding
quantity can be adjusted, good consistency, for voltage and
power measurement and high efficiency and accuracy. The (a)
current sensor ACS712 provides economical and precise
solutions for AC or DC current sensing in industrial,
automotive, commercial, and communications systems. The
device package allows easy implementation by the customer.
Its typical applications include motor control, load detection
and management, switched-mode power supplies, and
overcurrent fault protection. In this paper it is used to measure
the AC current of the single-phase power supply. The Arduino (b)
Uno is a microcontroller board based on the ATmega328. It has
20 digital input/output pins (of which 6 can be used as PWM
outputs and 6 can be used as analog inputs), a 16MHz
resonator, a USB connection, a power jack, an in-circuit system 1. LCD, 2. Trip button, 3. Close button, 4. Auto/Manual
programming (ICSP) header, and a reset button. It contains switch, 5. Switch of the bulb, 6. 220VAC 60W bulb, 7.
everything needed to support the microcontroller, it just simply Voltage sensor ZMPT101B, 8. Current sensor ACS712, 9.
needs to be connected to a computer (or appropriate wall power Relay, 10. Arduino Uno, 11. USB cable, 12. Breadboard
adapter) with a USB cable or with a AC-to-DC adapter or Fig. 2. The overvoltage and undervoltage protection system: (a) front (b)
battery to get started. In addition, other components are used to back
build the experimental system such as an LCD to display all
data measurements, a relay to switch the circuit when It is assumed that the equations representing the value of
overvoltage or undervoltage occurs, push buttons for the kth sample of voltage and current from the analog pin A0
automatic/manual mode, trip and close command of the and A1 of the Arduino are: The voltage value at the kth sample
system. The completed experimental system for protecting is below:
overvoltage and undervoltage in this work built from the v ( k ) = Vm sin ( k ωTs ) (1)
aforementioned components is shown in Figure 2.
where Vm is the voltage amplitude, ω=2πf (f is the fundamental
AC-to-DC supply
frequency), Ts is the sampling time (s), and k is the kth sample.
The RMS voltage value can be measured as follows:
Single-
phase Voltage sensor Display block N
1
∑ vk2
Arduino
AC
voltage Uno Vrms = (2)
source Current sensor micro- Relay block N k =1
processor
board
PC monitoring Auto/Trip/Close where vk is the voltage at the kth sample and N is the total
number of samples.
Fig. 1. The single-phase overvoltage and undervoltage protection system
based on Arduino Uno. The current value at the kth sample is:

III. SOFTWARE DESIGN i ( k ) = I m sin ( k ωTs − ϕ ) (3)

A. Real-Time Measurement of Electrical Quantities where Im is the current amplitude, and φ is the initial phase
In general, the output signals of the voltage sensor angle of the current.
ZMPT101B and the current sensor ACS712 are sinusoidal The RMS current value can be measured as:
voltage waveforms which have their amplitude between 0V
and 5V in order to coincide with the analog input of the N
1
Arduino Uno. The signals are continuously sampled with a I rms =
N
∑ ik2 (4)
k =1
specific sampling time which depends on the processing speed
of the microcontroller board. For the Arduino Uno where ik is the current at the kth sample.
microcontroller board, both voltage and current signals from
the voltage and current sensors have sampling time Ts=4ms. The instantaneous power at the kth sample is:
The AC voltage source used to supply the experimental system
in this work has a fundamental frequency f=50Hz so the cycle p ( k ) = v (k ) × i (k ) (5)

Therefore, the active and apparent power are defined as:

www.etasr.com Tung & Khoa: An Arduino-Based System for Monitoring and Protecting Overvoltage and Undervoltage
Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4255-4260 4257

1 N
1 N Step 6. If k=N, go to Step 7. Otherwise, set k=k+1 and go
P=
N
∑ p ( k ) = N ∑ v ( k ) i (k ) (6) back to Step 5.
k =1 k =1
Step 7. Calculate RMS voltage (Vrms), RMS current (Irms),
S = Vrms × I rms (7) active power (P), and apparent power (S) using (11).
B. The Proposed Algorithm vsquare isquare pinst
In this research work, the Arduino software is applied to Vrms = ; I rms = ;P = (11)
N N N
write code and the code is then uploaded to the Arduino Uno
board. The code is written according to the algorithm shown in Step 8. If Auto=1, go to Step 9. Otherwise, go to Step 12.
Figure 3 to measure electrical quantities such as voltage, Step 9. If V rms<Vmin the relay will be tripped (Relay=1).
current, and active power and to protect overvoltage and Otherwise, go to Step 10.
undervoltage. The proposed algorithm includes three main
stages. Stage 1 is to initialize parameters which represent the Step 10. If Vrms> Vmax, the relay will be tripped (Relay=1).
selection of auto/manual operation mode (if Auto=0 the manual Otherwise, go to Step 13.
mode is selected and if Auto=1 the automatic mode is selected),
the trip signal to the relay (if Relay=0 the circuit is closed and if Step 11. If Trip=1, the relay will be tripped (Relay=1).
Relay=1 the circuit is open), and the position of the trip button Otherwise, go to Step 12.
and close button (if Trip=1 the trip button is pressed and if Step 12. If Close=1, the relay will be closed (Relay=0).
Close=1 the close button is pressed). Then, the electrical Otherwise, go to Step 13.
quantities including voltage, current, and power are measured
in Stage 2. In this stage, voltage and current samples from the Step 13. If we need to stop, go to Step 14. Otherwise, back
voltage sensor and the current sensor are continuously read to Step 3.
from pins A0 and A1 of the board. Then the samples are used Step 14. End.
to calculate RMS voltage, RMS current, apparent power, and
active power based on the method mentioned in the previous Start
section. After the RMS voltage is measured at Stage 2, it is
used as an input of Stage 3 to detect and protect overvoltage Auto = 0; Relay = 0
and undervoltage. In Figure 3, the protection can be Trip = 0; Close = 0
accomplished by automatic or manual mode. For automatic
mode, the RMS voltage will be compared with the minimum vsquare = 0; isquare = 0
voltage (Vmin) and the maximum voltage (Vmax) to detect and pinst = 0; k =1
protect overvoltage and undervoltage automatically. The
proposed algorithm’s steps are: Read v(k) from Pin A0
Read i(k) from Pin A1
Step 1. Start.
Step 2. Initialize the parameters including the selection of v square = v square + v(k)×v(k)
i square = isquare + i(k)×i(k)
auto/manual operation mode (Auto), the trip signal to the relay
pinst = p inst + v(k)×i(k)
(Relay), and the position of the trip button and close button k =k+1
(Trip and Close): No
k=N ?
Auto = 0; Relay = 0; Trip = 0; Close = 0 (8) Yes

Step 3. Set the variables including voltage square (vsquare), V rms =


vsquare
; I rms =
i square
N N
current square (isquare), instantaneous power (pinst), and sample p inst
(k): S = V rms×I rms ; P=
N

vsquare = 0; isquare = 0; pinst = 0; k = 1 (9) Yes No


Auto = 1 ?

Step 4. Read the voltage sample v(k) and the current sample Yes Yes
Relay = 1 V rms < V min? Trip = 1 ? Relay = 1
i(k) from pins A0 and A1 of the Arduino Uno board where the
voltage sensor ZMPT101B and the current sensor ACS712 are No No

connected. Relay = 1
Yes
V rms > V max? Close = 1 ?
Yes
Relay = 0

Step 5. Update vsquare, isquare , and pinst using the values of No No

voltage and current samples in Step 3 as follows:


No
vsquare = vsquare + v ( k ) × v ( k )
Stop ?

 Yes

isquare = isquare + i ( k ) × i ( k ) (10) End



 pinst = pinst + v ( k ) × i ( k ) Fig. 3. The proposed algorithm of the experimental system for measuring
electrical quantities and protecting overvoltage and undervoltage.

www.etasr.com Tung & Khoa: An Arduino-Based System for Monitoring and Protecting Overvoltage and Undervoltage
Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4255-4260 4258

IV. RESULTS AND DISCUSSION current waveform using its magnification from 5.2s to 5.6s as
To test the overvoltage and undervoltage protection shown in Figure 5(c). The time in Figure 5(c) is 0.4s
function of the experimental system, an experimental setup was corresponding to 20 cycles, therefore, there are 100 samples in
established as shown in Figure 4. In Figure 4, three additional the Figure. From these samples of voltage and current, the
parts, namely a variable transformer, a PC monitoring, and a proposed algorithm is applied to measure the aforementioned
voltmeter are added to the setup. The key task of the variable electrical quantities RMS voltage, RMS current, active power,
transformer is to generate a variable voltage source. Therefore, etc. and then the RMS voltage is used for detecting and
various voltage conditions including normal voltage, protecting overvoltage and undervoltage.
overvoltage, and undervoltage can be created by tuning the
knob on the front of the variable transformer. Then, its output
voltage is used to supply the experimental system. All electrical
quantities are measured and displayed locally on the LCD on
the front of the system. Moreover, the status of the electrical
circuit which is closed or open is also monitored and displayed
on the LCD. In order to validate the voltage measurement of
the experimental system, the voltmeter is added and connected
to the output of the variable transformer. The measurement
results from the experimental system and the voltmeter can be
compared. Moreover, the monitoring software on a PC
connected to the experimental system through a USB cable is
designed to monitor all electrical quantities remotely. All
measurements are continuously transmitted from the Arduino
Uno board to the PC and are displayed on the PC's monitor
graphically. From the monitoring software, we can observe and
save all measurement data to a csv file, therefore, we can use
the data for any further analysis.

Fig. 4. The set of the experimental system for testing overvoltage and
undervoltage protection.

In order to measure RMS voltage and current of a circuit,


Fig. 5. Voltage and current waveforms. (a-b) Voltage waveform from the
the voltage and current signals from the voltage sensor and pin A0; (c-d) current waveform from the pin A1.
current sensor are sampled in the Arduino Uno. With the
processing speed of the Arduino Uno, the sampling time for The proposed algorithm is uploaded to the Arduino Uno
both voltage and current signals equals to 4ms. This means microcontroller board and is used to measure electrical
there are 5 samples of voltage or current per cycle. The AC quantities. The measurement results of the RMS voltage and
power supply generated by a variable transformer is nominally current are recorded and are presented in Figures 6(a) and 6(b),
230V AC 50Hz. Using the variable transformer to generate respectively. With 4ms sampling time of the experimental
different voltage conditions, in this paper, one voltage system, the RMS voltage is calculated and is shown as the blue
condition is established by reducing the voltage magnitude in a line in Figure 6(a). However, to display the RMS voltage value
period of about 10s. The voltage waveform is recorded in the on the LCD on the front of the experimental system, the RMS
csv format file by the monitoring software and then it is plotted voltage value is updated every 1.0s. In this case, the source
in Matlab as shown in Figure 5(b). Moreover, we can voltage is reduced from 5s to 14s as shown in Figure 6(a),
obviously see the voltage waveform using its magnification therefore, the RMS voltage measured from the proposed
from 5.2s to 5.6s as shown in Figure 5(a). To consider the method is also reduced. Consequently, the experimental system
current through the circuit, a bulb is assumed as a fixed load of can use the RMS voltage value to detect and protect the load
the experimental system. In addition, other loads can be from an overvoltage or undervoltage condition in the power
connected to the system through the outlet on the front of the supply, if the voltage is over the maximum value (Vmax) or
system. When the load changes, the current waveform through under the minimum value (Vmin). Depending on the nominal
the circuit recorded by the monitoring software also changes. voltage of the grid, Vmax and Vmin can be set at different values
Figure 5(d) shows a current waveform plotted in Matlab from and in this study they are set at 220V and 180V respectively.
the data of the csv file. Similarly, we can obviously see the Moreover, the current through the circuit is also measured in

www.etasr.com Tung & Khoa: An Arduino-Based System for Monitoring and Protecting Overvoltage and Undervoltage
Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4255-4260 4259

order to calculate the power consumed by the load of the


system. The current waveform shown in Figure 5(d) is applied
to test the method for calculating the RMS current and this
result is shown in Figure 6(b). Similarly, the current is also
updated to display on the LCD of the system per 1.0s shown by
the black dots in Figure 6(b).

(a)

(b)

Fig. 6. Voltage and current measurements using the proposed algorithm


on Arduino Uno.

According to the design of the experimental system


presented above, there are two operation modes, the automatic Fig. 7. The experimental results of the manual mode: (a) RMS voltage, (b)
mode and the manual mode. In the manual mode, the two RMS current, (c) active power, and (d) trip signal.
buttons, namely the trip and closed button in the front of the
system are used to switch the relay manually. In this design, the In order to evaluate the automatic mode, the overvoltage
trip signal generated by pressing the trip button will be and undervoltage conditions generated by the variable
processed in the Arduino Uno microcontroller board and then transformer are recorded in a period of 20s and are displayed
transmitted to the relay to switch off the circuit. On the other on the PC monitoring software. The experimental results are
hand, the closed signal generated by pressing the closed button saved in a csv file and Matlab is used to plot all the results as
will be also processed in the Arduino Uno microcontroller and shown in Figure 8 which exhibits the experimental results
then transmitted to the relay to switch on the circuit. Therefore, including RMS voltage, RMS current, active power, and the
if there is an overvoltage or undervoltage condition in the trip signal as shown in Figures 8(a)-(d) respectively. In this
power supply, the trip button can be used manually to protect normal condition, the load of the system is a 220V AC 60W
the load. After that, if the voltage of the power supply is bulb, therefore, the RMS current and the active power shown in
remained within Vmin and Vmax, the closed button can be also Figures 8(b)-(c) are consumed by the bulb. However, the RMS
used manually to switch on to continue supplying power. To current and the active power are equal to zero when there is an
evaluate the manual mode of the experimental system, a undervoltage or overvoltage condition in the power supply. As
sequence of the trip-closed-trip-closed order is established shown in Figure 8(a), an undervoltage occurs between 20s and
while the voltage of the power supply will remain within 40s and an overvoltage occurs between 55s and 75s. The
acceptable limits as shown in Figure 7(a). Because the trip and overvoltage and undervoltage protection of the experimental
closed buttons are pressed according to the order shown in system is shown obviously in Figure 8(d) which demonstrates
Figure 7(d), the relay will switch off and switch on the circuit, the trip signal transmitted to the relay in the system to protect
therefore, the current and the active power of the circuit will be the bulb. In addition, when the voltage of the power supply
changed as shown in Figures 7(b) and 7(c) respectively. In the remains within Vmin and Vmax, the closed signal is transmitted to
automatic mode, the system will trip overvoltage and the relay to continue supplying the bulb with power. This is
undervoltage conditions to isolate the load out of the power also demonstrated as the period from 40s to 55s in Figure 8(a).
supply. Then the load will be supplied again if the voltage of
power supply is between Vmin and Vmax.

www.etasr.com Tung & Khoa: An Arduino-Based System for Monitoring and Protecting Overvoltage and Undervoltage
Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4255-4260 4260
[4] D. T. Viet, N. H. Hieu, N. M. Khoa, “A method for monitoring voltage
200 disturbances based on discrete wavelet transform and adaptive linear
neural network”, International Review of Electrical Engineering, Vol.
100 11, No. 3, pp. 314-322, 2016
Undervoltage Overvoltage
[5] F. Mei, Y. Ren, Q. Wu, C. Zhang, Y. Pan, H. Sha, J. Zheng, “Online
0 recognition method for voltage sags based on a deep belief network”,
20 40 60 80 100
Energies, Vol. 12, No. 1, pp. 1-16, 2018
Time (s)
(a) [6] X. Xiao, W. Hu, H. Zhang, J. Ai, Z. Zheng, “An Adaptive Approach for
Voltage Sag Automatic Segmentation”, Energies, Vol. 11, No. 12,
0.4 ArticleId 3519, 2018
0.2 [7] D. T. Viet, N. H. Hieu, N. L. Hoa, N. M. Khoa, “A Control Strategy for
Dynamic Voltage Restorer”, 11th IEEE International Conference on
0 Power Electronics and Drive Systems, Sydney, Australia, June 9-12,
0 20 40 60 80 100
2015
Time (s) [8] D. V. Tien, R. Gono, Z. Leonowicz, “A Multifunctional Dynamic
(b) Voltage Restorer for Power Quality Improvement”, Energies, Vol. 11,
100 No. 6, ArticleId 1351, 2018
[9] C. Moron, D. Ferrandez, P. Saiz, G. Vega, J. P. Diaz, “New Prototype of
50 Photovoltaic Solar Tracker Based on Arduino”, Energies, Vol. 10, No. 9,
ArticleID 1298, 2017
0 [10] P. P. Machado, T. P. Abud, M. Z. Fortes, B. S. M. C. Borba, “Power
0 20 40 60 80 100 Factor Metering System Using Arduino”, IEEE Workshop on Power
Time (s) Electronics and Power Quality Applications, Bogota, Colombia, May
(c) 31-June 2, 2017
1.5 [11] E. Viciana, A. Alcayde, F. G. Montoya, R. Banos, F. M. Arrabal-
Auto trip 1 Auto trip 2
1 Campos, F. Manzano-Agugliaro, “An Open Hardware Design for
0.5 Internet of Things Power Quality and Energy Saving Solutions”,
0 Sensors, Vol. 19, No. 3, ArticleId 627, 2019
Auto close 1 Auto close 2 [12] T. J. Ho, C. H. Chang, “Robust Speed Tracking of Induction Motors: An
-0.5
0 20 40 60 80 100 Arduino-Implemented Intelligent Control Approach”, Applied Sciences,
Time (s) Vol. 8, No. 2, ArticleID 159, 2018
(d)

Fig. 8. Experimental results of the automatic mode: (a) RMS voltage, (b)
RMS current, (c) active power, and (d) trip signal.

V. CONCLUSIONS
In this research work, an experimental system based on the
Arduino Uno microcontroller board was developed for
measuring electrical quantities and protecting onvervoltage and
undervoltage of a single-phase power supply. The hardware
and software of the system were designed and tested in a
laboratory at our University. In order to evaluate the
effectiveness of the system, we generated many different
scenarios including automatic and manual mode to demonstrate
and test the operation of the system. The real-time
measurement results are locally monitored at an LCD on the
front of the experimental system. Moreover, they can be
graphically monitored through the monitoring GUI software on
a PC and they can be also saved in a csv file for further
analysis. The main contribution of this work is the propose of
an experimental method to build a system based on an Arduino
Uno microcontroller board for protecting overvoltage and
undervoltage in single-phase power supplies and to implement
a simple method which is uploaded to the board for measuring
electrical quantities.
REFERENCES
[1] C. Sankaran, Power Quality, CRC Press, 2001
[2] A. G. Siraki, P. Pillay, “Comparison of two methods for full-load in situ
induction motor efficiency estimation from field testing in the presence
of over/undervoltages and unbalanced supplies”, IEEE Transactions on
Industry Applications, Vol. 48, No. 6, pp. 1911-1921, 2012
[3] M. H. J. Bollen, I. Y. H. Gu, Signal Processing of Power Quality
Disturbances, Wiley-IEEE Press, 2006

www.etasr.com Tung & Khoa: An Arduino-Based System for Monitoring and Protecting Overvoltage and Undervoltage

You might also like