Design of a Sag and Surge Detector For Residential Voltage
DDesign of a Sag and Surge Detector For Residential Voltage
Daniel P´erez
School of Electrical Engineering, Engineering Faculty, Universidad Rafael Urdaneta, Maracaibo, Zulia, Venezuela
Abstract
An inexpensive protection device capable of disconnecting a load upon detecting a voltage sag or surge is presented. Saiddevice is aimed towards the residential voltage of Venezuela’s electrical system. The device is based on the Arduino platform,and uses an ATmega 328P. It detects the presence of a voltage sag or surge by sampling the residential voltage used to feedthe load, and continuously measuring the RMS voltage. It disconnects the load after 3 semi-cycles where the residentialvoltage is outside the boundaries established by Venezuela’s national electrical code, and therefore there’s the presence of avoltage sag or surge. The device is capable of transmitting the data of the sampled signal, for making further analysis. Key words:
Power quality; sag; surge; Venezuela; Arduino.
In present day Venezuela various power disturbancessuch as voltage sags and surges are very prominent. Eventhough there isn’t any official data disclosed on the topic,it is agreed among many Venezuelans that one of themain sources of damage of electric appliances are volt-age sags and surges. These disturbances arise becauseVenezuela’s electrical system is in a bad state, which isdue to mismanagement. The only permanent solution tothis issue would be to make the necessary improvementsto the electrical system in order to restore its properfunctioning.For this reason it can be asserted that any permanentsolution to the main power quality issues of Venezuelais mid-term, at least. For as long as the improvementsaren’t done or even started to do, the voltage sags andsurges are going to keep reappearing. This problem gene-rates the necessity of creating a short-term solution, onethat doesn’t have to be permanent but that definitelyhas to have swift means of implementation. The solutionhas to be very low cost as well, due to the precarious si-tuation of the Venezuelan economy.The design of a voltage sag and surge detector basedon the Arduino platform is presented as a possible so-lution. Said device disconnects any load attached to it,whenever the RMS value of the residential voltage sig-nal is outside the boundaries established by Venezuela’snational electrical code (NEC) [1], for a period of timeequal or higher than 3 semi-cycles. The boundaries set Email address: [email protected] (Daniel P´erez). by Venezuela’s NEC coincide with the ones establishedby IEEE [2]. Nonetheless, being that in Venezuela theresidential systems can either use 110 or 120 VRMS, itwas decided to use 110 VRMS to set the lower boundaryand 120 VRMS to set the upper boundary.To do the detection, the device samples the residentialvoltage signal at a rate of 3600 Hz, using the code of apower quality monitor developed to address Venezuela’spower quality issues as well [4]. After establishing thepresence of either a sag or surge, the device disconnectsthe load attached to it by triggering a relay connectedin series with the load. The device doesn’t reconnect theload until the residential voltage signal is in compliancewith the set boundaries. The device is capable of trans-mitting the sampled data it retrieves, which can be usedfor either a deep analysis after the fact, or real-time mo-nitoring.The device distinguishes itself from other protection de-vices using the term “detector”, because usually protec-tors that are marketed as voltage sag or surge protectorsoffer some sort of relief upon the disturbance, such aspeak suppression, instead of just disconnecting the load.
The hardware used for this device is comprised by a smalland simple circuit used for sampling the residential volt-age signal, a circuit for managing the load attached tothe device and the ATmega328P that controls the entiresystem.In figure 1 can be seen the PCB design of the entiresystem. It is shown directly instead of presenting the a r X i v : . [ ee ss . SP ] A ug chematic first to maintain simplicity in the presenta-tion, and because it lets showcase the positioning of theelements of the system. Figure 1. Preview of PCB design that encompasses entiredesign. Doesn’t include DC sources
For this design it was assumed that separate modulesare going to be used to provide the DC voltages requiredby the system. Being that this design doesn’t include amodel for the case, this gives total freedom in terms ofmaking a design for it. Also, it is worth noting that eachpin used for the serial port interface (SPI) is connectedto a pad, in such way that is easy to solder any mod-ule that can be used for transmitting the sampled data,which opens up the possibility of assembling an Internetof Things infrastructure [3] with this design. If a compo-nent to send the data isn’t to be added, then the pads ofthe pins of the SPI should be shorted to ground to avoidleaving them floating.To lower the amount of noise in the system as much aspossible, a series of measures taken in the power qua-lity monitor [4] were employed here as well. Those mea-sures were taken because floating pins generate noiseand can trigger didt transients in the system [5], andare based on various concepts of transmission lines[6],grounding[7], power electronics[8] and electromagneticcompatibility[9],[10]. It should be pointed out that in or-der to reduce the overall inductance of the system trackswere kept as short as possible, and to increase the over-all capacitance the gap between power lines was kept asshort as possible.The circuit utilized for sampling is the same used for apower quality monitor targeted for Venezuela’s residen-tial voltage [4]. Said circuit transforms a 120 VRMS at60 Hz sine wave into one of 0.6 VRMS at 60 Hz with anoffset of 3.3 V. This measure was taken to stay in com-pliance with the limits of the analog to digital converter(ADC) of the ATmega 328P [11]. This design was pre-ferred because using a transformer would unnecessarilyadd noise to the system, and it would incorporate lossesas well. The use of resistors in this scenario is valid be-cause the measurement of an analog signal is done witha shunt connection, and the value of the internal resis-tance of the ADC of the ATmega 328P is 100MΩ, which is 20000 times higher than the value of the resistor thatperceives the input analog signal.To manage the load, a relay with a normally open switchis connected in series with it. The ATmega 328P onlycloses the switch when the code determines that properconditions for powering the load are met, according tothe set boundaries. As can be seen in figure 1, there’s adiode connected to the coil of the relay, and it has thefunction to prevent that a negative voltage is seen bythe pins of the ATmega 328p, scenario that can happendue to a didt transient.A couple of LEDs are used to indicate if the residen-tial voltage signal is currently meeting the requirements.The red LED indicates that the voltage is beyond the10% above the 120 VRMS or 10% under 110 VRMS,while the green LED points that the system is providingadequate energy. Adding a small display to indicate thecurrent stats of the residential voltage signal is plannedto be added in the future. An alternative design usingan Arduino NANO V3 is shown in figure 2:
Figure 2. Preview of an alternative PCB design that uses anArduino NANO V3 board
This alternative version works exactly the same as theoriginal one. The main difference lies in the fact that up-dating the software is a simple and straightforward pro-cess in this alternative design, because it only requiresusing a PC with the Arduino IDE and a mini USB ca-ble. Also, it is capable of transmitting data only usingthe mini USB cable if desired.2
Software
Although this device can be connected to others in or-der to send data, its only function beyond providingoutput is to manage the connection of the load attachedto it, based on the current status of the residential volt-age signal it is sampling. Therefore, all the code that itrequires to do these tasks has to be run by the ATmega328P. For this version, all the code used is based on theArduino platform’s set of C/C++ instructions. Thisrequires flashing to the ATmega 328P the bootloader ofArduino, and the program to be used. There’s two coremechanics present in the software of this device: thedata sampling and data processing.
It is based on the code used for sampling in a powerquality monitor targeted for Venezuela’s residentialvoltage [4]. The code ensures that sampling occurs at3600 Hz, which is well beyond the Nyquist frequency forthis scenario [12], which would be 120 Hz. It is worthnoting that although a much higher sampling rate isn’trequired, the more values taken from the residentialvoltage, more precise the RMS value will be. Thecode used for this device is planned to be updated inthe future, being that the code it’s based on is subjectto future updates as well. This is because it is desired toensure compatibility between this device and the powerquality monitor. The data processing in this device is fairly simple, itonly requires to recognize when the semi-cycles begin,and to adjust the data accordingly to calculate the RMS value of each semi-cycle. In addition to this, the codethat corresponds to the data processing also keeps trackof the overall behavior of the RMS values.The expression used to calculate the RMS value foreach semi-cycle, is the following: V RM S
12 = (cid:113)(cid:80) n =1 V n
60 (1)Where V n corresponds to each sampled voltage, and 60represents the amount of samples taken per each semi-cycle.The code determines the presence of either a voltage sagor surge after the RMS value meets the criteria for ei-ther of these disturbances, for 3 consecutive semi-cycles.Once the presence is established the code orders the dis-connection of the load, and it doesn’t get reconnecteduntil the RMS values are in compliance with the set boundaries, for 360 consecutive semi-cycles. This way ofoperation was chosen based on the fact that all typesof loads don’t suffer any consequences from sags witha duration under 5 cycles [13], and because most volt-age surges that appear in Venezuela’s electrical systemcome after voltage sags, as a consequence of the FIDVRphenomenon [14]. This ensures that the impact of volt-age sags and surges to the load is kept at a minimum,but it also implies that this device is merely a palliative.The abrupt disconnection of an appliance isn’t a harm-free operation, it is just the most desirable option upona voltage sag or surge under the current scenario thatVenezuela is in.A graphical representation of the algorithm that governsthe sag and surge detection and load management canbe seen in figure 3: Figure 3. Algorithm used for detecting voltage sags andsurges, and sensing proper conditions for reconnecting theload
The design requires the addition of a case in order to beready for commercial use, although the core mechanicsare ensured to work with the current version. To thisdesign can be added any component that can be usedfor data transmission, which opens up the possibility ofbuilding an Internet of Things infrastructure based onit [3]. It can be used even as a sensor for a micro-gridsystem, due to the scope it can reach. The design is verysimple and uses low cost parts.
References [1] ——,
National Electrical Code FONDONORMA 200:2004.
CODELECTRA, 2004.[2] ——,
IEEE Standard 1159-2019.
IEEE, 2019.
3] V. Nundloll, B. Porter, G. Blair, J. Cosby, B. Emmett, B.Winterboum, G. Dean, P. Beattie, R. Shaw, D. Jones, D.Chadwick, M. Brown, W. Shelley and I. Ullah, “The Designand Deployment of an End-to-end IoT Infrastructure forthe Natural Environment’. arXiv preprint, arXiv:1901.06270,2019.[4] D. P´erez, “Power Quality Monitor for Residential Voltage”. arXiv preprint, arXiv:2005.06045, 2020.[5] P. Wilson,
The Circuit Designer’s Companion.
Newnes,2013.[6] ——,
Motorola application note AN1501: Transmission lineeffects in PCB applications,
Motorola, 1990.[7] R. Morrison,
Grounding and Shielding Techniques inInstrumentation.
Wiley-Interscience, 1986.[8] N. Ross,
The Essence of Power Electronics.
Prentice Hall,1997.[9] J. Goedbloed,
Electromagnetic Compatibility.
Prentice Hall,1992.[10] J. Kraus,
Electromagnetics.
McGraw Hill, 1991.[11] ——, megaAVR Data Sheet Rev. A.
Microchip TechnologyInc., 2018.[12] S. Smith,
The Scientist and Engineer’s Guide to DigitalSignal Processing.
California Technical Publishing, 1999.[13] G. Karady, S. Saksena, B. Shi and N. Senroy, “Effects ofVoltage Sags on Loads in a Distribution System”.
PowerSystems Engineering Research Center, Cornell University,2005.[14] A. G´omez and G. Puche, “Voltage surges in the Venezuelanoccidental electrical system taking into account the fault-induced delayed voltage recovery (FIDVR) phenomenon: ACase Study”.