# Smart Internet of Things Power Meter for Industrial and Domestic Applications
## 3 Proposed Solution
### Software Architecture
#### 3.2.2 Calibration Procedure and Measured Value Calculation  
To measure the power meter's accuracy, we created a benchmarking setup using three industrial power meters: Siemens SENTRON PAC4200 (7 KM4212-0 BA00-3 AA0, firmware v2.3.5) [26], Janitza UMG-96 RM (52.22.001, firmware v3.13) [27], and Phoenix Contact EEM-MA400 (2901364, firmware U300-0002) [28]. These meters are capable of measuring the electrical properties of the network grid and to provide them to the user via the integrated display and communication interfaces. The Janitza and Phoenix Contact meters are equipped with RS485 serial interfaces and integrate the Modbus RTU protocol. Siemens SENTRON PAC4200 includes an Ethernet port and support the Modbus TCP protocol. For current measurements, we used the LCTR-5014500050A55 current transformer. According to the manufacturer [29], it features a primary current of 50 A and a secondary current of 5 A. It belongs to accuracy class 0.5 and operates at frequencies of 50/60 Hz. The transformer complies with the IEC 61869-1&2 standard [30,31] and provides a 14 mm diameter hole to pass the conductor across, with which the current will be measured. The meter accuracy classes according to the IEC61557-12 standard [32] for various types of measurements are presented in Table 1.  
Both Siemens and Janitza power meters were updated to the last firmware version available at the time the tests were conducted, using their management software: SENTRON PowerConfig v3.27 and GridVis v9.1. For the Phoenix Contact meter, there was no update available. All the power meters were configured for single-phase measurements, and the without voltage transformer and current transformer ratio was set to 50 A/5 A. For the Siemens PAC4200 meter, we set a static IP address for the Ethernet interface and the 502 TCP port for the Modbus TCP protocol. For the Janitza UMG-96 RM and Phoenix Contact meters, we set the RS485 interface parameters to 19,200 baud rate, 8 data bits, 1 stop bit, no parity. We assigned different Modbus addresses to allow for the unique identification of the devices on the bus. For the calibration process, the three industrial power meters voltage input terminals were connected to our device's load connector. Then, one of the load conductors was passed through the current transformers. This setup ensures that both voltage and current are measured at the same point in the circuit by all devices. The input voltage conductors, from the grid connector of the device, were connected to the output of an isolation transformer. The transformer has two outputs, each with different voltage levels (110 V and 230 V), which were sequentially used during the calibration process. At the load connector, a multi-socket extension cord was connected. This allows us to feed power to one or multiple loads and, as a result, to control the consumed and measured currents. To achieve the best results, the grid voltage and the load current must be constant during the calibration process. For the voltage measurement calibration process, an APC SUA1500I Smart-UPS (Uninterruptible Power Supply) was interposed between the isolation transformer and the local grid connection (wall socket). This model generates a pure sine wave output, accepts an input voltage between 160 and 286 V, and has an output power of 980 W (1500 VA). During the tests, we discovered that the local grid voltage can fluctuate by up to 3 V within a 10-min interval, but using the UPS, we reduce the voltage variation to \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Measurement** & **Siemens PAC4200** & **Janitza UMG96-RM** & **Phoenix EEM-MA400** \\ \hline Phase Voltage & 0.2 & 0.2 & 0.2 \\ Phase Current & 0.2 & 0.2 & 0.2 \\ Frequency & 0.1 & 0.05 & 0.1 \\ Total Active Power & 0.2 & 0.5 & 0.5 \\ Total Reactive Power & 1.0 & 1.0 & 0.5 \\ Total Apparent Power & 0.5 & 0.5 & 0.5 \\ Voltage THD & 2.0 & 1.0 & Not specified \\ Current THD & 2.0 & 1.0 & Not specified \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Power meter accuracy classes comparison. a maximum of 400 mV.