**3. Methodology and system development**

**Figure 1** shows the schematic diagram that briefly describes each of the stages of the methodology implemented in this work.

A. Phase (A):

A current/voltage measurement module with wireless communication via Wi-Fi using MQTT messaging protocols is designed. This data transmission is carried out over TLS 1.3 (Transport Security Layer) to ensure the privacy of the data on the channel. Maximum value ranges are established for voltage and current. Finally, an overload protection system is configured.

B. Phase (B):

Measurements of the 22 most common household appliances are recorded, measured in 20 different homes, with a sampling time of 10 seconds and with work cycles that depend on the operation of the appliance.

C. Phase (C):

It envisions implementing a neural network with a hierarchical framework of synapses in a forward topology, where all nodes in a layer are linked in a unidirectional fashion to identify nonlinear features.

**Figure 1.**

*Description of the methodology used to identify consumption patterns of electronic devices in a home.*

*Characterization of the Electrical Consumption Pattern of Household Appliances for Home… DOI: http://dx.doi.org/10.5772/intechopen.110355*

D.Phase (D):

The data is sent to the cloud to perform the necessary operations to generate representative values for each of the electrical devices to be compared.

E. Phase (E):

A consumption fingerprint matrix identifier model is created for each of the devices, generating a consumption map of the electrical devices connected in the home. Submatrices are created for testing the errors found and model validation.

In the context of the development of the ITCity ELAC T10–0643–Eranet 2017– 2020 Conicyt Project, "An ICT platform for sustainable energy ecosystem in Smart cities," executed by the institutions Federal University of Santa Caterina Brazil, Institute of Energy Physics of Latvia, University of Bucharest, University of Concepción, University of Atacama and Universidad Tecnológica Metropolitana, a system was designed that allows the acquisition of data from a network of intelligent measurement equipment in each outlet, called Smart Sockets (SS). This design corresponds to a Current–Voltage measurement module with wireless communication as an intelligent complement with a maximum capacity of 15 (A) (**Figure 2**).

The proposed model has the flexibility of portability of the device to different power outlets within the deployed coverage environment and to be able to change the identity of the device in the user interface from a Smartphone. The SS includes a communication interface, a current-voltage sensor, an MCU (microcontroller unit), and a switching circuit.

The functionality of these SS is the following:

• Measure the instantaneous voltage and current that are present in the connected device.

• Calculate the instantaneous power demanded by the connected device.

**Figure 2.** *Architecture of a smart socket.*


As shown in **Figure 2**, consumption measurement is obtained through a current sensor and a voltage sensor, in addition to obtaining the difference between the zero crossings of these two signals and correctly calculating the powers required by the loads (active, reactive, and apparent). Obtaining the current signal is achieved through a non-invasive sensor and the detection of the voltage signal is achieved through a transformer.

**Figure 3** describes the architecture of the communication between the devices and the cloud. The devices are connected through a local Wi-Fi network and publish their measurements using the MQTT protocol, identifying each one of the devices through a unique identifier. These messages are sent to a cloud server that acts as an MQTT Broker and forwards the messages to the subscribers. The subscribers store the measurements persistently and process the results, which are exposed through a data analytics platform.

The development of this device allows both the ON/OFF control and the monitoring of the different electrical parameters (voltage, current, active and reactive power, power factor, and frequency, among others) [8]. The SS are connected via Wi-Fi/IEEE 802.11 to the Access Point (AP), which works as a Gateway-IoT that oversees sending the information to the cloud service through communication protocols offered by the Internet Service Provider (Internet Service Provider ISP). The data is stored in a data streaming architecture and analyzed through a web visualization service, which allows its extraction and use for training and testing the neural network.

Given the need for a lightweight and easy-to-implement algorithm for a cheap integrated circuit with low power consumption, it was decided to use a multilayer perception neural network with a recursive propagation algorithm, called MLBPNN [10]. This is a known supervised model, used in this work due to its simplicity and guaranteed convergence. These characteristics allow its future implementation incorporated into a technological package quickly and at a low cost. In this work, the general network of the multilayer perceptron provides a machine-learning algorithm

**Figure 3.** *Smart socket ILM system.*

*Characterization of the Electrical Consumption Pattern of Household Appliances for Home… DOI: http://dx.doi.org/10.5772/intechopen.110355*

with the device classification task. The analytical model is a hetero-associative network (multilayer perceptron, MLP), where all the inputs connected to the external environment are different from the output that expresses the response of the system. For this work, an active power curve vector of the electrical load is considered as input, and the recognition of the connected appliance is considered as output.

The network elements combine a hierarchical framework of synapses in a forward topology, where all nodes in one layer are unidirectionally linked to those in the next layer, to create the possibility of identifying non-linear features. The ability to detect non-linear relationships, without defining a formal expression that does not require an "a priori" hypothesis about the behavior of the variables, essentially depends on the number of nodes, the number of layers, the transfer function of each node, and the connection weight factors.

Eq. (1) represents the optimization function to find the minimum error between the consumption pattern and the data measured by the SS:

$$\min \sum\_{p=1}^{\infty} E\_p(\mathbf{x}) \tag{1}$$

where *Ep* represents a measure of the error related to pattern p (subset) of the training set. This error estimates the gap between the output given in the training set and the output predicted by the network. The recursive propagation algorithm is an iterative method, a heuristic version of the gradient method, commonly applied in multilayer networks due to its high performance in terms of time and precision. The interaction that defines the recursive propagation is given by Eq. 2:

$$w^{k+1} = w^k - a\nabla E\_{p(k)}(w^k) + \eta \left(w^k - w^{k-1}\right) \tag{2}$$

where


Continuous training of a neural network aims to make it always perform better, but eventually, it reaches a point where forward progress is too slow to be practical. Also, overtraining is harmless, because it can lead to overfitting. This occurs when the mapping function resulting from the training process fits the consumption pattern too well, losing the ability to process new data.
