An Alternative Low-Cost Embedded NILM System for Household Energy Conservation with a Low Sampling Rate

: The measurement of the energy consumption of electrical appliances, where the meter is installed at a single point on the main input circuit of the building, is called non-intrusive load monitoring (NILM). The NILM method can distinguish the loads that are currently active and break down how the loads consume electricity. A microcontroller with embedded software was selected to read the data into the NILM method process at a low sampling rate every 1 s or 1 Hz. The measured data and the data obtained by the NILM algorithm were displayed via an internet platform. This article presents an alternative low-cost embedded NILM system for household energy conservation with a low sampling rate, which could identify electrical appliances such as an air conditioner, refrigerator, television, electric kettle, electric iron, microwave oven, rice cooker, and washing machine. Four features of symmetry pattern were extracted, containing information on the value of active power change, the value of reactive power change, the number of intersection points between the active power data and the reference line, and an estimation of an equation for the starting characteristics of the electrical equipment. The proposed NILM system was tested in a selected test house that used a single-phase power system. A typical meter was also installed to compare the results with the proposed NILM. The validity of the tests was checked for 1 month in 3 houses to analyze the results. The proposed method was able to detect 91.3% of total events. The accuracy of the average ability of the system to disaggregate devices was 0.897. The accuracy value for total power consumption was 0.927. The continuous data recording of the NILM method provides information on the behavior of electrical appliances that can be used for maintenance and warnings.


Introduction
Currently, if electricity consumers want to check their electricity consumption, they can read it from the meter on the electricity pole or from the common meter board in their residential building, or they can check their electricity bill every month, which is unfavorable for energy conservation or management. The feedback of the total electricity consumption gives an overview of the whole house. However, there is no clear information about the energy consumption of each appliance. The Thai Energy Consumption Report in 2020, prepared by the Provincial Electricity Authority and the Municipal Electricity Authority, indicates that residential electricity consumption is 27.1% of the total consumption, while the number of electricity users in the residential sector accounts for 89.7% of all users. Real-time data on the electricity consumption of electrical appliances are required to achieve effective energy savings. Continuous feedback of each appliance's electricity consumption data enables users to change their behavior and save about 12% of their electricity, while monthly feedback of electricity consumption enables savings of about 3.8% of electricity [1]. To improve the efficiency of electrical appliances, continuous data on appliance energy consumption can be used to plan and maintain appliances, such as by analyzing data on refrigerator defrosting or air conditioner cleaning. If energy conservation agencies want to analyze the electricity consumption of residential electric appliances, data collection is very time-consuming and labor-intensive. To achieve effective residential energy savings, a low-investment technology is needed that uses electrical power measurement, called non-intrusive load monitoring (NILM).
Generally, determining the consumption status of electrical appliances requires the installation of a voltage sensor and a current sensor on each electrical appliance, which is referred to as direct measurements or intrusive load monitoring systems [2,3]. Several disadvantages have been found in this method, such as the interruption of the load circuit, the cost of the electricity meter, the installation cost, the free space for the installation of the hardware, etc. NILM methods or indirect measurements focus on the use of a main electricity meter to indicate the operating status and energy consumption characteristics of electrical appliances [3]. Non-intrusive load monitoring is becoming increasingly important in terms of information needs for power management, and more and more smart meters are being installed in the power grid [4].
NLIM classification is based on the sampling rate: a high sampling rate (<1 s), low sampling rate (1 s-15 min), or very low sampling rate (15 min-1 h). The implementation of complex features such as harmonics, transients, or current-voltage relationships requires a high sampling rate from a dedicated meter [5]. A smart meter with a communication interface of 1 Hz [6,7] is an example of a low sampling rate. Automatic meter reading (AMR) corresponding to every 10, 15, 30, and 60 min [8][9][10] is a very low sampling rate data collection method. In this study, a single master point energy meter was used to achieve an active power sampling rate of 1 Hz. In recent years, several electricity consumption datasets have been made publicly available for testing the NILM algorithm. The best-known and most widely used dataset that records power consumption at 1 sample per second is the Reference Energy Classification (REDD) dataset [7]. Other datasets include the Building-Level Labeled Electricity Disaggregation (BLUED) dataset [11], which contains 8 days of household electricity data, and the dataset measured every 1 min known as the Almanac of Minutely Power (AMPds) [12,13], which contains two years of data. Event-based algorithms can be classified into two categories as follows [14]: an event-based algorithm is a load signature detection algorithm that assumes that only one electrical device changes state at a given time, and a non-event-based algorithm in the case of a meter installation with a low reading frequency of once every 1-15 min is developed with a hidden Markov model to evaluate the operating conditions of the electrical device based on the total active power. Classification by a data disaggregation algorithm can be divided into two types [15]: supervised learning, i.e., using unique electrical device data to train the system to recognize patterns and discriminate the data, and unsupervised learning [4,16], in which the data are discriminated assuming that similar features come from the same type of devices, and then the data are divided into groups for devices. Moreover, natural language processing has been used to solve the NILM problem [16][17][18][19]. The relationship between different device models or sub-models connected in a chain has been used for disaggregation for NILM [20,21].
In this article, we present our work to develop a low-cost embedded NILM using only one microcontroller. The proposed method presented in this article for detecting the first change in the data set is based on estimating the reference line using polynomial equations and then finding the intersection between the data set and the reference line. Four features of symmetry patterns are extracted containing the following information: the value of symmetry change in active power (∆P), the value of symmetry change in reactive power (∆Q), the amount of incremental and decremental changes from a set of active power by estimated reference lines using polynomial equations, and equations for the starting characteristics of electrical appliances obtained via polynomial curve fitting.

Principle of Nonintrusive Load Monitoring
Indirect measurements of the energy consumption of household electrical appliances are a core concept of non-intrusive load monitoring. Household electrical data are collected at the main circuit and then extracted to obtain the power consumption and operating time of appliances classified as a system.
The NILM system consists of components as shown in Figure 1, which are divided into four parts as follows [22]: • Data monitoring is the part that measures and records the data used for disaggregation. There are various electricity meters that measure the gross weight of a building [15,23], such as smart meters; • Event detection is the part that detects changes in electrical values that represent a change in the operating conditions of electrical appliances [24]; • Feature extraction of electrical data from the main meter is the extraction of certain features in relation to time; • Classification is the part that breaks down or groups the electrical appliances that have been analyzed using the features extracted from the meter data.
In addition to the four main components mentioned above, there are other components: a training dataset or specific data on electrical appliances and a display part, which displays the energy consumption of each electrical appliance to consumers as information in order to save energy in the household.

Load Model
Measurement of the energy consumption of electrical appliances for energy conservation requires all appliances to be measured to determine the potential for energy savings, especially in terms of maintenance and operation. Table 1 shows the percentage of households in Thailand ranked by ownership of electrical appliances and the corresponding energy consumption [25][26][27]. From the data in Table 1, when analyzing the percentage of household energy consumption, it can be concluded that air conditioners consume the most energy because they are appliances that consume a lot of electricity and have a long operating time even if they are not in use all day. The next appliance is the refrigerator, which does not consume a lot of electricity but is in operation all day. When analyzing the percentages of energy consumption for the whole country, the refrigerator is the appliance with the highest energy consumption; this is different from the percentages of household energy consumption because the ownership rate of air conditioners is much lower than the ownership rate of refrigerators. This article breaks down the electrical appliance consumption rates for the air conditioner, refrigerator, television, electric kettle, electric iron, microwave oven, rice cooker, and washing machine. The operating load model was used for pretraining in this article [28][29][30]. A typical energy meter was selected to record the characteristics of electrical devices. The active power, reactive power, current, and voltage measured by the energy meter were recorded in the memory of the microcontroller with a sampling rate of 1 Hz. The signatures of the devices are shown in Figure 2.
The signatures of the appliances may be displayed as follows: • The air conditioner is overloaded when switched on. Active power and inductive reactive power are components of these devices; • The refrigerator is associated with a very high rise in P-Q when it is first switched on. Active power and inductive reactive power are components of this appliance; • The electric iron, rice cooker, and kettle are resistive loads that have only active power. After the first time in the range, the electric iron will work for a narrow period like a pulse signal; • When starting a television, it will switch between high and low active power before it reaches a steady state. Active power and capacitive reactive power are components of these devices; • Active power and inductive reactive power are components of microwave ovens; • A washing machine is an appliance that operates in many patterns of electrical power per use. Normally, the switch-on power of the electrical appliances fluctuates, while a certain value is given when they are switched off, as shown in Figure 3. The on and off active and reactive power levels of the electrical appliances are symmetrical, as shown in Figure 4.
The symmetrical characteristics can be used to determine the operating power as information for grouping electrical appliances.

Proposed Embedded NILM Software
The overall process of the proposed NILM algorithm is shown in Figure 5 as follows: The microcontroller requests data from the meter every 1 s, which includes voltage, current, active power, reactive power, and power. In the first round, 30 datapoints are requested, and in the next round, 1 datapoint is requested at a time on a first-in, first-out basis. • To detect the changes in the data series, we first use change detection by estimating the reference line using polynomial equations and then finding the intersection between the data set and the reference line. If we first find a rising edge and then a falling edge in the same set of data, this indicates a pulsed electrical device. If the timing of the rising edge is far from the timing of the falling edge, an iron or kettle could be in operation.

•
A three-point method is used to calculate ∆P and ∆Q [28][29][30][31]. There are nine possible patterns for this method. A Flat-Flat pattern means a stable condition of the load; otherwise, there are instabilities. To find a Flat-Flat pattern, it can be expressed as Equation (1): where Pt3, Pt2, and Pt1 are the active power as a function of time at t1, t2, and t3, respectively.
• Pre-grouping of ∆P is divided into two conditions: by power size (<400 W and >400 W) and by power factor (unity lagging and leading).

•
Four features of symmetry pattern extractions are selected in this article: ∆P, ∆Q, and the amount of intersection points (rising and falling edge) between the active power data and the reference line estimated by polynomial equations, and polynomial curves fitting the starting time of active power.
• Table 2 shows the conditions for classification. We start the grouping with the values ∆P and ∆Q. If the results of discrimination are unclear, the other characteristics must be used, as shown in Table 2, and Equation (2) is used for the final elimination of that grouping which has the most accurate correlation value: where P(t) is the total active power, Q(t) is the total reactive power, ai(t) is the state of electrical appliance i (1: ON, 0: OFF), Pi is the threshold active power of appliance i. Qi is the threshold reactive power of appliance i, n is the number of appliances that can be dis-  The energy efficiency evaluation is an assessment of the correctness of disaggregation of the energy consumption of electrical appliances from the total electrical energy [7] with 1 h interval time and 1 month period time, defined formally as: where is the accuracy of the total energy consumption estimation, is the accuracy of estimating the energy consumption of device i, is the accumulated energy in time t of device i estimated from NILM, is the accumulated energy in time t of device i read from the meter, P is the total testing period, and N is the number of target appliances.
We used confusion matrix assessment [32] to evaluate the accuracy of the prediction to identify appliances.
Here, TP refers to the total number of true positives, TN refers to the total number of true negatives, FP refers to the total number of false positives, and FN refers to the total number of false negatives. Precision is the detection accuracy, Recall is the accuracy of appliance disaggregation, Accuracy is the total accuracy, and the F1-score is the average ability of the system to disaggregate appliances.

Proposed NILM System Implementation
The components of the embedded NILM box and the individual meter were similar, but they were different in the proposed programming within the microcontroller. The hardware diagram was based on Figures 6 and 7 with an NB-IoT board as an additional option for cases where the installation site does not have internet access. The actual device is shown in Figure 8. The electrical value is measured using an SM120 single-phase power meter. The ESP32 microcontroller model, which operates at a speed of 160 MHz and has large memory and built-in WIFI, was selected to read the data in Modbus RTU protocol over RS485 every 1 s. ThingSpeak was the cloud server used in this article. The installation of the NILM embedded box is shown in Figure 9.

Results and Discussion
The test installation in House 1 for a period of 30 days from 1 September 2019 to 30 September 2019 was implemented to classify eight types of appliances. A typical power meter was installed directly with the electrical appliances to compare with the disaggregated data from the proposed NILM and determine their accuracy. The data from the typical power meter and the proposed NILM were sent to the internet server in real time as shown in Figure 10. At the beginning of the system installation, the data were grouped from the symmetric ΔP and ΔQ values that occur over time to form a database for identifying the device type, as shown in Figure 11. The active and reactive power values were determined for the records in the database to group the devices. The power values obtained during startup show high power dissipation, while the stop values are low. Due to the symmetrical characteristics of the power during the on time and the off time, the power value determined in the off time was selected for recording in the database. Figures  12 and 13 show an example of the display when the electrical appliances were turned on or off, for which four data sets were compared.    Figures 14 and 15 show the total and appliance power from the meter and appliance power from NILM from example data for 15-16 September 2019. Figures 16 and 17 show the hourly total energy consumption and air conditioner energy consumption during September measured by the meter and estimated from the proposed NILM.   Figures 16 and 17 show that the hourly electricity consumption estimated by the NILM method is similar to that from direct meter measurements in terms of both energy consumption and duration. An assessment was made based on the Confusion Matrix method according to Equations (5)-(8); the system tested had 5860 changes in electrical appliance performance, among which the proposed method detected 5398 changes in the timing of the data.  The evaluation results shown in Table 3 and Figure 18 have an average accuracy F1score of 0.90. The device with the lowest F1-score was the television as it was similar to other devices that were not among the electrical appliances considered, such as a fan, etc., followed by the rice cooker, because it changes an average of twice a day and looks like a kettle; therefore, there is a chance of error in distinguishing these devices, but most devices could be distinguished with a very good rating.  The results of the validity assessment of the energy consumption values, according to Equations (2) and (3), are shown in Table 4 and Figure 19, showing a graph comparing the cumulative energy consumption in each hour of the day of electrical appliances in September from direct measurements and the proposed NILM estimates, with similar results. For the evaluation results per device, the air conditioner has the highest accuracy score of 0.96, while the TV has the worst evaluation result because it has low power consumption and a low F1-score. Another interesting device is the washing machine, which attained an F1-score as high as 0.97 but a power accuracy score of 0.86 because of the washing machine's motor spinning back and forth, making the estimated power less than the active power consumption from direct measurement with the meter. This result in Figure 20 shows that the difference in total electrical energy consumption for the whole month was 9.5 kWh or 6.10%.   The test installation in House 2 for a period of 29 days from 1 February 2020 to 29 February 2020 was implemented to classify eight types of appliances. Figure 21 shows the total and appliance power from the meter and appliance power from NILM in example data for 11 February 2020. The evaluation results in Table 5 show an average accuracy F1score of 0.91. The lowest F1-score was obtained for the kettle because it changes an average of twice a day.  The results of the validity assessment of the energy consumption values are shown in Table 6. The result in Figure 22 shows that the difference in total electrical energy consumption for the whole month was 11.7 kWh or 8.0%.  The test installation in House 3 for a period of 31 days from 1 March 2020 to 31 March 2020 was implemented to classify six types of appliances. Figure 23 shows the total and appliance power from the meter and appliance power from NILM with example data for 14 March 2020. The evaluation results in Table 7 show an average accuracy F1-score of 0.88. The lowest F1-score was obtained for a water pump.  The results of the validity assessment of the energy consumption values are shown in Table 8. The result in Figure 24 shows that the difference in total electrical energy consumption for the whole month was 37 kWh or 13.3%.  The test results of the three sample houses and a summary of the comparisons according to the proposed methods are shown in Table 9. Continuous data on electrical appliances estimated by NILM can be used to plan the maintenance of electrical appliances and to warn when the appliances are not in use.
When the iron is plugged in and turned on, but not in use, it stays hot all the time and consumes energy. Figure 25 shows a comparison of the active power when the electric iron is in use and when it is not in use. When the electric iron is not in use, it is turned off for a longer time and turned on for a shorter time, about 8 times per 20 min, and the duty cycle is symmetrical, while when the electric iron is in use it is turned on more than 16 times per 20 min. The number of times the electric iron is turned on and off per interval can be used to help decide whether to send a warning message to the homeowner. If the refrigerator door is not fully closed, the system can be checked by the actual power drop rate, which is lower than that when the door is fully closed. As shown in Figure 26, the active power drop rate is −0.0063 watt/second when the refrigerator door is not fully closed, while the active power drop rate is −0.0168 watt/second when the refrigerator door is closed. The embedded NILM system can relay this information to the homeowner by sending a message through the LINE notify application installed in the microcontroller. When the ambient temperature is higher, the air conditioner tends to consume more electricity, as shown in Figure 27. Some of this electricity is used for cooling. From the results of continuous data measurement using the NILM principle, the relationship between the temperature and power can be derived as shown in Figure 27. The same approach can be used to determine the optimum time to clean the air conditioner for better cooling. In addition, the data on each electrical appliance may be used for other purposes, such as a notification that the kettle has boiled (to avoid having to restart the appliance, which is not energy efficient), a notification that the washing machine has finished its cycle, or a notification that the air conditioner is running outside of normal use.

Conclusions
In this article, we presented low-cost and real-time monitoring in a proposed NILM system that uses only one microcontroller to operate all functions. From testing in selected houses, the proposed NILM-based processor design obtained data from a low-samplingrate meter every 1 s and stored it as a dataset for processing. Active power change was determined using the method of finding the intersection of the data set and the reference line created by polynomial equations. The proposed method was able to detect 91.3% of total change. The final identification of the dataset used four characteristic extractions: ∆P, ∆Q, number of intersections, and the curve fitting of the starting characteristics of appliances. The accuracy of the system's ability to disaggregate devices was found to be 0.897. The accuracy rating of the total electric electrical energy was 0.927. The proportions of electrical energy consumed by the electrical appliances were comparable for both the direct measured value from the meter and the estimated value from the proposed NILM method. Through the internet platform, a detailed real-time graph showing the total power, the status of the total electrical power consumption, and electrical power per device worked correctly. Continuous recording of electrical appliances using the proposed NILM method has a low investment cost but can be used to analyze the behavior of electrical appliances for preventive maintenance and to provide alarms.