# Optimum System for Diagnosing Power Quality in Electrical Microgrids
## 3 Developed Electrical Measurement Network
### SDMD Prototype: Architecture and Characteristics  
The architecture of the SDMD is depicted in Figure 3. The process of converting an analog signal into a digital value and enabling data communication with other peripherals involves several steps [44]. First, it is necessary to acquire the voltage and current signals. Next, these signals must be conditioned before being converted to digital form for further computation. Finally, the communication module establishes the data flow. All elements of the SDMD adhere to the measurement requirements described in Section 2.1, including the voltage and current measurement, synchronization, and simultaneous measurement requirements. Moreover, the design addresses the susceptibility to electromagnetic interference commonly encountered in industrial environments. Voltage and current sensors that provide high performance and ranges suitable for expected input signals are necessary. In the proposed SDMD, the voltage sensor ZMPT101B (Robotdyn, Shenzhen, China) and current sensor SCT-013 (YHDC, Shenzhen, China) are used. The ZMPT101B is a small size current transformer with a bandwidth of 1 MHz, and it provides stable measurements, notable electric isolation, and lower losses with respect to other voltage measures [45]. On the other hand, the SCT-013 is a non-invasive current sensor based on the Hall effect. This makes it easy to connect to loads, as there is no need to open circuits. The most important features of the SCT-013 are its high linearity and fast response. In addition, it is very robust to external noise. Moreover, both sensors are low-cost and widely used for harmonic source detection [46; 47; 48; 45], making them ideal for measurements in industrial applications due to their robust resistance to external noise. Analog signals from voltage and current sensors need to be conditioned before analog-to-digital conversion. For this, an analog front end (AFE) based on a filter composed of inductance and capacitor, and an operational amplifier is used. The digital signal controller (DSC) involved in the smart meter has an on-chip ADC which is used for all general-purpose applications. However, due to the requirements of voltage and current measurements, an external ADC is required: a 16-bit ADC ADAS3023 (Analog Devices, Norwood, MA, USA). Moreover, it is necessary to support the sampling of eight  
Figure 3: Architecture of the SDMD. input channels simultaneously and the ADAS3023 needs 8 us to the conversion in all the channels. Thus, it has a resolution of 156 uV with \(\pm\)5.12 V of input range, which is more than the DSC on-chip ADC and it results in reduced quantitation error [49]. Boards based on microcontrollers (uCs) [29], digital signal processors (DSPs) [30], and FPGA hardware [50] are common approaches for electrical metering. In the case of the SDMD, the discrete signal from external ADC is processed by a dsPIC30F5011 (Microchip Technology, Chandler, AZ, USA) low-cost DSC. This DSC combines the significant features of both uC and DSP. An SRAM memory in the DSC was used to temporarily save the collected voltage and current measurements. These measurements remain in the SRAM memory while the SDMD is powered and until the next voltage and current acquisition. This capability is essential because the data are collected in the SDMD and need to be stored there until the SDMD transmits them to the host computer for further processing. The DSC features a central processing unit (CPU) with a novel Harvard architecture and includes input/output peripherals for general-purpose applications. Specifically, it provides a 25 MHz CPU and 12-bit ADC with a 200 kSPS conversion rate and 16 input channels. The DSC is also responsible for calculating the zero-crossing points. The source code developed for voltage and current acquisition can be implemented on the hardware platforms mentioned above, such as uC, DSP, DSC, or FPGAs, many of which are open-hardware platforms.