# Investigation of the Automatic Monitoring System of a Solar Power Plant with Flexible PV Modules
## 3 Results and Discussion
By analyzing the data accumulated in the database, certain conclusions or observations can be made about the operation of the solar power plant, the battery charging process or the power supply of certain electrical receivers. If necessary, the system maintenance operator or other personnel can take certain actions based on the accumulated data. The collected data are also useful for the research process in improving this type of solar power plant and monitoring systems for operating parameters. In order to ensure the proper operation of the monitoring system, a suitable algorithm for the program codes of individual modules is required. For each system module, which  
Figure 5: PCB of the power measurement circuit (**a**) and the circuit of the first stage of the monitoring system (**b**). Figure 6: An image of the main window of the PC program with settings. makes up both the first level of the system and the second level of the system, as well as the PC application, before programming, it is necessary to create program algorithms that define the sequence of system actions. The algorithms of the software codes of the monitoring system under study are presented in Figure 7. Figure 7a shows the algorithm of the wattmeter program. As one can see, the program starts with the command START WATTMETER FIRMWARE. 1 In the next execution step, a request is sent to the MCU module. If the request is successful and requires the measurement of electrical values, then the measurement is performed. In the next stage, the process of averaging the values is carried out and a digital data package is formed. The formed digital packet with data is sent to the MCU module using the I2C protocol. Later, if there is a need, the entire cycle of the program with all procedures is repeated again. Figure 7b shows the algorithm of the MCU (first stage of the monitoring system) program code. As one can see, the program starts with the START command. During the next stage, a query/request is sent to the digital wattmeters. Upon receipt of a successful response and request for measurements, the measurement process is performed. After receiving the measured wattmeter values, a data packet is formed and sent to the second stage PLC module. TCP protocol is used for sending. If there is a need according to the command, the program cycle is repeated with the necessary procedures. When there is no need, this part of the system goes into standby mode. The second stage of the monitoring system consists of an industrial PLC. This part of the system receives data from the MCU module, analyzes them and transfers them to a stationary PC, where the data are recorded in the database. The structure diagram of the PLC program code al  
Figure 2.0 Control program algorithms: (**a**) power measurement module program algorithm; (**b**) algorithm of the first stage of the monitoring system and (**c**) algorithm of the second stage of the monitoring system. Figure 7c. Program execution starts with the START PLC PROGRAM command. The next step is the configuration process of external modules. The working mode of the database is set. A request is sent to the MCU module for receiving data. Upon receiving the request, the MCU module sends a data packet to the PLC (the second stage of the monitoring system). During the next stage, the PLC program writes the data to the database. Instant value data are also displayed on the PC screen. After fulfilling the full set of algorithm requirements, the program cycle is repeated and the following monitoring of the parameters of the solar power plant is performed. When a battery is charged with a PWM (pulse-width modulation) charger, the charge signal or cycle shortens over time because the PWM charger uses pulse-width modulation to regulate the current. When the battery is very discharged, the PWM charger delivers a maximum current pulse, so the signal has long and constant \"on\" cycles (long duty cycle, close to 100%). This means that most of the time, power is sent to the battery without interruption.