## 4 Embedded Platform for the Decentralized Monitoring of Power Distribution Systems
### Hardware and Software Requirements  
To emulate an AMI in the laboratory, the modules and communication technologies developed for projects involving IoT applications were used. Figure 2 illustrates the decentralized architecture that was implemented in the laboratory, highlighting the electronic components used.  
Figure 1: Decentralised Architecture.  
To emulate the behavior of an SM a Raspberry PI 3 was used in conjunction with a LoRa Ra-01 module to send the measurements every 0.5 s from each CTU to the corresponding ESEM. The code for the management of the LoRa Ra-01 modules, the embedded board settings, and the sending of measurements to the processing gateway was performed using the Python language.  
Figure 3 shows the development scheme proposed in this paper for emulation of an AMI in a laboratory.  
A load flow calculation gives the reference values for the state variables (\(x^{lf}\)) and measurements (\(z^{lf}\)). To simulate measurement values Monte Carlo simulations were performed by including random noise in the reference load flow values [42; 43; 44].  
The \(i\)-th measurement value was calculated by adding a random noise with Normal distribution \(u_{i}\sim\mathcal{N}(0,\sigma_{i})\) in the corresponding \(i\)-th measurement reference value, according to (4).  
\[z_{i}=z_{i}^{lf}+u_{i} \tag{4}\]  
Different precision levels, for each measurement, generate the noise standard deviation \(\sigma_{i}\) according to (5):  
\[\sigma_{i}=\left|z_{i}^{lf}\right|pr_{i}/3 \tag{5}\]  
where \(pr_{i}\) is the precision of the \(i\)-th meter. In this research, it was assumed 5% for SM, 2% for SCADA meters, 1% for virtual measurements (passive buses with no generation or load).  
For the development of the processing gateway, the ESP32 LoRa module was used as a receiver of the data (measurements) sent by Ra-01. After being received, these data are processed and converted to be sent to the Central Processing Unit (CPU) via the UART interface (CPU represents the DOC that performs the state estimation process to all feeders and substations of the PDS under analysis). With the data (measurement values derived from the emulation of the SMs) available in the Jetson Nano processor, as well as the network topology and parameters of the corresponding LV network, WLS SE is running in the ESEMs, which are programmed in Python language.  
Figure 2: Implementing the chosen Decentralised Architecture.  
With the result of the state estimation process performed in each ESEM, the connections with the TELIT 4G LTE module are initialized. The module is accessed via UART serial communication and AT commands are sent through this communication channel. This establishes the registration of the module of the carrier's cellular network and enables an IP address to access the internet network, upon request. At the end of the entire initial configuration, it is possible to make an HTTP request and open communication sockets directly to the chosen server and thus forward the data referring to the state estimation result that can be accessed by the DOCs of the concessionaires, being of high importance for the knowledge of the current operating state of the electrical network.  
The Things Board IoT platform was used to receive the result data of the state estimation process performed at Jetson Nano. The data is sent in JSON format using the MQTT protocol and stored on the server to be displayed in the developed dashboard, presenting information about the operating state of the PDS under analysis (see Figure 4).  
Figure 3: AMI schematic.