# Optimum System for Diagnosing Power Quality in Electrical Microgrids
## 3 Developed Electrical Measurement Network
### Description of the Developed Communication Network
In this case, the WebSocket client is implemented in a customized application on the host computer. After the client opens the WebSocket connection, it sends the measurement configuration to the server, which is then transmitted to the SDMD using serial communication. The SDMD acquires the voltage and current measurements from a microgrid node and saves the data in its SRAM memory,  
Figure 6: Flow chart of the communication process for requesting and collecting data from a microgrid node, involving the SDMD, the SBC, and the host computer. awaiting the reading process from the SBC. Once the SBC reads the data, it transmits the data to the host computer. The algorithm repeats this process until an affirmative end condition is met. The prototype shown in Figure 4, the communication network illustrated in Figure 5, and the communication process outlined in Figure 6 together constitute the electrical measurement network, DiagElect. DiagElect enables the analysis of PQ in scenarios with a variety of loads, such as a microgrid with multiple nodes. This capability arises from DiagElect being more than just a single measurement device with a communication network; it is an electrical measurement network composed of many SDMDs, each corresponding to a different microgrid node. This approach facilitates synchronized measurements across multiple microgrid nodes, ensuring that voltage and current measurements request are processed simultaneously and accurately. Figure 7 showcases a comprehensive schematic diagram of the proposed DiagElect system within a microgrid environment. It features a host computer, an SDMD, and an SBC at each microgrid node. Each node represents a generic load, and the system can be scaled to include more nodes as needed. Both the SDMD and SBC, along with other components, are installed into the mounting plate shown in Figure 8. The system is modular and can be packed into a portable case, facilitating transport and quick deployment in diverse microgrid environments. In addition, it is scalable to accommodate an increase in the number of microgrid nodes. Figure 7: Schematic diagram of the proposed DiagElect. As a requirement, the voltage and current measurement requests to all SDMDs must be simultaneous. To achieve this, each SBC and the host computer must be synchronized, and the host computer should be capable of processing multiple tasks simultaneously, specifically the requests for voltage and current measurements from all microgrid nodes. For this purpose, an NTP server was installed on each SBC, allowing synchronization between each SBC and the host computer, and parallel computing was implemented on the host computer. In a scenario with multiple loads, as described in Section 2.3, the procedure outlined in Figure 6 is applied. Once the voltage and current measurements are transferred to the host computer, where the WebSocket client has been implemented, they are processed. Another application that was developed converts the data from hexadecimals to decimals and then organizes the voltage and current measurements for each node. At this point, the data are in suitable conditions for the ongoing PQ analysis.