Photo-Voltaic Panel Power Production Estimation with an Artificial
  Neural Network using Environmental and Electrical Measurements
Weather is one of the main problems in implementing forecasts for
photovoltaic panel systems. Since it is the main generator of disturbances and
interruptions in electrical energy. It is necessary to choose a reliable
forecasting model for better energy use. A measurement prototype was
constructed in this work, which collects in-situ voltage and current
measurements and the environmental factors of radiation, temperature, and
humidity. Subsequently, a correlation analysis of the variables and the
implementation of artificial neural networks were performed to perform the
system forecast. The best estimate was the one made with three variables
(lighting, temperature, and humidity), obtaining an error of 0.255. These
results show that it is possible to make a good estimate for a photovoltaic
panel system.
Antony Morales-Cervantes, Oscar Lobato-Nostroza, Gerardo Marx Chávez-Campos, Yvo Marcelo Chiaradia-Masselli, Rafael Lara-Hernández
Photo-Voltaic Panel Power Production Estimation with an Artificial Neural Network using Environmental and Electrical Measurements

###### Abstract

Weather is one of the main problems in implementing forecasts for photovoltaic panel systems. Since it is the main generator of disturbances and interruptions in electrical energy. It is necessary to choose a reliable forecasting model for better energy use. A measurement prototype was constructed in this work, which collects in-situ voltage and current measurements and the environmental factors of radiation, temperature, and humidity. Subsequently, a correlation analysis of the variables and the implementation of artificial neural networks were performed to perform the system forecast. The best estimate was the one made with 3 variables (lighting, temperature, and humidity), obtaining an error of 0.255. These results show that it is possible to make a good estimate for a photovoltaic panel system.

 Photovoltaic generation systems; Energy storage systems; Radiation Forecasting; Artificial Neural Networks.

## I Introduction

Nowadays, energy consumption increases each year significantly. As a result, pollution increases by the use of fossil fuels during the production of complementary energy by energy companies [1]. Companies have incorporated alternative energy sources to reduce the impact and accomplish energy demand [2]. One of the most significant sources is solar energy, which has become the most popular alternative in the world [3]. Solar energy has been used to provide electricity for many years [4], by using Photo-Voltaic (PV) panels. The amount of current and power generated by a PV cell depends on external factors such as the environment and internal factors typical of the photo-voltaic system.

Specifically, the weather creates disturbances and interruptions in PV cells' electrical power [5, 6, 7, 8]. Due to this variability, it is necessary to implement reliable forecasts in the implementation of these PV systems to avoid penalties resulting from the differences between the programmed and produced energy [9]. Different forecasting models can be chosen based on the parameters to be analyzed, depending on particular needs [10].

The use of artificial intelligence (AI) has increased considerably in recent years, due to its ability to model and solve complicated computational tasks[11]. In fact, AI algorithms in data collection systems help to improve the profitability of the measurement equipment [12][13]. Forecasting models are also good indicators for detecting the right moment to perform maintenance on the photovoltaic system and the distribution of the PV system. There are different methods of forecasting PV energy. The very short-term method(from a few seconds to a few minutes) is used for the control and management of PV systems in the electricity market over micro-networks. The short-term method(48-72 hrs) for control of the energy system's operations, economic dispatch, and unit commitment, among others. The Medium-term (a few days to a week) and long-term methods (a few months to a year or more) are used to plan PV systems [14].

Hence, several models and methods have been implemented to estimate the generated energy of a PV-systems. The advanced methods include diverse artificial intelligence and machine learning techniques, such as artificial neural networks (ANN), nearest neighbor-k (kNN), extreme learning machine (ELM), and support vector machine (SVM), to mention the most used [15]. ML algorithms can
be classified into three main groups: (1)

1. Supervised learning, where the algorithm creates relationships between input and output characteristics.
2. Unsupervised learning, in which the algorithm looks for patterns and rules to describe in a better way the data.
3. Reinforcement learning, which is used mainly with extensive data and reduces them for visualization or analysis purposes [16].

The forecasting of power in PV systems is mainly based on ANN due to the complexity of the parameters involved. ANN are techniques that seek to emulate the human brain's behavior and generate responses for decision making [17]. The fundamental part of each ANN is its element processor, the neuron. The neural networks gather these element processors with different methods, to respond to their different numerical needs [18].

Recently reported forecasting models are based on the ANNs. One type of model uses the ANN to estimate solar radiation (in specific cities) based on past weather data (temperature, humidity, and rain probability) together with radiation, with the estimated radiation, the models try to estimate the PV's output energy [19, 20, 21]. Other models use the ANN to estimate the produced energy directly using different inputs like: (i) humidity [22]; (ii) temperature, humidity, and rainfall [23]; (iii) solar radiation and temperature [24]; (iv) solar power and weather data [25]. Eventually, an improved model considers data correlation and ANNs to select the most critical inputs [26]. However, most models are based on databases available online or meteorological measurements not precisely in the same place as the photovoltaic system. Thus, the data information is insufficient from a zone or region, and in some cases, no continuous measurements are available. On the other hand, it is well known that semiconductors are extremely sensitive to high temperatures.

Therefore, the present paper proposes an IoT device to measure and log _in-situ_ data about the PV system. The solar radiation, solar panel's temperature-humidity, and the panel's electrical power (voltage and current) have been collected during --120 days-- with a sampling frequency of 5 min, collecting more than 32,200 measurements. Then, measurements were used to train diverse ANN topologies and compare them with a Multiple Linear Regressor model. The best topology has an error level of 0.255326464, which presents a reliable data model.

## II Materials and Methods

The present research methodology consists of acquiring and validating data from a photovoltaic system to perform the data analysis and compute electrical power forecasting values by artificial neural networks (see Figure 1). Therefore, a measurement prototype has been designed to collect _in-situ_ voltage and current measurements and environmental factors such as radiation levels, temperature, and humidity. Eventually, the system's behavior is obtained through the prototype's reading analysis, performing a validation process, and correlation of variables. Then, the regression model is obtained with a training set to finally implements the ANN. The obtained estimations were evaluated against a test set using the Root-Mean Square Error (RMSE) as the primary measure, applying equation 1.

\[RMSE=\sqrt{\frac{\sum\left(x_{T}-x_{i}\right)}{N}} \tag{1}\]

where \(x_{T}\) is the estimated value, \(x_{i}\) is the actual value and \(N\) is the total number of measurements.

### _Experimental setup_

Data has been collected using a stand-alone IoT system embedded with three sensors with \(I^{2}C\) communication. The IoT system also has embedded a web server to configure and manage the logged data [27]. The Figure 2 shows the experimental system conformed by three main sections. The left-must

Fig. 1: Experimental setup for data gathering and analysis.
includes the environmental variable sensors, the OPT3001, and HDC2080 integrated circuits. The OPT3001 is a light sensor with a \(0.01\,\mathrm{lx}\) resolution, including an upper limit of \(128\,\mathrm{klx}\). However, an attenuating glass has been used to extend 55% of the device limit; a calibration procedure was conducted using the commercial digital luxometer MASTECH ms6612. The HDC2080 sensor measures relative humidity (RH) and temperature. For temperature the sensor has a \(\pm 2\,\mathrm{\SIUnitSymbolCelsius}\) resolution with ranges of \(-40\,\mathrm{\SIUnitSymbolCelsius}\) to \(85\,\mathrm{\SIUnitSymbolCelsius}\), for RH the sensor gives measurements with resolution of \(\pm 0.2\%\).

### _Logged data analysis_

Previous to the forecasting process, logged data have been compared with similar commercial measurement systems to evaluate performance. According to the central limit theorem, our data is normal, so we performed the linear dependency measurement by the Pearson correlation method between measured variables to determine its importance during forecasting.

The behavior comparison is made against data from the meteorological station of the Technological Institute of Morelia. Both data-sets are made up of solar radiation, humidity, and temperature, which correspond to the period 12th of November 2018 to the 6th of December 2018. Since measurements are originated by different equipment, different scale, and different locations (5 meters of difference), measurements were normalized using Eq. 2:

\[x=\frac{x_{i}-x_{min}}{x_{max}-x_{min}} \tag{2}\]

where \(x_{i}\) is the actual value to be normalized, \(x_{min}\) is the minimum value of the entire data-set, and \(x_{max}\) is the maximum value. Fig. 3 shows the measurements collected by the IoT system and the meteorological station only for the variable radiation. The small variations between data-sets can be attributed to the location of each system; however, the general performance is related.

Fig. 4 show three correlation plots: (a)luxes, temperature and power; (b)humidity, luxes and power; and (c)temperature, humidity and power. The three plots are made considering power variable as output. Therefore the third plot shows the lower correlation, meaning that humidity will have a lower impact on the final model.

## III Results

The ANN performance analysis has considered cases with two and three input variables: (i) lighting, temperature, and humidity, (ii) lighting and temperature, (iii) lighting and humidity, and (iv) humidity and temperature; each option has been tested with different topologies.

The training process was performed with random data from the 14th of January to the 10th of February 2019. Table I shows only the head-performing topologies based on the resulting RMSE obtained during the cross-correlation validation. On the table, the first column indicates the input variables. The second represents the topology used; the third and fourth ones are the maximum training cycles and error levels, respectively. The last column is the RMSE value. Notice that the maximum number of training cycles was defined based on the RMSE's performance during various training experiments.

The first topology (Table I) owns three computation elements in the input layer, three elements in the hidden layer, and one single output (3:3:1). This topology was evaluated with data that were randomly selected, and then the Easy-NN software was used to import the training set (700 measurements), validation (200), and test (100). Fig. 4(a) shows the comparison of estimated data with topology 3:3:1

Fig. 3: Data comparison between the meteorological station and the IoT system.

Fig. 2: Experimental setup system for measurements.
vs. the test data-set. The computed level error for this topology was 0.255326464.

Another good estimator has been implemented using only lighting and temperature, with a topology 2:8:1, resulting in an error level of 0.273086254; see Fig. 5b. In the case of the estimator based on the Illumination and Humidity, the best topology was 2:3:1, with an error level of 0.26061261; see Fig. 5c. Finally, the estimation with the variables Temperature and Humidity, the best performing topology was 2:7:1, with an error level of 1.522621379; see Fig. 5d.

Notice that the best network applies the three variables. However, the optional networks can be used when some data is missing or corrupted. For this research, the humidity sensor was the most problematic due to the warmth variability, specifically in Morelia city, resulting in saturated measurements during the early morning periods. Nevertheless, when all variables are pleasant, the ANN can produce better estimations.

On the other hand, a Multiple Linear Regressor (MLR) has been developed with the same data-set with three variables. Figure 6 shows a comparison for one-day estimations of ANN, MLR, and real measurements. Notice that the ANN estimations are closely related to the photovoltaic system's real behavior, compared to the estimation made using the MLR model.

According to the central limit theorem, in large samples, the sampling distribution tends to be normal, regardless of the data [28]. Therefore, an ANOVA analysis is carried out. The ANOVA of the MLR analysis was performed on lighting, temperature, and humidity to determine their importance, obtaining the Table II. The results of the ANOVA analysis gave a regression model with a confidence interval of 95 %. The model has an approach of 91.77 % of the real phenomenon. This process is carried out to obtain learning with the right level of trust, which enables a suitable prediction of the power levels in the solar panels.

Fig. 4: Correlation variables plots for (a) luxes, temperature and power; (b) humidity, luxes and power; and (c) temperature, humidity and power.
## IV Discussion and Conclusions

During this study, it was observed that the most suitable neural network topology changes according to the input variables because of the lowest RMSE value. Experiments were conducted with different training cycles, input information, number of neurons, and hidden layers to discern their execution, then choose the most appropriate for each set of data. The prototype used has certain limitations, such as the resolution and ranges of the measurements and the flow of the readings. A comparison was made to verify the prototype's values besides a commercial station located at the Technological Institute of Morelia, Mexico. The RMSE calculation of 0.19309 determines that the prototype data is reliable for estimating.

\begin{table}
\begin{tabular}{c c c c c c}
**Source** & **DF** & **Adj SS** & **Adj MS** & **F-Value** & **P-Value** \\ \hline Regression & 3 & 10159.50 & 3386.51 & 5895.20 & 0.000 \\ Illumination & 1 & 2761.10 & 2761.10 & 4806.50 & 0.000 \\ Temperature & 1 & 6.80 & 6.78 & 11.81 & 0.001 \\ Humidity & 1 & 47.00 & 47.01 & 81.83 & 0.000 \\ Error & 1586 & 911.10 & 0.57 & & \\ Total & 1589 & 11070.60 & & & \\ \end{tabular}
\end{table} TABLE II: ANOVA Analysis of the \(x\) variables (independent variables) and the \(y\) variable (dependent variable).

Fig. 5: Graphical comparison of estimated data against actual data for the best topology of two and three input variables
The discrimination process, and creation of the data sets, were performed in Matlab(r). The most suitable configuration was determined to carry out both instantaneous estimates and short-term forecasts. The most suitable topology for neural networks and their parameters (the number of computational elements, the number of hidden layers, the number of inputs and outputs, and training cycles) has been identified. The determination of each parameter starts from a proposed random topology, thus reaching the 3:3:1 configuration with 5,000 training cycles. This configuration allows knowing instantly how the solar panel will behave under normal conditions. The results obtained in this work show that the best option for the estimation is the 3:3:1 topology of the neural network, which uses three variables (lighting, temperature, and humidity), which allows estimating how much power you can get from a panel. As for forecasts, the best configuration is a 9:4:3:1 network. Even when using two variables gives a more significant error in the estimation than when using the three variables, this error being 0.30320 is reliable for the estimation.

This article introduces a solar forecasting algorithm based on the artificial neural network (ANN) model. The proposed model has a 3:3:1 topology with 5,000 training cycles. The clear sky model and meteorological data from the prototype are used to train the model. The prototype and the meteorological station of the Technological Institute of Morelia, located in Morelia, Mexico, were compared. The RMSE value confirms that it is possible to make sensible estimates using the lighting, temperature, and humidity data. Forthcoming work will direct on developing a more comprehensive multi-layer ANN model taking into account rainfall factors and time of day, as well as using a more massive data set to train the ANN model to achieve greater forecast accuracy. Also, the system's accuracy must be improved.

## V Acknowledgments

The authors would like to acknowledge the "Consejo Nacional de Ciencia y Tecnologia" (CONACYT) for the support received for developing this project by supporting student 625015, also to The "Tecnologico Nacional de Mexico" (TecNM) that supports the project 6127.17-P, and the "National Laboratory SEDEAM" by helping the development of the electronic prototypes.

## VI Conflict of interest

The authors declare that there is no conflict of interest.
