Active Fault Detection Device for LV Electrical Installations with Goertzel-Based Impedance Estimation and IoT Connectivity †

: An active (harmonic-injection based) fault detection device, relevant to low voltage electrical installations is studied in this paper. This compact and flexible device is compatible with TN/TT earthing systems, and it is capable of detecting power theft (i.e., via meter tampering), neutral conductor loss at the upstream network and unintentional islanding. A 12th order zero-sequence voltage harmonic component is injected -via a low-power H-bridge inverter along with a current transformer (CT), in series with the grid voltage, whereas the corresponding harmonic current is measured, to estimate the impedance. The well-established, robust and fast Goertzel algorithm is selected as the impedance monitoring method, to effectively diagnose any fault. Finally, the device features Internet of Things connectivity capabilities, as it employs the ESP32 microcontroller, facilitating its communication and data exchange capabilities with the installation meter, as well as with various smart home devices.


Introduction
Nowadays, as the concept of Zero Energy Building (ZEB) dominates the residential sector, modern LV electrical installations incorporate various energy sources (mainly from renewables), tightly controlled electronic loads with specific characteristics and energy storage units, which are in many cases hybrid.Thus, significant challenges arise, that not only jeopardize human life, but also have the potential to impact the utility grid power quality and the uninterruptible supply of the installation [1][2][3][4].Some of the most common undesirable circumstances include the following: (a) neutral conductor loss in the upstream network of an electrical installation, (b) an unintentional islanding condition and (c) meter tampering (referred also as energy, power or electricity theft) [5][6][7].Consequently, given the ever-increasing penetration of distributed generators and energy storage systems into the electrical infrastructure, an urgent requirement for a device capable of effectively diagnosing such unpredictable situations becomes evident.
In addition, the implementation of such a detection device is expected to become imperative in the near future, due to the intense presence of the so-called load-matching condition in an electrical installation, that will rise in the context of ZEBs (i.e., prosumer buildings incorporating local generation and energy storage).In any case, this is considered inevitable as the ZEB trend is propelled by directives and stringent targets set by the European Union (EU), to substantially reduce the power demands and CO 2 emissions of contemporary building installations, including residential, commercial, and industrial sectors.
Regarding the fault conditions that the proposed device can effectively detect, the first one is the neutral conductor loss, which may result in significant consequences for the electrical installations and the consumers.The consequences depend primarily on the load balance conditions in a three-phase system, in addition to the type of employed grounding system and the relative position of the neutral interruption, in respect to the load.In the worst-case scenario, such an event may result in damaging the connected loads, due to over-voltages, as well as the development of hazardous voltage potential on exposed conductive equipment [5,8,9].
Moreover, undesirable islanding operation occurs when the installation (i.e., distributed generation, energy storage and local loads) operates in isolation from the utility grid, increasing further risks to the integrity of the electrical infrastructure and to human safety.Therefore, an anti-islanding method has become a mandatory feature, specified in IEEE Std.1547.1,IEEE Std.929-2000, and UL1741 standards, according to the relevant scientific literature [1,7,[10][11][12].
On the other hand, meter tampering manifests as an increase in unforeseen load, potentially resulting in equipment overloading within the electricity network, voltage profile instabilities, and escalated electricity generation costs.From the financial point of view, meter tampering is accountable.According to the research of the Northeast Group LLC, the financial damage is around 89 billion USD per year [13].The escalation of this phenomenon is associated, on the one hand, to the prolonged economic crisis, which fueled illegal behavior, while on the other hand, it is also linked with the delayed introduction of a legal framework for effectively dealing with this issue.As a result, in developing countries where energy costs are relatively high and the electricity bills may be unaffordable, many people are trying to avoid paying for the amount of electricity consumed.Similarly, due to the absence of a robust legal framework to address the issue effectively, some individuals may choose to persist in committing this unlawful act.
The aforementioned challenges must be seriously taken into consideration in order to create a reliable and safer distribution network, capable of fully covering the needs of a more sustainable future.However, despite the current technological advances in smart meters, these undesirable challenges have not been fully addressed yet.In more detail, smart meters are unable to effectively deal with the issue of theft through simultaneous bridging of the input/output terminals of the neutral and phase wires, leaving a significant scope for power theft to persist.Unfortunately, the solution cannot be achieved exclusively through on-site inspections, primarily due to the significant size and widespread distribution of electrical installations [6,14,15].
In light of this, the objective of this paper is to study and fully exploit the communication capabilities of the smart active fault detection kit, proposed in [16].This device provides a robust solution for the active (via harmonic injection) detection of neutral loss, islanding and meter tampering, by estimating the line impedance of the electrical installation, to evaluate its condition.Each impedance value corresponds to a specific system state (i.e., normal, islanding, neutral loss and power theft).In parallel, the device is capable of communicating and exchanging information, uploading and downloading data, via the Internet of Things (IoT) framework.In this way, it can calculate the installation power consumption and compare its value with the one obtained from the electricity meter, indicating power mismatches.
Regarding the impedance estimation process, in contrast to [16], in this paper the Goertzel algorithm is selected.It is capable of extracting both the magnitude and the phase of a desired harmonic frequency, from the measured voltage and current signals.Although the Goertzel algorithm features a higher order of complexity than the Fast Fourier transform (FFT) algorithm, it is more numerically efficient for computing a small number of selected frequency components (i.e., faster execution time).Furthermore, its simple structure makes it convenient for small processors and microcontroller applications [17].In this work, the Last but not least, it is worth noting that the studied device is suitable for any LV electrical installation (i.e., residential, industrial, commercial, either single-phase or 3-phase, independent of the nominal fundamental voltage and frequency values) and it is compatible with TN/TT networks.A block diagram of its integration is given in Figure 1.Finally, its single-phase version is examined in this work, whereas the experimental results indicate its functionality, focusing on its IoT connectivity features.of selected frequency components (i.e., faster execution time).Furthe structure makes it convenient for small processors and microcontroller In this work, the magnitude of 600 Hz (12th harmonic-injected) and 50 H current and voltage signals are extracted, to detect faulty conditions (fro pedance value) and estimate the installation consumption (from the 50 H values).
Last but not least, it is worth noting that the studied device is su electrical installation (i.e., residential, industrial, commercial, either s phase, independent of the nominal fundamental voltage and frequency compatible with TN/TT networks.A block diagram of its integration is Finally, its single-phase version is examined in this work, whereas the sults indicate its functionality, focusing on its IoT connectivity features.The paper is organized as Section 2 presents the basic operating pri monic injection-based studied device, along with the Goertzel impedanc flowchart of the overall control scheme, including communication, is Section 3 presents indicative experimental results, to validate the functio ied kit, along with its IoT communication features.Finally, Section 4 con

Fundamental Operating Principle
The detailed analysis of the active detection device operation has b [16] and thus, only the basic points will be presented and discussed in th ing mainly on the impedance estimation method, based on the well-esta algorithm.Generally, for M-phase systems (where M ≥ 1), the basic princ injection of higher order harmonic voltage components and measureme and current components in the specific harmonic order, to calculate th effectively detect islanding, neutral loss and meter tampering, accordi limits.For the sake of the analysis, a TN-S grounded network is assum smart device is placed within the electricity panel, the meter and the c tion.

Harmonic Component Injection and Measurement
As it is depicted in Figure 2, for a single-phase installation, the dev H-bridge inverter supplied by a 12 V battery, a low pass filter, a parallel ing a TRIAC switch in series with a capacitor, for detecting load prese The paper is organized as Section 2 presents the basic operating principle of the harmonic injection-based studied device, along with the Goertzel impedance estimation.The flowchart of the overall control scheme, including communication, is also given.Next, Section 3 presents indicative experimental results, to validate the functionality of the studied kit, along with its IoT communication features.Finally, Section 4 concludes the paper.

Fundamental Operating Principle
The detailed analysis of the active detection device operation has been performed in [16] and thus, only the basic points will be presented and discussed in this Section, focusing mainly on the impedance estimation method, based on the well-established Goertzel algorithm.Generally, for M-phase systems (where M ≥ 1), the basic principle lies upon the injection of higher order harmonic voltage components and measurements of the voltage and current components in the specific harmonic order, to calculate the impedance and effectively detect islanding, neutral loss and meter tampering, according to predefined limits.For the sake of the analysis, a TN-S grounded network is assumed, whereas the smart device is placed within the electricity panel, the meter and the consumer installation.

Harmonic Component Injection and Measurement
As it is depicted in Figure 2, for a single-phase installation, the device comprises an H-bridge inverter supplied by a 12 V battery, a low pass filter, a parallel branch (comprising a TRIAC switch in series with a capacitor, for detecting load presence), voltage and current sensors and a CT.The 600 Hz sinewave, which corresponds to the 12th harmonic order in a 50 Hz network, is generated via the SPWM H-bridge inverter and the properly designed output LC filter.Harmonic injection in series with the installation line is achieved via the CT.Its primary (low impedance) winding is series connected with the phase, while the harmonic voltage source is connected to the high impedance.
designed output LC filter.Harmonic injection in series with the ins achieved via the CT.Its primary (low impedance) winding is series con phase, while the harmonic voltage source is connected to the high impeda It is worth noting that the transformer turns ratio is appropriately sele which is desirable, in order to generate a low-magnitude 600 Hz harmon ponent in the primary side.On the other hand, voltage and current meas secondary are utilized to extract the magnitude of specific harmonic com Hz and 600 Hz), to effectively calculate the impedance and identify the sy detailed mathematical analysis of the harmonic injection procedure has b in [16].
It is noted that both voltage and current sensors can be positioned power line too.The function is the same, without notable performanc hough, this leads to a bulkier and less cost-effective solution, as more ex and current sensing equipment is needed.
To effectively distinguish between normal operation and abnormal calculated impedance is compared to two specific predefined threshold NOUlim and NDUlim, as it is depicted in Figure 3.The determination of t requires experimental testing, whereas the measurement accuracy of the to be taken into consideration too.Moreover, the NDUlim is defined on the ground resistance values that may emerge in the event of neutral conduc the initial installation the most important is the calibration of the studied d its reliable and accurate operation.Any impedance value surpassing the N mined threshold is regarded as a power theft attempt.It is worth noting that the transformer turns ratio is appropriately selected to be 1:100, which is desirable, in order to generate a low-magnitude 600 Hz harmonic voltage component in the primary side.On the other hand, voltage and current measurements in the secondary are utilized to extract the magnitude of specific harmonic components (i.e., 50 Hz and 600 Hz), to effectively calculate the impedance and identify the system state.The detailed mathematical analysis of the harmonic injection procedure has been performed in [16].
It is noted that both voltage and current sensors can be positioned across the grid power line too.The function is the same, without notable performance variation; although, this leads to a bulkier and less cost-effective solution, as more expensive voltage and current sensing equipment is needed.
To effectively distinguish between normal operation and abnormal conditions, the calculated impedance is compared to two specific predefined threshold values, namely NO Ulim and ND Ulim , as it is depicted in Figure 3.The determination of the NO Ulim limit requires experimental testing, whereas the measurement accuracy of the equipment has to be taken into consideration too.Moreover, the ND Ulim is defined on the basis of realistic ground resistance values that may emerge in the event of neutral conductor loss.During the initial installation the most important is the calibration of the studied device, to ensure its reliable and accurate operation.Any impedance value surpassing the ND Ulim predetermined threshold is regarded as a power theft attempt.It is worth noting that the transformer turns ratio is ap which is desirable, in order to generate a low-magnitude ponent in the primary side.On the other hand, voltage an secondary are utilized to extract the magnitude of specifi Hz and 600 Hz), to effectively calculate the impedance an detailed mathematical analysis of the harmonic injection in [16].
It is noted that both voltage and current sensors ca power line too.The function is the same, without nota hough, this leads to a bulkier and less cost-effective solut and current sensing equipment is needed.
To effectively distinguish between normal operation calculated impedance is compared to two specific prede NOUlim and NDUlim, as it is depicted in Figure 3.The de requires experimental testing, whereas the measurement to be taken into consideration too.Moreover, the NDUlim is ground resistance values that may emerge in the event of the initial installation the most important is the calibration its reliable and accurate operation.Any impedance value mined threshold is regarded as a power theft attempt.

Figure 3. Fault detection threshold values for each undesirable c
There is a possibility for a zero-load scenario.In this impedance values close to nearly infinite.In this scenari guishing between a zero-load scenario and islanding.Suc sure the accurate operation of the studied smart kit.For included, comprising a TRIAC switch connected in series There is a possibility for a zero-load scenario.In this case, the device might measure impedance values close to nearly infinite.In this scenario, it must be capable of distinguishing between a zero-load scenario and islanding.Such a mechanism is crucial to ensure the accurate operation of the studied smart kit.For this reason, a parallel branch is included, comprising a TRIAC switch connected in series with a relatively large impedance value (i.e., capacitor) for the fundamental grid frequency.The mechanism is straightforward; when the device detects a significantly large impedance value, the TRIAC switch closes, shorting the load and re-estimating the line impedance at specific time intervals for a few cycles.This process verifies if the total impedance stays within the normal operation limits, confirming the absence of an electric load (zero-load scenario).
The flowchart of the overall device operation, employing IoT is given in Figure 4.The state estimation is based (a) on the 600 Hz impedance calculation and (b) on the comparison of the power consumption with the installation meter measurements, via communication.The smart device is capable of notifying the user of either normal or abnormal operation, by accurately detecting each faulty condition.
Eng. Proc.2024, 60, x FOR PEER REVIEW 5 of 11 closes, shorting the load and re-estimating the line impedance at specific time intervals for a few cycles.This process verifies if the total impedance stays within the normal operation limits, confirming the absence of an electric load (zero-load scenario).
The flowchart of the overall device operation, employing IoT is given in Figure 4.The state estimation is based (a) on the 600 Hz impedance calculation and (b) on the comparison of the power consumption with the installation meter measurements, via communication.The smart device is capable of notifying the user of either normal or abnormal operation, by accurately detecting each faulty condition.

Goertzel Algorithm Implementation
The Goertzel algorithm is a robust digital signal processing technique that is used to extract the magnitude and phase of the desired frequency from an input signal, with minimum computational burden [17].In parallel, this algorithm has been widely used in active anti-islanding techniques [11,17,18].Basically, the algorithm is used to compute the

Goertzel Algorithm Implementation
The Goertzel algorithm is a robust digital signal processing technique that is used to extract the magnitude and phase of the desired frequency from an input signal, with minimum computational burden [17].In parallel, this algorithm has been widely used in active anti-islanding techniques [11,17,18].Basically, the algorithm is used to compute the Digital Fourier Transform (DFT) spectra.It can be performed either from the perspective of the DFT over short time sections of the signal (with a fixed time window), or from the perspective of a filtering operation at a given frequency (the frequency is fixed).According to [17], Goertzel is a faster method of pitch detection than the FFT and the DFT for a single frequency.The detailed mathematical analysis can be found in [18]; thus, only the z-domain basic equations are given, as they are used for the digital implementation in the microcontroller unit; the ESP32 microcontroller is used, which integrates both Wi-Fi and Bluetooth connectivity.
In this application, by utilizing the Goertzel algorithm, the magnitude of the fundamental (50 Hz) and the higher order (600 Hz) harmonics are obtained, through the voltage and current measurements at the CT secondary side (H-bridge inverter side).The Goertzel algorithm z-domain transfer function is as follows: where k = f int f s N: harmonic order of the calculated signal k = 0, 1, . . .N − 1, N: number of samples, f int : frequency of interest and f s : sampling frequency.The algorithm is performed in the form of a second-order discrete-time causal linear infinite-impulse-response filter.Hence, the input-output behavior of this filter can be treated as a linear difference equations' set as it follows: After the application of the Goertzel algorithm to both voltage and current signals, the 600 Hz line impedance is calculated and the result is also uploaded to ThingSpeak, which is an IoT analytics platform that allows users to collect, visualize, and analyze live data in the cloud.Furthermore, with the 50 Hz voltage and current data, the installation power consumption can be obtained.These data are exchanged with the installation meter power calculations in order to detect any significant discrepancies and thus to minimize the possibility of power theft.

Experimental Validation
A laboratory-scale experimental testbench has been developed in [16], including the smart active detection kit hardware prototype and it is used in order to validate the functionality of the studied device, along with its communication capabilities.Indicatively, the neutral conductor loss scenario is studied in this work.Table 1 presents the main parameters of the experimental setup.In regards to the constructed fault detection device, the printed circuit board (PCB) was designed through the aid of the Altium Designer software and it was developed primarily employing miniature-sized SMD components.The overall dimensions are limited to 120 mm × 65 mm; the size is a significant aspect, considering the device integration into the electrical installation board.Thus, the compact size enables flexible placement and seamless incorporation into existing installations, with limited space.The developed smart kit is presented in Figure 5. Finally, it is worth noting that for the case of M-phase installations, the single-phase CT will be substituted with an M-phase one, to accommodate their specific requirements.
neutral conductor loss scenario is studied in this work.Table 1 presents the main eters of the experimental setup.In regards to the constructed fault detection device, the printed circuit boar was designed through the aid of the Altium Designer software and it was develo marily employing miniature-sized SMD components.The overall dimensions are to 120 mm × 65 mm; the size is a significant aspect, considering the device integra the electrical installation board.Thus, the compact size enables flexible placem seamless incorporation into existing installations, with limited space.The de smart kit is presented in Figure 5. Finally, it is worth noting that for the case of M installations, the single-phase CT will be substituted with an M-phase one, to ac date their specific requirements.The grounding resistance value plays a significant role in an unintentional loss event, due to the additional voltage drop at its terminals, that results in the re of the line current.Figure 6 depicts both the H-bridge inverter output current (Iinv as the line current (ILine) that supplies the load.In the normal operating state of th grid, the integration of the two harmonic components can be observed, with th component appearing as local peaks, superimposed on the 600 Hz component o verter signal.During a neutral loss event, the amplitude of the 50 Hz componen goes a significant decrease.Apparently, this faulty condition can be easily dete conventional protection devices as well; nevertheless, it is considered here for the tion of the effective operation and interoperability of the proposed kit.Furtherm noteworthy that the H-bridge inverter SPWM modulation index (ma) has been ap ately chosen to be equal to 0.2, ensuring that the amplitude of the fundamental h component of the inverter remains low (below 2.5 V), in order not to affect the C tion.The grounding resistance value plays a significant role in an unintentional neutral loss event, due to the additional voltage drop at its terminals, that results in the reduction of the line current.Figure 6 depicts both the H-bridge inverter output current (I inv ) as well as the line current (I Line ) that supplies the load.In the normal operating state of the utility grid, the integration of the two harmonic components can be observed, with the 50 Hz component appearing as local peaks, superimposed on the 600 Hz component of the inverter signal.During a neutral loss event, the amplitude of the 50 Hz component undergoes a significant decrease.Apparently, this faulty condition can be easily detected by conventional protection devices as well; nevertheless, it is considered here for the validation of the effective operation and interoperability of the proposed kit.Furthermore, it is noteworthy that the H-bridge inverter SPWM modulation index (m a ) has been appropriately chosen to be equal to 0.2, ensuring that the amplitude of the fundamental harmonic component of the inverter remains low (below 2.5 V), in order not to affect the CT operation.Next, in Figure 7, the output of the Goertzel algorithm is illustrated, leading to the calculation of the 50 Hz current amplitude, during a neutral loss event, as it is displayed in serial plotter of the Arduino IDE environment.The opposite is expected for the esti mated line impedance, as these two values are inversely proportional.The device demon strates its capability to precisely detect and measure the changes that occur during a neu tral conductor loss event.Consequently, an alarm signal is sent, to notify the user of the specific faulty condition.In realistic conditions, the device operates periodically, in predefined time intervals in order to consume the minimum amount of energy.As it is presented in Figure 8, the device is configured to operate for 0.5 s and then enters an inactive state (deep sleep) fo the next 0.5 s, to validate this intermittent operation.The yellow and magenta waveform correspond to the filtered inverter output current and voltage, respectively.Moreover, the light blue waveform represents the line current, while the green one represents the line voltage.The current and voltage signals alternate between intervals of zero amplitude and intervals where normal injection occurs.According to the ESP32 datasheet, its power con sumption in the deep sleep mode ranges from 10 to 150 μA, in contrast to 160 to 260 mA during normal continuous operation [19].Finally, it is worth noting that in realistic (e.g.LV residential installation) conditions, as there is no need for continuous operation, these time intervals can be adjusted to minimize the device power consumption.Next, in Figure 7, the output of the Goertzel algorithm is illustrated, leading to the calculation of the 50 Hz current amplitude, during a neutral loss event, as it is displayed in serial plotter of the Arduino IDE environment.The opposite is expected for the estimated line impedance, as these two values are inversely proportional.The device demonstrates its capability to precisely detect and measure the changes that occur during a neutral conductor loss event.Consequently, an alarm signal is sent, to notify the user of the specific faulty condition.Next, in Figure 7, the output of the Goertzel algorithm is illustrated, leading to the calculation of the 50 Hz current amplitude, during a neutral loss event, as it is displayed in serial plotter of the Arduino IDE environment.The opposite is expected for the estimated line impedance, as these two values are inversely proportional.The device demonstrates its capability to precisely detect and measure the changes that occur during a neutral conductor loss event.Consequently, an alarm signal is sent, to notify the user of the specific faulty condition.In realistic conditions, the device operates periodically, in predefined time intervals, in order to consume the minimum amount of energy.As it is presented in Figure 8, the device is configured to operate for 0.5 s and then enters an inactive state (deep sleep) for the next 0.5 s, to validate this intermittent operation.The yellow and magenta waveforms correspond to the filtered inverter output current and voltage, respectively.Moreover, the light blue waveform represents the line current, while the green one represents the line voltage.The current and voltage signals alternate between intervals of zero amplitude and intervals where normal injection occurs.According to the ESP32 datasheet, its power consumption in the deep sleep mode ranges from 10 to 150 μA, in contrast to 160 to 260 mA during normal continuous operation [19].Finally, it is worth noting that in realistic (e.g., LV residential installation) conditions, as there is no need for continuous operation, these time intervals can be adjusted to minimize the device power consumption.In realistic conditions, the device operates periodically, in predefined time intervals, in order to consume the minimum amount of energy.As it is presented in Figure 8, the device is configured to operate for 0. LV residential installation) conditions, as there is no need for continuous operation, these time intervals can be adjusted to minimize the device power consumption.Finally, the IoT connectivity and communication capabilities of the smart device are experimentally assessed, by uploading the calculated measurements to the ThingSpeak web platform.The neutral conductor loss scenario is again examined, capturing the signal waveforms of line and inverter currents, that were previously depicted in Figures 6 and  8.The Goertzel algorithm outputs the magnitude of the 50 Hz voltage and current components.After the necessary calculations, the microcontroller (connected to a Wi-Fi network) uploads the data to a channel of the ThingSpeak platform.The outcome of this process is depicted in Figure 9, presenting the user interface of the ThingSpeak web page.I) and estimated 600 Hz grid impedance (Table II) waveforms, as they are presented on the ThingSpeak web platform.Finally, the IoT connectivity and communication capabilities of the smart device are experimentally assessed, by uploading the calculated measurements to the ThingSpeak web platform.neutral conductor loss scenario is again examined, capturing the signal waveforms of line and inverter currents, that were previously depicted in Figures 6 and 8.The Goertzel algorithm outputs the magnitude of the 50 Hz voltage and current components.After the necessary calculations, the microcontroller (connected to a Wi-Fi network) uploads the data to a channel of the ThingSpeak platform.The outcome of this process is depicted in Figure 9, presenting the user interface of the ThingSpeak web page.Finally, the IoT connectivity and communication capabilities of the smart device are experimentally assessed, by uploading the calculated measurements to the ThingSpeak web platform.The neutral conductor loss scenario is again examined, capturing the signal waveforms of line and inverter currents, that were previously depicted in Figures 6 and  8.The Goertzel algorithm outputs the magnitude of the 50 Hz voltage and current components.After the necessary calculations, the microcontroller (connected to a Wi-Fi network) uploads the data to a channel of the ThingSpeak platform.The outcome of this process is depicted in Figure 9, presenting the user interface of the ThingSpeak web page.I) and estimated 600 Hz grid impedance (Table II) waveforms, as they are presented on the ThingSpeak web platform.I) and estimated 600 Hz grid impedance (Table II) waveforms, as they are presented on the ThingSpeak web platform.
Two separate time charts illustrate the values of the line current at 50 Hz (Field Chart 1/blue waveform) and the estimated 600 Hz line impedance (Field Chart 2/red waveform), for the case of the neutral loss scenario.Apparently, as it was previously discussed, the line current and line impedance exhibit an inverse relationship.Therefore, this simple IoT communication approach enables users to stay informed about the status of their electrical installation (i.e., power consumption, current and voltage values, impedance value, faults etc.) at all times.In parallel, the existing installed smart meters can leverage these data to perform cross-validation and fine tuning, to further enhance the accuracy of their measurements.
Hz (12th harmonic-injected) and 50 Hz (fundamental) current and voltage signals are extracted, to detect faulty conditions (from the 600 Hz impedance value) and estimate the installation consumption (from the 50 Hz current/voltage values).

Figure 1 .
Figure 1.Block diagram presenting the integration of the active fault detection d

Figure 1 .
Figure 1.Block diagram presenting the integration of the active fault detection device.

Figure 2 .
Figure 2. Schematic diagram of the active fault detection device.

Figure 3 .
Figure 3. Fault detection threshold values for each undesirable condition.

Figure 2 .
Figure 2. Schematic diagram of the active fault detection device.

Figure 2 .
Figure 2. Schematic diagram of the active fault detection device.

Figure 3 .
Figure 3. Fault detection threshold values for each undesirable condition.

Figure 4 .
Figure 4. Flowchart of the active fault detection device control scheme.

Figure 4 .
Figure 4. Flowchart of the active fault detection device control scheme.

N ( 4 )
where u[n]: the intermediate value of the current (n) sampling time, u[n − 1]: the intermediate value of the previous (n − 1) sampling time, u[n − 2]: the intermediate value of the n − 2 sampling time and y[n]: the complex value of the calculated signal.The magnitude and phase of the calculated signal are acquired by the following expressions:

Figure 5 .
Figure 5.The developed active fault detection device.

Figure 5 .
Figure 5.The developed active fault detection device.

Figure 6 .
Figure 6.Experimental waveforms of the H-bridge inverter output current and line current, during a neutral loss event.

Figure 7 .
Figure 7.The output of the Goertzel algorithm for the 50 Hz current component, displayed in th serial plotter of the Arduino IDE environment.

Figure 6 .
Figure 6.Experimental waveforms of the H-bridge inverter output current and line current, during a neutral loss event.

11 Figure 6 .
Figure 6.Experimental waveforms of the H-bridge inverter output current and line current, during a neutral loss event.

Figure 7 .
Figure 7.The output of the Goertzel algorithm for the 50 Hz current component, displayed in the serial plotter of the Arduino IDE environment.

Figure 7 .
Figure 7.The output of the Goertzel algorithm for the 50 Hz current component, displayed in the serial plotter of the Arduino IDE environment.
5 s and then enters an inactive state (deep sleep) for the next 0.5 s, to validate this intermittent operation.The yellow and magenta waveforms correspond to the filtered inverter output current and voltage, respectively.Moreover, the light blue waveform represents the line current, while the green one represents the line voltage.The current and voltage signals alternate between intervals of zero amplitude and intervals where normal injection occurs.According to the ESP32 datasheet, its power consumption in the deep sleep mode ranges from 10 to 150 µA, in contrast to 160 to 260 mA during normal continuous operation [19].Finally, it is worth noting that in realistic (e.g., Eng.Proc.2024, 60, 22 9 of 11

11 Figure 8 .
Figure 8. Experimental waveforms for the device intermittent operation (deep sleep mode), during the neutral conductor loss fault.

Figure 9 .
Figure 9. Line current component at 50 Hz (TableI) and estimated 600 Hz grid impedance (TableII) waveforms, as they are presented on the ThingSpeak web platform.

Figure 8 .
Figure 8. Experimental waveforms for the device intermittent operation (deep sleep mode), during the neutral conductor loss fault.

11 Figure 8 .
Figure 8. Experimental waveforms for the device intermittent operation (deep sleep mode), during the neutral conductor loss fault.

Figure 9 .
Figure 9. Line current component at 50 Hz (TableI) and estimated 600 Hz grid impedance (TableII) waveforms, as they are presented on the ThingSpeak web platform.

Figure 9 .
Figure 9. Line current component at 50 Hz (TableI) and estimated 600 Hz grid impedance (TableII) waveforms, as they are presented on the ThingSpeak web platform.

Table 1 .
Some parameter values of the experimental setup.

Table 1 .
Some parameter values of the experimental setup.