The circuit for connecting and storing electrical energy data is divided into three parts:
3.1. The Hardware Circuit Communicates With Measuring Devices Program
Figure 2 demonstrates the stable operation of the Module Master RTU connection circuit. The module establishes connections with devices utilizing the Modbus RTU. The sensor system is directly integrated into the main board to facilitate the collection of environmental data such as temperature and humidity. The real-time operating system is automatically updated. The data, gathered from connected devices to measure temperature and humidity values, is instantly stored on the Micro SD card. The structured data on the Micro SD card is compatible with Microsoft Excel are gone to real-time checking and data referencing. The data is efficiently transmitted through either the internal network or the Internet. The inclusion of a smartphone application significantly augments flexibility and efficiency in energy monitoring and management. This application further supports data monitoring of the system through Internet connectivity.
To check the circuit's stability, Fig. 3 illustrates the Modbus_Ethernet communication system for collecting, storing data, and monitoring electrical power consumption, temperature, and humidity installed in the cabinet. Then, it can operate very stably and yield experimental results.
3.2. The Algorithm Flowchart for The Board Master RTU Program
Figure 4 illustrates the algorithm flowchart for controlling the entire system. Initially, the system retrieve data from the EEPROM to check the connection with the SD Card, and then verify the internet connection to establish a connection with the application on the phone. Then, the connection with the RTC sensor and temperature sensor is checked. When the connection process is completed, the system proceeds to read and store data in the Cloud and the SD Card. The algorithm flowchart are explained as the following:
• Block Start: The program initializes libraries, variables, constants, etc.
• Block Get EEProom: this process retrieves data stored in EEPROM memory, such as WiFi user, password, the path to cloud data, the secret code for the cloud, etc. These values will be empty for the first initialization.
• Block Internet Connection: This block attempts to connect to the internet. If a connection cannot be established due to an unavailable WiFi network during the first initialization, the device will broadcast a WiFi hotspot (e.g., ESP32 Reading). Users connecting to this hotspot automatically open a Captive portal (an automatic web server with an embedded HTML interface and the main program). Then, users configure system parameters on this portal, save the settings, and proceed.
• Block Save EEProom: The program saves the data entered by users on the webserver into EEPROM memory and restarts the device.
• Block Cloud Connection: The program attempts to connect to the Cloud database. If the connection fails due to misconfigured information or a poor connection, the device will reset after a certain period of unsuccessful attempts.
• Block Void Loop: This is an infinite loop after a successful device initialization.
• Block Create Data: Data is compressed from two sources following a specific structure: data collected through Modbus RTU (e.g., power parameters like voltage, amperage, frequency) and real-time data obtained from RTC (date, hour, minute, second).
• Block Save SD: Before uploading to the cloud, the program saves a copy on the SD card in a predefined data structure.
• Block Update Data to Cloud: Sends data to the cloud.
• Block Reset Data Button: This block checks if the user pressed the reset button. If so, the program deletes specific data (e.g., WiFi account) and restarts the device, allowing users to reconfigure the device. The reset button can be configured as an external switch.
3.3. The Android Application Monitors Real-Time Electrical Parameters from The Device Online
Figure 5 displays a user monitoring interface in which users can easily select the device to monitor directly. It provides convenient options for connecting to measuring devices for both single-phase and three-phase electrical devices. For single-phase devices, the circuit connects to the EM115 Mod CT measuring device from FINECO. For three-phase devices, users have the option to connect to two measuring devices of either KLEA 220P from KLEMSAN or ME96SS–ver.B from MITSUBISHI based on their specific electrical usage requirements. Then, users can select the device to monitor and confirm the choice by pressing the ACCEPT button on the interface in Fig. 5.
Figure 6 illustrates the monitoring interface for all electrical parameters from the selected device in the interface shown in Fig. 5. After pressing ACCEPT button in Fig. 5, the device starts collecting all the measured parameters in real-time. It transmits this data to the Cloud and displays all the measured parameters, such as voltage, phase angle, current, and frequency on the interface as in Fig. 6.
3.4. Storing Data on The SD Card and Exporting It as an Excel File
After selection ACCEPT button of the interface in Fig. 6, the system proceeds to store the data on the SD Card. Figures 7, 8, 9, and 10 shows the extraction of data collected from the measuring device and stored on the SD Card. Users can utilize this data for storage, reporting, forecasting as a database for future artificial intelligence system integration as the following:
• Step 1: Insert the micro-SD card containing the electrical parameter data from the meter into the micro-USB and plug it into the computer.
• Step 2: Open Microsoft Excel and open the file with the name of the meter from which you want to export data to Excel.
• Step 3: Set up the export of electrical power data from the meter to Microsoft Excel.
• Final Step: Choose the data type as General and click Finish to complete the process.
After performing the data extraction in Fig. 10, Table 1 illustrates that the system data has been exported into an Excel file for management and use.
Table 1
Electrical power data from the meter on the excel spreadsheet
Device
|
Date
|
Time
|
Temperature
|
Humidity
|
V1N
|
V2N
|
V3N
|
V12
|
V23
|
V31
|
I1
|
I2
|
I3
|
Cosφ1
|
Cosφ2
|
Cosφ3
|
ME96SS
|
31/5
|
17:32
|
35.7
|
39.69
|
229.1
|
229.3
|
228.1
|
396.4
|
396.3
|
396.2
|
0
|
0
|
0
|
1
|
1
|
1
|
ME96SS
|
31/5
|
17:32
|
35.34
|
40.01
|
229
|
229.2
|
228
|
396.3
|
396.4
|
396.1
|
0
|
0
|
0
|
1
|
1
|
1
|
ME96SS
|
31/5
|
17:32
|
35.1
|
40.07
|
228.9
|
229.1
|
227.9
|
396.1
|
395.9
|
395.9
|
1.1
|
0
|
0
|
0.84
|
1
|
1
|
ME96SS
|
31/5
|
17:33
|
34.98
|
40.09
|
228.9
|
22912
|
227.8
|
396.1
|
395.9
|
395.7
|
1.1
|
0
|
0
|
0.84
|
1
|
1
|
ME96SS
|
31/5
|
17:33
|
35.16
|
39.96
|
229.2
|
229.3
|
228
|
396.4
|
396.3
|
396.3
|
1.1
|
0
|
0
|
0.84
|
1
|
1
|
ME96SS
|
31/5
|
17:33
|
35.29
|
39.79
|
229.1
|
229.3
|
227.9
|
396.4
|
396.2
|
396.1
|
1.1
|
0
|
0
|
0.84
|
1
|
1
|
ME96SS
|
31/5
|
17:34
|
35.3
|
39.84
|
229.1
|
229.4
|
227.9
|
396.6
|
396.3
|
396.3
|
0.5
|
0
|
0
|
0.84
|
1
|
1
|
ME96SS
|
31/5
|
17:34
|
35.29
|
39.98
|
229.5
|
229.4
|
228.2
|
396.9
|
396.7
|
396.6
|
0
|
0
|
0
|
1
|
1
|
1
|
ME96SS
|
31/5
|
17:34
|
35.32
|
39.98
|
229.5
|
229.4
|
228.2
|
396.9
|
396.6
|
396.6
|
0
|
0
|
0
|
1
|
1
|
1
|
Figure 11 represents the temperature data collected from Excel, presented in the form of a chart for reporting purposes. The obtained data in Table 1 and Fig. 11 show the real-time monitoring of temperature, humidity, and electrical power of the electrical cabinet. Also, the obtained results show that the temperature enhances, and humidity changed gradually with time inside the electrical cabinet. All the temperature and humidity parameters of the electrical cabinet remained within the standard range of temperature (-5oC ≤ T ≤ 70oC) and relative humidity (RH) (0%≤RH < 90%), respectively.