STM32-Based Appliance Analysis and Identification Device

Abstract

The most generally used technique of load power monitoring is non-intrusive load monitoring, which requires only one device to be mounted on the bus to monitor the current parameters and the working state of various types of appliances within the total load. It is required to investigate a cost-effective non-intrusive load monitoring and identification system that can perform a range of duties such as fault monitoring, energy monitoring, and fault analysis without requiring a significant number of sensing components. Measurement of electrical values of commonly used home appliances during stable operation, followed by feature extraction and electrical feature analysis to identify appliance types, can help residential users understand appliance habits and consciously reduce consumption and losses while enabling fault detection. The STM32F103RCT6 core control chip and the SUI-101 energy metering module are used in this system to monitor and evaluate load characteristics using the Modbus-RTU communication protocol. The active and reactive power of the load is measured and recorded in the learning mode; in the analysis and identification mode, the electrical parameters of the current appliance, such as current, voltage, active power, reactive power, frequency, and power factor, can be displayed in real-time, and the corresponding load can be deduced using binary simulation and the Euclidean distance matching method. The device has a short learning time and good identification accuracy for typical household appliances, according to the system test, and can satisfy the analysis and recognition of electrical appliances in a regular domestic setting. The current device design combines the advantage of cheap cost, low power consumption, and portability, making it a viable alternative for domestic appliance identification and monitoring.

Share and Cite:

Jing, R. and Ren, L. (2022) STM32-Based Appliance Analysis and Identification Device. Journal of Computer and Communications, 10, 1-10. doi: 10.4236/jcc.2022.106001.

1. Introduction

Analyzing and monitoring electrical appliances is a significant part of ensuring safe power consumption. Electrical device analysis and identification are fast-growing to a higher level, due to this rapid growth of the Internet of Things technology and sensor technology. Various electronic items are developing as China’s electronics technology develops, and people are buying all types of electronic devices, however, there are many hidden hazards to electrical safety [1]. Load monitoring can be intrusive or non-invasive. Most traditional load monitoring is invasive load monitoring, which necessitates the installation of a large number of sensors for data acquisition, which comes at a high initial investment cost and requires bothersome maintenance, and is thus undesirable to users. Scholars have been interested in non-intrusive load monitoring since it was first introduced [2]. Some of them take the distinctive parameters as samples from the load’s steady-state characteristics and combine them with fuzzy clustering to run training tests on the sample data [3]. Some researchers have also extracted the load’s characteristic properties, such as voltage, current, and power, and utilized the Fourier transform in conjunction with deep learning to identify the load [4]. By extracting the inactive current as well as harmonic features in the current and performing fine-grained analysis, non-intrusive appliance identification algorithms based on a combination of harmonic features and improved genetic algorithms have also been proposed to improve the accuracy of classification and identification [5]. However, research on lightweight and portable domestic appliance identification devices has been limited. As a consequence, this design uses the non-intrusive appliance analysis approach to create an appliance analysis and identification device based on the STM32 control core.

2. Product Design Introduction

Based on embedded technology and sensor technology, a portable appliance analysis and identification device with low cost and fast detection has been built. The SUI-101A electrical energy metering module, Bluetooth module, TFT-LCD display, plug, and STM32 development board constitute the majority of the system. The control heart of the system is an STM32 microcontroller, which allows for quick and portable appliance identification. Figure 1 depicts the system’s general block diagram.

The main controller interacts with the SUI-101A module through the serial port using the Modbus-RTU protocol. The main controller receives the data frames gathered for processing and may monitor the current bus’s characteristic properties (voltage, current, active power, power factor, and frequency). There are two modes of operation for the system: identification and learning. The microcontroller can display real-time current characteristics on the TFT-LCD display and display the currently used appliances through the identification algorithm in the analysis and identification mode, or transfer the current characteristics and the currently used appliances to the cell phone via the Bluetooth

Figure 1. General block diagram of the system.

module. The feature parameters of a single appliance can be learned in the learning mode, and seven are learned in turn, and the feature parameters of various appliances are stored in an array of structures in turn, as well as the feature parameters of the last appliance learned must be forgotten before each learning begins.

3. System Hardware Design

A successful product design is built on hardware construction, and selecting the appropriate hardware facilities is a critical step in ensuring that the product function is accomplished. After studying and comparing the available current parametric measurement solutions, a reasonably mature current parametric measurement module is eventually chosen to fulfill the device’s data-collecting function, reducing the product’s complexity.

3.1. Main Control Board

The ALIENTEK MiniSTM32 development board, which utilizes the STM32F103 RCT6 as the main control unit, is used for the main control. The STM32F103 RCT6 has an ADC, DAC, timer, and other resources, as well as a clock frequency of 72 MHz, which is sufficient for this application design. The main control board gets the data frames from the power metering module over the serial port, then completes the data parsing job, and the controller picks different data processing techniques according to the different operating modes at this point. The principal control board is equipped with a 2 Kbit 24CO2 EEPROM, but the memory space is insufficient to hold the gathered current characteristic data, thus W25Q64 64M FLASH is utilized, which has a tremendous memory space and imitates the function of an EEPROM to store certain seldom updated data.

3.2. Current Parameter Measurement Scheme Design

Option 1: Use the HT7038 power metering chip. The measurement of each electrical parameter is carried out by the unique chip HT7038. Although this technique is simpler, the measurement precision has an impact and necessitates calibration and additional labor.

Option 2: Method of computation based on AD. A microcontroller calculates the RMS value and phase angle using a separate AD chip and acquisition circuits, amplification circuits, shaping circuits, and other circuits. This is a challenging, complicated circuit that would be difficult to construct quickly.

Option 3: Using ready-made modules. The use of mature modules to complete the measurement and display of numerous electrical characteristics, obviating the requirement for calibration and other labor, and obtaining the needed parameters directly from serial data, at a cheap cost and with ease of development.

Considering the above three options, Option 3 is selected, and the SUI-101A module is used.

The SUI-101A, a transformer-isolated multi-functional AC transmitter that can measure AC, voltage, active power, accumulated power, frequency, power factor, and other parameters in real-time, with a standard communication interface (TTL asynchronous serial port), optional standard protocol (Modbus protocol), and custom protocol. Current and voltage transmission accuracy can reach a level of ultra-high precision of 0.2. To accomplish total isolation of high and low voltage, the device uses a fully isolated acquisition system, which considerably improves safety and dependability. The maximum measurement current is up to 15A, which is fully compatible with the testing needs of common household electronic products.

3.3. Bluetooth Module

Through the serial port, the main controller communicates with the Bluetooth module. In the analysis and identification mode, the main controller can send the current characteristic parameters obtained by the power metering module in real-time to the Bluetooth module, along with the current usage of the electrical appliances analyzed and identified at the time, and the cell phone can receive the information within a certain range by opening the Bluetooth assistant, enabling close communication. It addresses the issues of reading data in low-light situations, screen damage, and the inability to get close to the device.

3.4. TFT-LCD

The thin film transistor liquid crystal display (TFT-LCD) is a kind of liquid crystal display. The program’s symbols, numbers, and words are saved in a word bank, and the output function is used to show the characters. This display panel gives a clear picture of the whole electricity characteristic parameters in real-time as well as the current appliance utilization, allowing for operational feasibility.

4. System Programming

Throughout Chapter 2, an economical hardware facility was chosen to minimize the device’s cost to produce a portable load monitoring and identification device for home-usage. In terms of program design, however, lowering the device’s cost makes the product design considerably more complex. The present difficulty is figuring out how to completely implement product features on low-performance hardware, and the following is a description of the solution selection design. The system identification accuracy is optimized in a constrained resource environment by using a combination of binary simulation and the Euclidean distance matching algorithm [6].

4.1. System Program Design

Scheme 1: The BP neural network was used to classify and identify appliances [7]. The current data of a single appliance is gathered, followed by a discrete Fourier transform and the extraction of the required number of harmonic coefficients as the appliance’s distinctive characteristics. Afterward, the classification system is built through training and optimization. By inputting the current parameter, the classification system can determine the appliance’s usage.

Scheme 2: Binary simulation is used to classify and identify electrical appliances. The microcontroller learns and saves the active power of each appliance in learning mode. The microcontroller simulates the use of various combinations of appliances separately in recognition mode, and the combination of appliances is judged to be the actual combination of appliances when the difference between the total power and the actual power is detected to be less than the threshold range.

Scheme 3: The electrical appliances are classified and identified using the Euclidean distance matching algorithm. In learning mode, the power metering module detects the active and reactive power of each appliance and records it in the microcontroller [8]. Two-dimensional feature recognition is used to find the database’s maximum similarity, and then the matching appliance combination is determined.

Scheme 1 uses a neural network to process data, which necessitates training of appliance parameters prior to use, takes a long time to train, and demands the use of expensive hardware like the Raspberry Pi and FPGA. Scheme 2 just creates different appliance combinations using a round-robin exhaustive seven-digit binary code and then classifies appliance types using judgment thresholds, which is quick and accurate within a specified range. Scheme 3 requires a certain algorithm model to be implemented.

In summary, the algorithms of Schemes 2 and 3 are fused, and the active and reactive powers of the seven categories of appliances are recorded in two-dimensional arrays; 128 combination schemes are constructed in the analytical recognition mode using binary simulation. The real point is discovered to be the closest point among the 128 combinations of points in the two-bit feature plane constituted of active power and reactive power, and the combination of appliances corresponding to that point is the desired one. The system program flow chart is shown in Figure 2.

Figure 2. System program flow chart.

4.2. Analysis and Identification Mode

The TFT-LCD display shows the current characteristic parameters and appliance consumption in real-time in the analysis and identification mode. Seven appliances can be combined in 128 distinct ways. Through the learning mode, the microcontroller records the active and reactive power of each appliance in advance, allowing different combination modes to match different goal total power. The measured total power and the desired total power are compared using two-dimensional features to find 128 similarities, then the maximum approximation query is run, and the appliance combination with the highest similarity and greater than the threshold is chosen.

Even with three-dimensional feature recognition, the saved feature parameters are minimal when using the Euclidean distance matching algorithm, which has low storage performance requirements [9].

d = ( P P ' ) + ( Q Q ' ) (3.1)

P represents the active power of the appliance to be identified, P' represents the sample active power, Q represents the reactive power of the appliance to be identified, and Q' represents the sample reactive power, as stated in Equation (3.1). The relevant appliance combination is discovered using the similarity query.

4.3. Learning Mode

The system will erase the last learning circumstance before entering learning mode. When users press the learning button, the system enters single appliance learning mode, where the MCU cyclically takes power from the serial port 10 times to get the average value, and the average value represents the active and reactive power of this appliance. The red light is on and the green light is off when the single appliance is learning; the green light is on and the red light is off after the single appliance has completed its learning. After seven appliances have been learned, the learning mode stops. The FLASH module of this development board has a substantial memory space, so this storage stores learning data by using FLASH to imitate the function of EEPROM.

5. System Testing

Because faults can arise at any step of the technical design and execution of device development, system testing is one of the most critical components of system development. As a result, when the system is built, it must go through comprehensive testing to confirm that the hardware and software are interconnected and that the system responds as planned, as well as to evaluate and correct any problems that develop to maintain the system’s steady functioning.

The design necessitates the use of seven separate electrical appliances, the current characteristics of which are shown in Table 1. In learning mode, the active power and reactive power of the appliances are learned and recorded separately when different appliances are connected at a single time. The current characteristics of the appliance are presented in real-time in the identification mode, with the number “1” indicating whether an appliance is connected and the number “0” indicating when the matching appliance is not connected. Figure 3 depicts the analysis identification mode’s particular display interface, whereas Figure 4 depicts the mode selection interface.

Table 1. Appliance characteristics parameters.

Figure 3. Analysis and identification mode interface.

Figure 4. Mode selection interface.

The device was put to the test by downloading the program to run on the microcontroller and connecting the modules. The physical diagram of the device is shown in Figure 5. A pre-test was done before the official test to verify the correctness of the energy metering module using a digital multimeter and other testing equipment, as well as the device to verify the consistency of the current characteristics of the different appliances. Individual appliance measurements were verified to be error-free.

Firstly, seven different appliances are learned individually in the learning mode, and then the appliances are assessed and identified after learning. Through testing, the device can accurately identify individual appliances; it can also accurately identify multiple small power appliances when used in combination; the accuracy of identification is inferior when there is a high power appliance connected, because of the variation of the power of the high power appliance caused by the fluctuation of the voltage of the mains network causes misjudgment, but in some specific combinations, for example, when the high power appliance is purely resistive and the small power appliance is inductive. For instance, when the high-power device is entirely resistive and the low-power device is inductive.

Figure 5. Physical diagram of the device.

Test conclusion: 1) In learning mode, the learning time for a single appliance does not exceed 5 seconds, and the learning pace is rapid. 2) The current electricity characteristic parameters can be precisely presented on the TFT-LCD display screen in recognition mode. 3) Able to respond to current appliance usage in real-time, unplugging appliance, the recognition detection time is no more than 2 seconds. 4) High recognition for small power appliance combination, but poor recognition for small power appliance when a high power appliance is connected (kettle, induction cooker, hairdryer, etc.).

6. Summary

This study proposes a hybrid binary simulation approach and Euclidean distance matching algorithm for high-accuracy detection of commonplace household appliances, based on the STM32 controller. The active and reactive power of the load is measured and recorded in the learning mode; in the analysis and recognition mode, the electrical parameters of the current appliance, such as current, voltage, active power, reactive power, frequency, power factor, and so on, can be displayed in real-time, and the corresponding load is deduced using binary simulation and Euclidean distance matching methods. The device has a rapid learning time and powerful identification accuracy for typical household appliances, according to the system test, and can satisfy the analysis and recognition of normal household appliances. The present device design offers the advantages of cheap cost, low power consumption, and mobility, making it a suitable alternative for domestic appliance identification.

NOTES

*Corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Wichakool, W., Remscrim, Z., Orji, U.A. and Leeb, S.B. (2015) Smart Metering of Variable Power Loads. IEEE Transactions on Smart Grid, 6, 189-198.
https://doi.org/10.1109/TSG.2014.2352648
[2] Hart, G.W. (1992) Nonintrusive Appliance Load Monitoring. Proceedings of the IEEE, 80, 1870-1891.
https://doi.org/10.1109/5.192069
[3] Wang, W.S., Wang, J. and Wang, K.W. (2011) Application of Som Neural Network and C Means Method in Load Classification. Proceedings of the Chinese Society of Universities for Electric Power System and Its Automation, 23, 36-39.
[4] Pratama Azkario, R., Simanjuntak Frans, J., Lazovik, A. and Aiello, M. (2018) Low-Power Appliance Recognition Using Recurrent Neural Networks. Frontiers in Artificial Intelligence and Applications, 239-250.
[5] Djordjevic, S., Dimitrijevic, M. and Litovski, V. (2017) A Non-Intrusive Identification of Home Appliances using Active Power and Harmonic Current. Facta Universitatis—Series: Electronics and Energetics, 30, 199-208.
https://doi.org/10.2298/FUEE1702199D
[6] Du, L., He, D., Harley, R.G. and Habetler, T.G. (2017) Electric Load Classification by Binary Voltage—Current Trajectory Mapping. IEEE Transactions on Smart Grid, 7, 358-365.
https://doi.org/10.1109/TSG.2015.2442225
[7] de Paiva Penha, D. and Castro, A.R.G. (2018) Home Appliance Identification for Nilm Systems Based on Deep Neural Networks. International Journal of Artificial Intelligence and Applications, 9, 69-80.
https://doi.org/10.5121/ijaia.2018.9206
[8] Hong, C. (2020) The Electronic Appliances Identification Algorithm Using Real and Reactive Powers. Journal of Critical Reviews, 8.
[9] Su, S.S., Zhang, J., Cheng, S.Y., Lin, P.J., Chen, C.C., Dai, M.N. and Huang, S.F. (2015) Learning Smart Socket Design Based on Variable-Weight Euclidean Distance. Journal of Fuzhou University (Natural Science Edition), 188-193.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.