Development of a Prototype for Monitoring Photovoltaic Self-Consumption Systems

: Currently, the increasing energy consumption around the world and the environmental impact resulting from the use of fossil fuel-based energy have promoted the use of renewable energy sources such as photovoltaic solar energy. The main characteristic of this type of energy is its unpredictability, as it depends on meteorological conditions. In this sense, monitoring the power generation of photovoltaic systems (PVS) in order to analyze their performance is becoming crucial. The purpose of this paper is to design a monitoring system for a residential photovoltaic self-consumption system which employs an Internet of Things (IoT) platform to estimate the photovoltaic power generation according to solar radiation and temperature. The architecture of the developed prototype will be described and the benefits of providing the use of IoT for monitoring will be highlighted, since all data collected by the data acquisition system (DAS) may be stored in the Cloud. The comparison of the results with those of other monitoring systems was very positive, with an uncertainty that complies with the IEC61724 standard.


Introduction
The growth in the number of industries and the increase in societal comfort needs have increased energy demand since the end of the 20th century. The current energy model, which is mainly based on the consumption of energy from fossil fuels, shows numerous environmental and economic disadvantages, resulting from the fact that these sources are limited, which contributes to the increase in pollution levels and the increase in their price [1,2].
The need to reduce the use of these fuels for power generation is encouraging the use of renewable energies [3,4]. Among these clean energies, photovoltaic solar energy occupies an outstanding position. The decrease in cost of this technology and the large amount of solar radiation available contribute to obtaining competitive production costs compared to the energy produced by fossil fuels or other renewable sources according to various studies [5,6]. In these studies, the unit electricity generation cost is analyzed, depending on the source used and the size of the installation. In recent years, photovoltaic self-consumption systems in buildings provide decentralized production, whereby users of these systems-prosumers-generate and consume their own energy. Photovoltaic self-consumption systems constitute an important challenge for distributed generation to integrate renewable energy sources into the electric grid in order to create a smart grid [7,8].
One of the main features of these photovoltaic systems is the difficulty that exists in forecasting the generated energy, which depends, to a great extent, on weather conditions [9,10]. Therefore, it is necessary to use monitoring systems in order to precisely estimate the photovoltaic solar energy as a function of meteorology. In the case of monitoring photovoltaic (PV) systems, it is essential to measure meteorological parameters such as irradiance and temperature, as well as electrical parameters such as generator output power PV and inverter output power [11,12].
In large-scale photovoltaic systems, the use of monitoring systems is justified, although these systems are expensive [13]. Nevertheless, installing monitoring systems in medium and small photovoltaic systems incurs additional costs, which may discourage some users from installing these systems [14,15].
To solve this type of monitoring, it would be appropriate to use data acquisition systems based on low-cost platforms. The Arduino platform, version 1, has a memory capacity of 1 kB, which is not sufficient for data storage for longer periods of time (e.g., storing nine parameters every minute a 1 kB of memory for 6 min) [16]. However, this platform has been used to develop low-cost monitoring systems for photovoltaic systems in which the data storage drawback has been solved in different ways. Moreover, portable memory modules have been considered [16][17][18]. However, this solution is based on periodic maintenance to prevent a lack of memory. In other cases, data storage has been solved by transferring data using the short message delivery service to a personal computer [19].
Furthermore, another possible solution to the problem of data storage may be found in the use of the Internet of Things concept (IoT). IoT allows the storage, processing and visualization of large amounts of data efficiently [19]. IoT platforms allow remote monitoring and do not need a web server dedicated only to this task. This leads to savings when designing a data acquisition system [20,21].
However, using IoT platforms to monitor photovoltaic systems is still a nascent field [22]. One of the first IoT experiences in which photovoltaic systems were involved was the management and monitoring of energy flows in a dwelling in which this type of system was installed [23]. Other studies describe IoT used together with DAS to monitor a photovoltaic system to store and manipulate photovoltaic self-consumption system performance. Furthermore, monthly reports on the operation of the photovoltaic system were achieved [14]. In order to monitor to upload the data to the IoT Arduino platform, General Packet Radio Service (GPRS), communication may be used when monitoring and uploading the data to the Arduino IoT. Moreover, the data in the IoT Cloud allows the users of the system to download data for the system from any device with an internet connection [24]. Arduino and IoT can be used together to monitor the operating parameters of photovoltaic systems, not only to provide system performance, but to detect system failures [25]. In this sense, photovoltaic systems connected to IoT have allowed monitoring and control routines to be performed with a greater efficiency than traditional monitoring systems or human inspections [26].
The solutions discussed above have been developed to stand-alone or grid-connected photovoltaic systems [27][28][29]. Some of these facilities use IoT and low-cost acquisition cards. However, they do not follow the recommendations defined by the IEC61724-1 standard in order to monitor photovoltaic self-consumption systems [30]. This aspect is particularly important if comparisons between different systems and the potential of this technology are to be achieved.
This paper provides a solution to the supervision of small-power photovoltaic self-consumption systems installed in homes. This type of system has grown considerably in recent years, as these systems are encouraged by Public Administrations that promote sustainable development and try to reduce the consumption of energy from non-renewable sources [3,4]. Under this line of action, we can observe policies that promote the implementation of energy generation with renewable sources in order to promote buildings with a near-zero energy balance (NZEB, nearly-zero-energy building). The development of photovoltaic self-consumption systems provides prosumers with energy and reduces the dependency on the electric grid. The hallmark of these systems is its modularity, which makes photovoltaic technology a viable option to generate renewable energy for residential consumption. Decentralized production is achieved, as users with photovoltaic self-consumption systems can produce and consume the energy generated at the site. This growing inclusion of photovoltaic self-consumption systems in the electricity market must be supported by monitoring systems which check the performance analysis of this type of system in real time, providing end-users with confidence in this technology. This task will be performed by monitoring systems that must provide detailed information on the operation of the system [31][32][33][34].
In this sense, this article provides a new approach to monitoring a small power commercial photovoltaic self-consumption system based on a developed DAS prototype and the Cloud computing concept. The prototype will use an IoT platform to upload and store all the parameters to be monitored, as defined in the standard IEC 61724-1. Moreover, a performance analysis using the estimated parameters defined in the standard will be presented to provide end-users with real-time information about their photovoltaic self-consumption systems.
This paper is organized as follows. In the next section, the developed prototype, with the aim of setting up a low-cost monitoring system, is presented. Firstly, the hardware of the measurement system is given, and then the software used is described. The results obtained are presented in Section 4. Finally, the conclusions together with future actions are given in Section 5.

Description of Photovoltaic Self-Consumption System
The monitored system is a commercial photovoltaic self-consumption system which has been installed in the Higher Polytechnic School of Jaén (latitude: 37°47′00′′ N and longitude 3°47′0′′ W) at the University of Jaén. It consists of an array power of 555 Wp STC (Standard Test Conditions) ( Figure  1), and an inverter model Soladin-600, with 535 W of nominal power. It must be noted that STC implies a normal irradiance (Gi) of 1000 W/m² and a cell temperature (TC) of 25 °C . The array power consists of three commercial photovoltaic modules, Deikko DKP-185, connected in series tilted 50° to the horizontal, facing south. Additional information about the main characteristics of the PV generator can be found in Table 1.  The monitored parameters concerning the array generator and the inverter, together with the metereological parameters, meet the requirements of the international standard defined IEC 61724-1 [35]. Therefore, the design of the monitoring system meets the requirements given in the class C standard for small installations. According to the requirements established for this class, two meteorological parameters must be monitored: the in-plane irradiance (Gi) and the ambient temperature (Tamb). Sampling and recording intervals of 1 and 60 min, respectively, are considered. Moreover, the electrical AC parameters that are monitored at the inverter are output power (Pout) and energy (Eout). As indicated in the standard for this type of systems, electrical parameters at the generator output such as the array current (IA) and voltage (VA) are also monitored. From the latter, estimated parameters can be obtained that provide the array performance (the array output energy, EA and array yield, YA) the inverter performance (inverter efficiency) and the system performance (final yield, YF, and system efficiency, ηf).

Architecture of the Monitoring System, Materials Used for the Development of the Prototype
In this section, the architecture of the monitoring system is presented. Figure 2 shows the block diagram of the monitoring system that has been developed, in which the data acquisition hardware (sensors and DAS) and the communication hardware with the IoT platform are highlighted. The sensor block consists of meteorological sensors and electrical sensors. These sensors also have electronic elements for signal conditioning, which are used to adapt the level of the output signals to the DAS inputs.
Solar irradiance (Gi) measurement in (W/m 2 ) can be obtained through pyranometers or other devices designed ad hoc, such as a reference cell [27,36]. In the developed prototype, the sensor that has been used to monitor Gi is based on a matrix of silicon photodiodes which our team of researchers developed as a utility model and submitted for evaluation by the Spanish Patent and Trademark Office. After the expert evaluation process, the sensor was protected with publication number ES1214734, which is described below [11,37]. This sensor has been programmed so that its output provides a pulse train with a frequency which is directly proportional to the incident radiation.
To monitor the ambient temperature, the DS18B20 digital sensor [38] was used. It measures the temperature from −55 °C to 125 °C. One of the most versatile sensors from this group is the DS18B20 by Maxim, which provides temperature measurements with a resolution of 0.0625 °C . The DS18B20 communicates over a one-wire bus that requires only one data line and ground for communication. The DS18B20 can derive power directly from the data line, eliminating the need for an additional power supply connection. Many researchers have already taken advantage of the DS18B20 in their applications, including PV monitoring applications [36,39]. In Figure 3, the encapsulation of the Gi sensor and the temperature sensor used is shown. There are different types of sensors for current measurement (IA), such as shunt resistors, which are based on the voltage fall through a conductor [40,41], and hall-effect sensors, which enable an accurate and direct current measurement. For this application, a hall-effect sensor was selected, as the shunt resistor can affect measurements when it is heated. The selected current sensor is placed on the ACS714 card as it offers different current measuring ranges, such as ±5, ±20, and ±30 A. In addition, the accuracy is improved with a simple 5 V source [42,43]. The sensor operation is based on the generation of a voltage which is directly proportional to the magnetic field produced by the current flowing through it, whose equivalence is 66 mV/1 A.
To measure VA with great precision and accuracy, the IAMA3535 device was used. The IAMA3535 is a universal signal conditioning module which can isolate and convert over 100 combinations of analog signal ranges. The IAMA3535 converts and transmits signals which are linearly proportional to the input, and it allows quick setup for over 100 standard signal conversions. By utilizing the field mode of calibration, the user can customize the input and output scaling for applications. It is a signal conditioning module with galvanic isolation which is capable of converting array PV voltages between 0 and 100 V into voltage values located in the range of 0-5 V, in order to send this signal to the DAS [44].
In Figure 4, the sensors used to measure the array current and voltage are shown.
To measure the AC electrical parameters at the inverter output (current, voltage, frequency, active, reactive and apparent power and energy), the integrated circuit Analog Device ADE7753 is used together with the sensor SCT-013 [45], which is connected to one of the ADE7753 inputs. In Figure 5, the sensor SCT-013 is shown, together with the block diagram showing the connection to the integrated circuit. The ADE7753 circuit is an energy monitor. It is a mixed processor (digital/analog) which provides information about the power used (active, reactive and apparent), using output pulses of variable frequency or following the standard serial protocol. It has two inputs: one is proportional to the load voltage, and the other one is proportional to the current that circulates through the load. Its operation consists of digitalizing the signals which are related to the load voltage and current and multiplying them so that the result is proportional to the load power [46,47]. Using its programming, the acquired signals can be processed and the calculations performed in order to estimate the energy provided by the inverter and to store these energy data in different registers. In order to provide proper measurements, a voltage transformer with galvanic isolation and antialiasing filters is incorporated in order to remove high-frequency signals.  Table 2 shows a classification of the sensors used, indicating the type of signal conditioning carried out to adapt its output signal to the input of the data acquisition system used. In order to choose the data acquisition system (DAS), proposals by other authors in this field have been taken into account, such as the aforementioned experiments [16,18,30] in which photovoltaics system monitoring was based on low-cost data acquisition systems. The monitoring of meteorological and electrical parameters in a photovoltaic stand-alone system pumping station was studied by A. Mahjoubi [21]. Temperature monitoring in applications related to solar energy was developed by H.E. Gad and Hisham. E. Gad [48]. Remote monitoring solutions, proposed by H. R. Iskandar for PVSs, provide an online application for the acquisition, recording and analysis of electrical parameters of a PVS [49]. We can also observe the DAS proposed by S. Fanourakis et al. (2017) for the monitoring of photovoltaic stand-alone systems, which performs the measurement of electrical parameters of the PVS (the voltage and current of the PVG, the battery and the loads), as well as those of the battery temperature and state of charge. This DAS works in parallel with another DAS that records data on the main faults of the grid. The information obtained by both systems is used for the maintenance of the PVS [19]. Table 3 summarizes the different characteristics of the low-cost systems used by other authors to monitor photovoltaic systems. It has been determined whether the monitoring systems follow the requirements and recommendations of the standard IEC61724-1 and whether IoT has been used in order to store and analyze the performance of the monitored photovoltaic system.  [21] No comment Arduino Uno SMS GPRS No comment [19] No comment Arduino Nano Card SD No possible No comment Concerning the DAS, it must be noted that the main element of this block is the Arduino MEGA 2560 data acquisition card (DAC), which is a very low-cost card. Furthermore, we can find a large amount of documentation on monitoring projects, such as the one presented in [18] for the design of a monitoring system for PVS. Another element of the DAS is a real-time clock (RTC) model, DS1307. This device is connected via the I 2 C communications bus (inter-integrated circuit) to the Arduino card to control the sampling time, which in this case is 1 min for all the measured parameters. In order to view the monitored parameters in situ, an LCD display is included, which is connected via the I 2 C bus. This device has been programmed to show the value of the measured parameters every 20 s.
In order to manage the communication, an Arduino Ethernet Shield has been applied to enable communication via the Ethernet, connecting to a local network socket and to the DAC via the Serial Peripheral Interface (SPI) bus. This hardware allows communication between the Arduino Mega 2560 DAC and the channel created on the IoT platform.
The connection and installation of the elements of the system have been performed with electrical equipment in water-tight conditions ( Figure 6). The main objective of the prototype is to monitor in real-time the performance of a photovoltaic self-consumption system. To achieve this goal, the proposed methodology is summarized in the flowchart shown in Figure 7.  Figure 7 shows how the developed prototype takes measurements, verifies the connection between the system and the IoT address and visualizes the measured data on the thingspeak of the prototype when monitoring a photovoltaic self-consumption system.

Study of Uncertainty
The standard uncertainty u (xi) can be evaluated through the possible variability. When it is evaluated in this way, it is called a Type B standard uncertainty. In determined cases where there is no specific knowledge about the possible values of the input quantities, it can be assumed that there is an equal probability for the input quantities. Therefore, a rectangular distribution of possible values can be assumed. In this case, the standard uncertainty can be estimated as where a is the semi-range between lower and lower limits. The standard uncertainty of the measurand is obtained by combining the standard uncertainties and is known as the combined standard uncertainty, which is denoted by uc. The combined standard uncertainty is the positive square root of the sum of each estimated variance [50]: Uncertainty values of each measurand are estimated following the recommendations of the standard.
The value of the uncertainty corresponding to the photovoltaic generator voltage (VA) depends on both the IAMA module and the analog input of the Arduino Mega. The IAMA module is a configurable universal signal-conditioning module. IAMA monitors the input voltage and provides a linearly proportional voltage output. It has been configured with a voltage input range of 0-100 V and an output voltage range of 0-5 V. The module accuracy, including linearity, has a value of 0.1% of the selected voltage range at full scale [44]. Therefore, the uncertainty associated with the IAMA module is ±0.058%. On the other hand, the output of the IAMA module is directly connected to an analog input of the Arduino Mega 2560 card with 10 bit resolution and 1024 different available codes. The resolution would be 0.098 V; therefore, the standard uncertainty associated with VA is ±0.081.
There are two factors in the photovoltaic generator current measurement: the hall-effect transducer and the analog input of Arduino card. The ACS714 sensor is used to measure IA with a range between −30 A + 30 A. The total percentage error of the current measurement is ±5% [43] over an ambient temperature range of −40 °C to 150 °C . In this sense, the uncertainty associated with the integrated circuit is ±2887%. Similarly, to VA, the output voltage which is provided by ACS714 sensor is applied to another analog input of Arduino Mega 2560. In this case, the resolution per code is 0.059 A and the standard uncertainty of the analog input is ±0.056%. The combined uncertainty associated of IA is ±2887% for a full ambient temperature range. However, when the ambient temperature is 25 °C , the total output error of the integrated ACS714 is ±1.5% and the associated standard uncertainty is ±0.87%. The combined uncertainty of IA is ±0.86% for 25 °C of ambient temperature.
In the case of PA uncertainty, it can be calculated as the combined uncertainty of the error corresponding to both the generator current and the generator voltage. In this sense, the uncertainty obtained is ±2888%.
An integrated ADE7753 circuit is used to estimate the root mean square (RMS) AC voltage and current. A voltage divider circuit with two resistors is required in order to measure the AC voltage. The resistors have a tolerance of 0.1%, and the RMS voltage measurement error provided by the integrated circuit is 0.5% [46]. As a result, the combined uncertainty of Vout has a value of ±0.090%. On the other hand, alternating current measurement also requires a current transformer. A hall-effect sensor, SCT-013T, was used as a current transformer. This sensor has a non-linearity error of ±3% [45], and the standard uncertainty has a value of 1.73%. Moreover, the output signal of SCT-013T goes through a resistor (RB) where the current is converted into voltage. Then, the voltage is measured by the multifunction meter, ADE 7753, of analog devices. The resistance has a tolerance of 0.1%; therefore, the uncertainty is ±0.058%. The multifunction metering circuit has a current RMS error of 0.5% [46]. Therefore, the combined uncertainty associated with measuring Iout is ±1.85%.
The Pout uncertainty may be estimated as the combined uncertainty of Iout and Vout, but also another error source should be added. This error is due to the phase error between channels when different analog inputs (current and voltage) are used in the integrated ADE7753 circuit. The maximum value of the phase error between channels is ±0.05%. The standard uncertainty is ±0.029%. The combined uncertainty for Pout has a value of 2.55%.
The integrated circuit ADE7753 has been used to measure the output energy (Eout). This integrated circuit supports the requirements of standard 62053-22 for class 0.5 S. This is the requirement indicated by the standard for energy monitoring.
Finally, as a summary, the required uncertainty requirements of the electrical measurements at the inverter level are shown in Table 4.

Experimental Results and Discussion
This section shows the operation of the monitoring prototype and the IoT channel for the aforementioned photovoltaic self-consumption system. Currently, there are numerous open-access IoT platforms. Although all of them allow the storage of data in real time, the one chosen in the proposed monitoring system is thingspeak, due to its compatibility with the data acquisition system used and for its possibilities for the analysis and visualization of the data through Matlab. In the study carried out by Abdul-Rahman and Graves, this platform is used for the monitoring of different parameters of interest inside a home [43]. The graphical interface is intuitive and simple, with a modular design that allows new graphics and/or indicators to be displayed depending on the type of end-user. Access can be restricted so that a user and password are required. However, in our case, anyone can access the system if the channel's web address is known (https://thingspeak.com/channels/264843).
If the channel is accessed with the administrator profile, all stored data can be accessed and selected parameters from the monitored ones can be displayed. The rest of the users can visualize the public parameters and obtain the file with the most recent data (Figure 8). Two graphs are also shown with the output power of the PVS (PA) and with the active alternating power generated (POUT) on a September day (Figure 9 and Figure 10, respectively).  In Figure 11, a column chart is shown with the energy generated (Eout) daily, on a September day. To evaluate the operation of the inverter, the relationship between the powers, PA and Pout is calculated, with which an average efficiency value of the inverter is obtained. Values are obtained from those of 90%. Figure 11. Energy generated (EOUT).
In addition to the above graphs, it is possible to download all the data acquired by the DAS. This data can be downloaded in the ".csv" format. Figure 12 shows daily monitored data (Gi, Tamb, VA and IA) for a cloudy and sunny day. For the sunny day, the current increases progressively from dawn to noon, at which time the maximum value is reached, which then decreases gradually until night falls. By contrast, on a cloudy day, many peaks caused by the increase of cloud cover are observed. As for the tension, on a sunny day, the value decreases around noon due to the effect of temperature, whereas on a cloudy day, where the temperature remained constant with very small variations, the voltage has a value of approximately 70 V from sunrise to sunset.
We also include two appendices which show the operation of the monitored prototype and the IoT channel for the photovoltaic self-consumption system. Appendix A shows the daily monitored data (VA, IA, Tamb and Gi) for a cloudy and a sunny day for each month from June 2017 to May 2018.
In addition, Appendix B shows daily monthly average values of VA, IA, Tamb and Gi from June 2017 to May 2018.

Conclusions
A new monitoring prototype for photovoltaic self-consumption systems that follows the recommendations of the IEC 61724-1 standard has been presented. This prototype provides not only measured but estimated parameters and gives a solution to the limitations of the physical memory size of hardware-software free platforms. In addition, Cloud computing allows real-time performance, allowing us to analyze PV systems according to the requirements in the IEC 61724-1 standard. Therefore, users have a ready tool at any time to learn the operating status of the PV system. The tool not only shows the measured parameters in the IoT channel, but it also provides estimated parameters from the measured ones concerning the performance of the photovoltaic system.
Two issues have been taken into account: the cost and the complexity of the system. The DAS cost should be proportional to the cost of the photovoltaic self-consumption systems, which are generally small or medium-size and the monitoring system should be easily installed and handled.
An Arduino card is proposed as a DAS because it has enough processing capacity, and a local computer for data storage is no longer necessary. In addition, the compatibility of Arduino's own programming, through the libraries of its working environment, with meteorological and electrical sensors from different manufacturers simplifies the assembly of monitoring systems for PVS.
An IoT platform is used to visualize and store the data, which allows, free of charge, an analysis of the performance of the PVS. The comparison of the results with those of other monitoring systems was very positive, with an uncertainty that complies with the IEC61724 standard. The user may learn about possible failures from any place and at any time, providing a quick solution to these problems. Moreover, the graphic interface allows the user to select graphs and indicators.
Finally, the modularity of the proposed monitoring system must be highlighted. It can be easily adapted with slight modifications to any type of PVS, such as photovoltaic stand-alone or photovoltaic grid-connected systems.
Author Contributions: All authors contributed equally to this work. All authors have read and agreed to the published version of the manuscript.
Funding: This research was funded by the Agencia Estatal de Investigación (AEI) and the Fondo Europeo de Desarrollo Regional (FEDER) aimed at the Challenges of Society (Grant No. ENE 2017-83860-R "Nuevos servicios de red para microredes renovables inteligentes. Contribución a la generación distribuida residencial").

Acknowledgments:
The authors wish thank to the University of Jaen for the programme "Plan de Apoyo a la I+D+I 2014-2015. Prorrogado hasta 2016". We also would like to acknowledge anonymous reviewers for their kind and interesting comments, which have helped us to improve the manuscript.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A
Appendix A shows daily monitored data (VA, IA, Tamb and Gi) for a cloudy and a sunny day for each month from June 2017 to May 2018.