Configurable IoT Open-Source Hardware and Software I-V Curve Tracer for Photovoltaic Generators

Photovoltaic (PV) energy is a renewable energy resource which is being widely integrated in intelligent power grids, smart grids, and microgrids. To characterize and monitor the behavior of PV modules, current-voltage (I-V) curves are essential. In this regard, Internet of Things (IoT) technologies provide versatile and powerful tools, constituting a modern trend in the design of sensing and data acquisition systems for I-V curve tracing. This paper presents a novel I-V curve tracer based on IoT open-source hardware and software. Namely, a Raspberry Pi microcomputer composes the hardware level, whilst the applied software comprises mariaDB, Python, and Grafana. All the tasks required for curve tracing are automated: load sweep, data acquisition, data storage, communications, and real-time visualization. Modern and legacy communication protocols are handled for seamless data exchange with a programmable logic controller and a programmable load. The development of the system is expounded, and experimental results are reported to prove the suitability and validity of the proposal. In particular, I-V curve tracing of a monocrystalline PV generator under real operating conditions is successfully conducted.


Introduction
Photovoltaic (PV) technology is one of the most widespread renewable energy sources (RES) [1,2] and contributes to reducing greenhouse gas emissions and fighting against climate change [3]. In intelligent energy facilities conceived under the paradigm of smart grids and microgrids, PV generators are commonly the main source of renewable energy [4]. In these facilities, PV can be combined with other equipment for energy production and consumption such as wind turbines, batteries, and hydrogen-related devices (fuel cells and electrolyzers).
In PV-based grids, it is required to monitor the state and operation of the PV devices. In this regard, the efficiency of PV cells under natural conditions is measured using currentvoltage (I-V) characteristic curves [5]. Consequently, to evaluate the performance of PV modules, it is necessary to measure their I-V output characteristics [6].
I-V curves are obtained by performing a voltage sweep on the PV module, while measuring the output current which is delivered to a connected load [5]. Such curves display maximum voltage and current values of a module in a given setting [5]. This way, the analysis of the curves provides direct information on the electrical state of the module, allowing the researcher to obtain data on the expected performance under different conditions of irradiance and load [7]. The measurement system used to acquire data of the PV modules and to visualize the I-V curve is commonly known as the I-V curve tracer.
In the context of RES, monitoring and data acquisition are essential to recognize the resources available on-site, evaluate electrical conversion efficiency, detect failures, and optimize electrical production [8]. In particular, the characterization of PV modules through I-V curves is required for different purposes, and the applicability of such curves Moreover, within custom-designed curve tracers, new developments are progressively including Internet of Things (IoT) open-source technology. Namely, open-source hardware platforms such as Arduino and Raspberry Pi (RPi) are being introduced in research projects and facilities. In the scope of PV energy, these devices are applied for data acquisition and monitoring tasks. For example, Arduino is used in [25,26] to sense the temperature of PV modules. With higher computation capabilities, the RPi microprocessor is used to implement monitoring systems for PV-based microgrids in [4,27,28] and for PV plants in [5,29,30].
In particular, to deploy I-V curve tracers, there are still scarce developments involving such IoT open-source technology, so the most recent research works will now be discussed. Within the open-source community, there is information publicly available about I-V curve tracers using Python and the Arduino microcontroller [31]. In the curve tracer proposed in [21], Arduino is responsible for managing a capacitive load, while data storage and visualization are performed by a PC. Arduino is used together with a commercial data logger in [32] to handle a MOSFET load in order to trace I-V curves of PV modules. An Arduino together with a PC is used in [33] to deploy an I-V curve tracer, the PC acting as a storage means for the measured data. The work reported in [34] applies an Arduino board with data storage on an SD card to collect the data of PV modules under shading conditions. Papageorgas et al. [10] develop a low-cost curve tracer involving an open-source platform with an embedded microcontroller called Polytropon and message queueing telemetry transport (MQTT) as a communication protocol.
Regarding the use of RPi, the following works are found. In [35], an IoT-based remote I-V tracing system is developed using an RPi and a cloud-based server aimed at analyzing soiling losses in distributed solar facilities. An RPi is used in [36] to implement a plug and play I-V curve tracer oriented toward the diagnosis of PV modules. A power MOSFET transistor is used as the electronic load during characterization, the data being recorded on the RPi and on an intermediate file transfer protocol (FTP) server. In [37], an RPi is used as the main component in a so-called outdoor test facility (OTF) with IoT capabilities employed to capture I-V and P-V curves of PV modules. Python scripts are used, and experimental validation is reported.
Some relevant requirements and trends of curve tracers have been identified in the previous literature. For example, in [33], it is pointed out that the measure of the entire I-V curve in a short time requires a suitable data acquisition device. Reference [7] identifies various trends in the advancement of curve tracers, among which low-cost measurement systems and low-cost communications are highlighted. In the same sense, the important role that reliable low-cost communications play is emphasized in [15].
The utilization of open-source and IoT technologies for curve tracing and monitoring constitutes another new trend [16,38]. Furthermore, such technologies encourage the previously mentioned trends of low-cost measurements and communication systems. These technologies provide rapid development and cost-effective solutions for smart monitoring systems [16]. Related to costs, as pointed out in [24], the low-cost characteristic of open-source platforms provides greater accessibility to I-V curve tracing equipment for any research or academic center.
An issue of the existing literature is signaled in [38]: there are papers that do not offer information either about the measurement performance or about the equipment used, showing only the results. Moreover, as it is asserted in [7], most of the curve tracers found in the literature are complex and difficult to integrate in real scenarios.
Aiming at overcoming the aforesaid drawbacks and integrating the identified trends, this paper presents the development of a novel IoT open-source hardware and software I-V curve tracer to characterize PV generators. The RPi microcomputer composes the hardware level; concerning software, Python, MariaDB, and Grafana are applied for data acquisition, storage, and visualization. Open communication protocols, such as Modbus TCP, enable seamless data exchange with proprietary equipment. The program coded in Python is responsible for automating the curve tracing of the PV modules through the modification of the current demanded by an electronic programmable load. The developed system is oriented towards the I-V curve tracing for already existent functioning facilities that require diagnostics, analyses, and/or modeling. In such a situation, this curve tracer is coupled to the facility by means of open protocols and shares data without altering the installation.
For the sake of clarity, a table summarizing the aforementioned literature as well as the present proposal has been elaborated ( Table 1). The considered categories are the following: Device, referred to as the equipment used to collect data from PV modules; Load, to indicate the type of load; Data storage means, to discriminate if local (within the Device) or remote accumulation is applied; Language, for a clear identification of the programming language used to gather data; and Communication, in order to specify the protocols for data sharing. In the cases where the information has not been found, Unspecified has been written. IoT open-source device is used to gather data from sensors and handle the load, data storage and visualization being performed by external equipment or services such as PCs or cloud servers. The present work is the only proposal where the RPi is responsible for automating all the tasks involved in the I-V tracing: load sweep, data acquisition, data storage, communications, and visualization in real-time.
Moreover, as can be observed in Table 1, some works do not report information about certain aspects such as the programming language or data storage means (software or hardware), as it has been previously indicated in [38]. Moreover, none of the surveyed references apply a programmable electronic load to perform the I-V tracing. Resistive, capacitive, or electronic loads (power MOSFET) are among the common methods [7], but they require designing specific electronic circuitry for the curve tracing process and only serve for such a purpose. On the contrary, programmable loads are commonly used in microgrids and PV facilities [4,20,[39][40][41] to emulate the behavior of DC or AC loads in order to test control algorithms and energy management strategies under different load profiles. In this regard, the target groups of this paper are scientists and practitioners in the scope of PV-based microgrids and facilities involved in research and development (R&D) activities.
In addition, the validation of the proposal is performed with a medium-scale PV generator under real conditions, which constitutes a requirement to demonstrate the suitability of open-source technologies [4].
It must be remarked that the presented curve tracer is used to characterize and diagnose a PV generator integrated in a smart microgrid (SMG) which combines renewable sources with hydrogen. Such a facility is framed in an R&D project envisioned to develop a digital replica of the subsystems of the microgrid.
The main contributions of the work are now summarized: • Open-source hardware and software is applied for data storage and visualization. As a consequence, easy and low-cost deployment and replication are feasible; • Open communication protocols are used to provide a seamless data exchange; • The curve tracer can be coupled to an already existent PV generator and gather operational data; The structure of the rest of the paper is as follows. The Section 2 describes the developed I-V curve tracer concerning hardware, software, and communications. Section 3 deals with the achieved results from a PV generator of 1100 W, whereas the associated discussion is carried out in Section 4. Finally, the main conclusions of the reported work and further research guidelines are addressed.

Developed I-V Curve Tracer
The developed curve tracer is solved by a software application made in Python and executed on an RPi, as well as a database and a data visualization interface. The version of the microcomputer is the RPi 3 model B+. As commented in the previous section, the proposed curve tracer is applied to an existing SMG equipped with an automation system based on a Programmable Logic Controller (PLC) model S7_1516, which is in charge of the energy management of the SMG. Figure 1 shows the interconnection of all the devices used in the I-V curve tracer. This figure shows the sensors involved (irradiance, voltage, current) together with the PLC, the RPi, and a programmable electronic load. The proposed platform takes advantage of an electronic programmable load model Prodigit 32612A (New Taipei City, Taiwan). This legacy device accepts communication through an RS232 interface in order to exchange commands and is used to configure the current profiles demanded by the photovoltaic panels.
The communications diagram of the deployed system can be seen in Figure 2. The RPi acts as a Grafana server, so the user/operator can visualize and download the data processed by the curve tracer through a web browser running on a computer or smartphone connected to the Internet. Namely, the Grafana software provides a user-friendly graphical user interface (GUI) for real-time access to numerical and graphical information about the measurements of the PV system during the tracing.
Among other elements, the RPi includes serial communication through universal serial bus (USB) ports, so a protocol converter from USB to RS232 has been required to establish communication between the load and the RPi.
Concerning sensors, Table 2 summarizes the magnitudes that are measured and the corresponding sensor. It must be noted that the required sensors could be connected to the RPi in a direct manner or through proper electronic boards. In this sense, the presented solution is applicable to already existing automation and monitoring systems or for new facilities without such systems. Using open protocols, such as Modbus TCP, enables easy communication given the widespread availability of this protocol in automation and energy-related equipment [28]. In addition, Modbus TCP has been pointed out as an industrial IoT communication protocol [42] and is supported by both open-source and proprietary equipment. The communications diagram of the deployed system can be seen in Figure 2. The RPi acts as a Grafana server, so the user/operator can visualize and download the data processed by the curve tracer through a web browser running on a computer or smartphone connected to the Internet. Namely, the Grafana software provides a userfriendly graphical user interface (GUI) for real-time access to numerical and graphical information about the measurements of the PV system during the tracing.
Among other elements, the RPi includes serial communication through universal serial bus (USB) ports, so a protocol converter from USB to RS232 has been required to establish communication between the load and the RPi. Concerning sensors, Table 2 summarizes the magnitudes that are measured and the corresponding sensor. It must be noted that the required sensors could be connected to the RPi in a direct manner or through proper electronic boards. In this sense, the presented solution is applicable to already existing automation and monitoring systems or for new facilities without such systems. Using open protocols, such as Modbus TCP, enables easy communication given the widespread availability of this protocol in automation and energy-related equipment [28]. In addition, Modbus TCP has been pointed out as an industrial IoT communication protocol [42] and is supported by both open-source and proprietary equipment.  The communications diagram of the deployed system can be seen in Figure 2. The RPi acts as a Grafana server, so the user/operator can visualize and download the data processed by the curve tracer through a web browser running on a computer or smartphone connected to the Internet. Namely, the Grafana software provides a userfriendly graphical user interface (GUI) for real-time access to numerical and graphical information about the measurements of the PV system during the tracing.
Among other elements, the RPi includes serial communication through universal serial bus (USB) ports, so a protocol converter from USB to RS232 has been required to establish communication between the load and the RPi. Concerning sensors, Table 2 summarizes the magnitudes that are measured and the corresponding sensor. It must be noted that the required sensors could be connected to the RPi in a direct manner or through proper electronic boards. In this sense, the presented solution is applicable to already existing automation and monitoring systems or for new facilities without such systems. Using open protocols, such as Modbus TCP, enables easy communication given the widespread availability of this protocol in automation and energy-related equipment [28]. In addition, Modbus TCP has been pointed out as an industrial IoT communication protocol [42] and is supported by both open-source and proprietary equipment.  A block diagram with the functionalities associated with each component is illustrated in Figure 3. From a functional viewpoint, it is interesting to note that all the tasks required for the process of I-V curve tracing rely on the RPi. On the one hand, this microprocessor acquires data from the PLC and stores them in a database (mariaDB). Data backup is also handled by the RPi together with other system tasks. On the other hand, the programmable load is managed through Python commands. Lastly, the Grafana server is hosted to establish Internet-enabled data visualization in real-time.
A block diagram with the functionalities associated with each component is illustrated in Figure 3. From a functional viewpoint, it is interesting to note that all the tasks required for the process of I-V curve tracing rely on the RPi. On the one hand, this microprocessor acquires data from the PLC and stores them in a database (mariaDB). Data backup is also handled by the RPi together with other system tasks. On the other hand, the programmable load is managed through Python commands. Lastly, the Grafana server is hosted to establish Internet-enabled data visualization in real-time.  First of all, the irradiance existing at a given time is measured. It is verified whether the measured irradiance exceeds the preset threshold of 100 W/m 2 to initiate the current profile generation and data acquisition processes. Once the minimum irradiance condition is met, a profile of the current demanded by the electronic load is created, which progressively increases from zero to the maximum possible current that the PV module(s) can deliver for the sensed irradiance. The maximum value is calculated based on the existing modules configuration and the irradiance at each moment. This ensures that the PV generator will not be required to provide currents that cannot be achieved for this irradiance value. In particular, the following equation has been used to determine the maximum current, Imax: where np is the number of paired modules, and G is the incident irradiance on the plane of the modules. The following step consists of establishing communication via RS232 from the RPi to the programmable electronic load, so the current value corresponding to each instant is sent. Next, the RPi takes the sensor data obtained by the PLC through a Modbus TCP channel, as well as from the electronic load itself through the RS232 connection. After this, the retrieved data are stored in a mariaDB database specifically designed for this purpose  First of all, the irradiance existing at a given time is measured. It is verified whether the measured irradiance exceeds the preset threshold of 100 W/m 2 to initiate the current profile generation and data acquisition processes. Once the minimum irradiance condition is met, a profile of the current demanded by the electronic load is created, which progressively increases from zero to the maximum possible current that the PV module(s) can deliver for the sensed irradiance. The maximum value is calculated based on the existing modules configuration and the irradiance at each moment. This ensures that the PV generator will not be required to provide currents that cannot be achieved for this irradiance value. In particular, the following equation has been used to determine the maximum current, Imax: where np is the number of paired modules, and G is the incident irradiance on the plane of the modules.
Sensors 2021, 21, x FOR PEER REVIEW 8 of 22 ( Figure 5). This process is carried out continuously for each PV module current until the maximum current set is reached.
In this way, all the necessary data for the characterization of the photovoltaic panels are acquired and stored. As a sample, Figure 6 shows the data taken for the characterization of the PV modules.
To achieve representative data, the irradiance should change as little as possible during the characterization. Each acquisition cycle can vary from 24 s, for an irradiance of 200 W/m 2 and a single panel configuration (12 samples), to 320 s, considering an irradiance of 1000 W/m 2 for the whole group of panels (320 samples), keeping the step sampling rate at 0.1 A. During these short intervals, irradiance is scarcely altered.
On the other hand, Figure 7 shows a screenshot of part of the Python code running to automate the labeled stages and, hence, the I-V curve tracing.
Aiming to illustrate the described sequence, the main code of Python concerning the load management is shown in Algorithm 1. To begin with, an instance for communication is created, specifying parameters such as port, transmission bit rate, parity bit, etc. After that, the connection is open, and the commands to determine the load current are sent. Namely, the load is activated, the operation mode is selected, and the current demanded to the PV module(s) is established. Moreover, the reached voltage and current values are retrieved. Finally, the connection is closed.   The following step consists of establishing communication via RS232 from the RPi to the programmable electronic load, so the current value corresponding to each instant is sent. Next, the RPi takes the sensor data obtained by the PLC through a Modbus TCP channel, as well as from the electronic load itself through the RS232 connection. After this, the retrieved data are stored in a mariaDB database specifically designed for this purpose ( Figure 5). This process is carried out continuously for each PV module current until the maximum current set is reached.   In this way, all the necessary data for the characterization of the photovoltaic panels are acquired and stored. As a sample, Figure 6 shows the data taken for the characterization of the PV modules.   To achieve representative data, the irradiance should change as little as possible during the characterization. Each acquisition cycle can vary from 24 s, for an irradiance of 200 W/m 2 and a single panel configuration (12 samples), to 320 s, considering an irradiance of 1000 W/m 2 for the whole group of panels (320 samples), keeping the step sampling rate at 0.1 A. During these short intervals, irradiance is scarcely altered.
On the other hand, Figure 7 shows a screenshot of part of the Python code running to automate the labeled stages and, hence, the I-V curve tracing.
Aiming to illustrate the described sequence, the main code of Python concerning the load management is shown in Algorithm 1. To begin with, an instance for communication is created, specifying parameters such as port, transmission bit rate, parity bit, etc. After that, the connection is open, and the commands to determine the load current are sent. Namely, the load is activated, the operation mode is selected, and the current demanded to the PV module(s) is established. Moreover, the reached voltage and current values are retrieved. Finally, the connection is closed.

Results
In this section, the experimental results of applying the I-V curve tracer are reported to demonstrate its successful operation. Namely, a PV generator hybridized with hydrogen in a stand-alone SMG, placed at the University of Extremadura (Spain), is fully characterized.

Experimental Setup
The PV generator (Figure 8) consists of six monocrystalline modules, each one with maximum output of 185 W, providing a total power of 1110 W. These modules have a fixed inclination angle, the irradiance measured being in the same plane. The main parameters of the PV modules are listed in Table 3. Note that electric characteristics are given for STC by the manufacturer.  The curve tracer is coupled to the PLC and the load of the SMG in the laboratory as can be observed in Figure 9a. Note that an Ethernet switch allows data exchange between the RPi and the PLC. The programmable load can be seen in Figure 9b, also placed in the laboratory setup. On the other hand, the block diagram of the SMG is depicted in Figure  10. As can be observed, the PV array is linked to a DC voltage bus through a solar charger. A battery acts as electrochemical energy storage whilst the programmable load conducts the energy consumer role. Regarding hydrogen generation and consumption, an electrolyzer (EL) produces hydrogen, harnessing the surplus of PV energy, and a fuel cell (FC) performs the opposite process, converting hydrogen into electricity when there is no renewable energy availability. A more detailed description of the SMG components can be found in [4,28].  The curve tracer is coupled to the PLC and the load of the SMG in the laboratory as can be observed in Figure 9a. Note that an Ethernet switch allows data exchange between the RPi and the PLC. The programmable load can be seen in Figure 9b, also placed in the laboratory setup. On the other hand, the block diagram of the SMG is depicted in Figure 10. As can be observed, the PV array is linked to a DC voltage bus through a solar charger. A battery acts as electrochemical energy storage whilst the programmable load conducts the energy consumer role. Regarding hydrogen generation and consumption, an electrolyzer (EL) produces hydrogen, harnessing the surplus of PV energy, and a fuel cell (FC) performs the opposite process, converting hydrogen into electricity when there is no renewable energy availability. A more detailed description of the SMG components can be found in [4,28].

Data Visualization
The measurement process was carried out during different days due to the variability of weather conditions (cloudy and rainy days, etc.). More than 194,000 samples were recorded during the whole measurement campaign. The stored data are represented through the GUI created in Grafana, which displays the involved magnitudes in the form of time-series.
As a proof of the visualization capabilities, Figure 11      the PV generator, which fluctuates according to the management performed by the Python program of the curve tracer. Figure 12 contains a detailed view of the GUI during the same day for a better observation of the magnitude evolution. In the top graph, it can be seen that the current delivered by the PV generator (blue color) and the load current (red color) are coincident and both exhibit a saw tooth-shaped evolution, coherent with the implemented algorithm. The sensed irradiance during the viewed interval is 1027 W/m 2 . In order to verify the capabilities of the curve tracer, the computational resources of the RPi are also monitored by means of Grafana. To this aim, the GUI includes a dashboard based on Telegraf [43] to visualize the central processing unit (CPU) temperature and load, memory usage, and network statistics. Figure 13 shows this dashboard during the characterization experiments on the same day shown in the previous figures. There are some relevant aspects to discuss in this sense. The usage of CPU is observable in the graph placed in the top left position, and its nominal value is around 4%. There are certain intervals during which the usage rises up to 17% for the system (yellow color) and up to 54% for the user (green color), respectively. These increments are due to Grafana operations, e.g., access for online monitoring and requests to the database. Another parameter is the memory usage (graph in the low and left part) where less than 1 GB is used (yellow line) and around 1 GB is cached (blue line), leaving 2 GB free (orange line), showing a Figure 11. Grafana GUI displaying time-series of PV current and irradiance during a day of characterization. Figure 12 contains a detailed view of the GUI during the same day for a better observation of the magnitude evolution. In the top graph, it can be seen that the current delivered by the PV generator (blue color) and the load current (red color) are coincident and both exhibit a saw tooth-shaped evolution, coherent with the implemented algorithm. The sensed irradiance during the viewed interval is 1027 W/m 2 .   In order to verify the capabilities of the curve tracer, the computational resources of the RPi are also monitored by means of Grafana. To this aim, the GUI includes a dashboard based on Telegraf [43] to visualize the central processing unit (CPU) temperature and load, memory usage, and network statistics. Figure 13 shows this dashboard during the characterization experiments on the same day shown in the previous figures. There are some relevant aspects to discuss in this sense. The usage of CPU is observable in the graph placed in the top left position, and its nominal value is around 4%. There are certain intervals during which the usage rises up to 17% for the system (yellow color) and up to 54% for the user (green color), respectively. These increments are due to Grafana operations, e.g., access for online monitoring and requests to the database. Another parameter is the memory usage (graph in the low and left part) where less than 1 GB is used (yellow line) and around 1 GB is cached (blue line), leaving 2 GB free (orange line), showing a stable behavior. Concerning the CPU temperature, it has a stable value around 35 • C, being an appropriate level to avoid overheating issues.

I-V Curves of PV Generator
To achieve a proper validation, I-V curves have been obtained under real operating conditions for the PV generator. In addition, three configurations of the modules have been applied: a single module, a pair of modules connected in series, and the whole generator, consisting of the parallel connection of three pairs.
For the curve tracing, it has been required to select the data for the different irradiances close to the values commonly provided by manufacturers and reported in the literature, namely 200 W/m 2 , 400 W/m 2 , 600 W/m 2 , 800 W/m 2 , and 1000 W/m 2 . Due to the short duration of the data acquisition intervals, the initial and final values of irradiance are averaged. Table 4 shows the measurements of the incident irradiance and the temperature

I-V Curves of PV Generator
To achieve a proper validation, I-V curves have been obtained under real operating conditions for the PV generator. In addition, three configurations of the modules have been applied: a single module, a pair of modules connected in series, and the whole generator, consisting of the parallel connection of three pairs.
For the curve tracing, it has been required to select the data for the different irradiances close to the values commonly provided by manufacturers and reported in the literature, namely 200 W/m 2 , 400 W/m 2 , 600 W/m 2 , 800 W/m 2 , and 1000 W/m 2 . Due to the short duration of the data acquisition intervals, the initial and final values of irradiance are averaged. Table 4 shows the measurements of the incident irradiance and the temperature of the modules during the characterization campaign for each one of the described electrical configurations. Moreover, electrical parameters of the generator can be measured in the I-V curves, such as short circuit current, open-circuit voltage, fill factor, etc.; hence, in Table 4, such parameters are also included. Figure 14 shows the I-V curves obtained for a single module. The shape and trend of the curves correspond to those expected, matching the information provided by the manufacturer. As can be observed, the open circuit voltage (Voc) decreases whilst the irradiation increases. This effect is due to the associated temperature increase, which causes the curves to move to the left. In particular, the open circuit voltage strongly depends on temperature, while its dependence on irradiance has a modest effect [17]. This relationship can be expressed through Equation (2) [17]: where Voc, STC is the open circuit voltage for STC, T STC corresponds to the STC temperature, and µ Voc is the voltage temperature coefficient, found in the PV module datasheet. For the LDK Solar 185D-24S, such a coefficient has a value of −0.34%/ • C, so it is easy to check that temperature increments give place to decrements of Voc.   The maximum power produced (165 W) by the module is lower than that reported by the manufacturer (185 W) given the fact that the existing conditions differ from the In a similar sense, the power-voltage (P-V) curve can also be plotted from the acquired data; for instance, Figure 15 shows such a curve for the single PV module. Valuable information such as the maximum power point values (power, current, and voltage) for sensed irradiances can be studied through these curves.
The maximum power produced (165 W) by the module is lower than that reported by the manufacturer (185 W) given the fact that the existing conditions differ from the STC. Moreover, the degradation of the module also contributes to reducing the peak power that can be delivered.  The maximum power produced (165 W) by the module is lower than that reported by the manufacturer (185 W) given the fact that the existing conditions differ from the STC. Moreover, the degradation of the module also contributes to reducing the peak power that can be delivered.
Following the validation procedure reported in [23,33,34,36,37], the experimental measurements are reproduced by means of a simulator of PV modules based on the SDM. This model is based on the equivalent circuit and is the most widely used method to provide an estimation of the current generated by a PV cell. The circuit consists of a single diode connected in parallel with a photo-generated current source (IPH), a series resistance (RS) to represent voltage drops and internal losses, and a shunt resistance (RSH) to take into account the leakage currents. Equation (3) describes the model for a module of NS cells in series: where Io is the saturation current of the diode, V is the output voltage, and VTH is the thermal equivalent voltage. The last variable is given in terms of the electron charge, q; the Boltzmann constant, K; the cell temperature, T; and the diode ideality factor, n, according to Equation (4): Figure 15. P-V curves for a single PV module.
Following the validation procedure reported in [23,33,34,36,37], the experimental measurements are reproduced by means of a simulator of PV modules based on the SDM. This model is based on the equivalent circuit and is the most widely used method to provide an estimation of the current generated by a PV cell. The circuit consists of a single diode connected in parallel with a photo-generated current source (I PH ), a series resistance (R S ) to represent voltage drops and internal losses, and a shunt resistance (R SH ) to take into account the leakage currents. Equation (3) describes the model for a module of N S cells in series: where I o is the saturation current of the diode, V is the output voltage, and V TH is the thermal equivalent voltage. The last variable is given in terms of the electron charge, q; the Boltzmann constant, K; the cell temperature, T; and the diode ideality factor, n, according to Equation (4): The I-V curve experimentally measured with the curve tracer at an irradiance of 1019 W/m 2 and temperature of 45.1 • C is plotted in Figure 16 (black color) together with the curve provided by the SDM simulator (orange color). As can be observed, the curves show the same trend with very scarce differences. Namely, the ideality factor of the SDM explains the difference appreciated in the knee of the curve [36].
For a better appreciation, the difference between the currents (simulated and measured) can be used to illustrate the achieved fitting [44,45]. In this regard, Figure 17 shows the difference of currents for the characterized module versus the voltage at the reported irradiance levels. The errors are small, reaching a maximum value of 0.21 A for 870 W/m 2 . In Figures 14 and 17, it can be seen that the maximum values of these differences are located in a reduced range between the maximum power point (voltage higher than 29 V) and the Voc. These results exhibit proper agreement with the well-known SDM.
The traced I-V curves for a pair of modules connected in series are depicted in Figure 18. The shape observed in the traced curves allows diagnosing or detecting diverse effects in the PV modules, as pointed out in previous works [7,36]. In this case, the curves show a certain alteration in the inflection point and slopes, which indicate the degradation of one of the modules. Therefore, these curves serve for fault detection and diagnostics; namely, aging effects, cell cracking, hot spots, potential induced degradation, and other deterioration situations can be detected. In fact, the modules have been working for 10 years, so aging effects can be expected. Nonetheless, in-depth diagnosis and fault analyses are out of the scope of this paper. On the other hand, Figure 19 contains the traced P-V curves for the pair of modules.
For a better appreciation, the difference between the currents (simulated and measured) can be used to illustrate the achieved fitting [44,45]. In this regard, Figure 17 shows the difference of currents for the characterized module versus the voltage at the reported irradiance levels. The errors are small, reaching a maximum value of 0.21 A for 870 W/m 2 . In Figures 14 and 17, it can be seen that the maximum values of these differences are located in a reduced range between the maximum power point (voltage higher than 29 V) and the Voc. These results exhibit proper agreement with the well-known SDM.  The traced I-V curves for a pair of modules connected in series are depicted in Figure  18. The shape observed in the traced curves allows diagnosing or detecting diverse effects in the PV modules, as pointed out in previous works [7,36]. In this case, the curves show a certain alteration in the inflection point and slopes, which indicate the degradation of one of the modules. Therefore, these curves serve for fault detection and diagnostics; namely, aging effects, cell cracking, hot spots, potential induced degradation, and other deterioration situations can be detected. In fact, the modules have been working for 10 years, so aging effects can be expected. Nonetheless, in-depth diagnosis and fault analyses ured) can be used to illustrate the achieved fitting [44,45]. In this regard, Figure 17 shows the difference of currents for the characterized module versus the voltage at the reported irradiance levels. The errors are small, reaching a maximum value of 0.21 A for 870 W/m 2 . In Figures 14 and 17, it can be seen that the maximum values of these differences are located in a reduced range between the maximum power point (voltage higher than 29 V) and the Voc. These results exhibit proper agreement with the well-known SDM.  The traced I-V curves for a pair of modules connected in series are depicted in Figure  18. The shape observed in the traced curves allows diagnosing or detecting diverse effects in the PV modules, as pointed out in previous works [7,36]. In this case, the curves show a certain alteration in the inflection point and slopes, which indicate the degradation of one of the modules. Therefore, these curves serve for fault detection and diagnostics; namely, aging effects, cell cracking, hot spots, potential induced degradation, and other deterioration situations can be detected. In fact, the modules have been working for 10 years, so aging effects can be expected. Nonetheless, in-depth diagnosis and fault analyses are out of the scope of this paper. On the other hand, Figure 19 contains the traced P-V curves for the pair of modules.    Finally, the I-V curves captured for the whole PV generator are shown in Figure 20. The corresponding P-V curves are depicted in Figure 21. As in the previous figures, the curves display the expected operation of the generator and can be applied for diagnostics purposes. Finally, the I-V curves captured for the whole PV generator are shown in Figure 20. The corresponding P-V curves are depicted in Figure 21. As in the previous figures, the curves display the expected operation of the generator and can be applied for diagnostics purposes.  Finally, the I-V curves captured for the whole PV generator are shown in Figure 20. The corresponding P-V curves are depicted in Figure 21. As in the previous figures, the curves display the expected operation of the generator and can be applied for diagnostics purposes.

Discussion
Experimental results provide I-V curves for different electrical configurations and environmental conditions, emphasizing the suitability of the designed curve tracer.
The main strength is that the developed system is not limited to data acquisition of PV modules for I-V curves, but data recording and visualization in real-time during the

Discussion
Experimental results provide I-V curves for different electrical configurations and environmental conditions, emphasizing the suitability of the designed curve tracer.
The main strength is that the developed system is not limited to data acquisition of PV modules for I-V curves, but data recording and visualization in real-time during the characterization are also entirely approached. Indeed, once the desired conditions are programmed, the fully autonomous operation of the curve tracer is achieved without requiring the intervention of the operator.
The deployed curve tracer consists of the RPi and the associated software, whilst a PLC and a programmable load of an experimental SMG are used to validate the operation of such curve tracer.
The computational capabilities of the microprocessor are proven to be adequate to resolve for data acquisition, storage, and visualization. It must be emphasized that none of the previous literature provides information in this regard.
Using an in-house database (mariaDB) and a web-enabled user interface (Grafana) avoids dependencies on external servers and the associated hosting or licensing costs. Hosting on one's own databases even implies a total control of administration aspects [4].
As a proof of concept, in the reported application case, Modbus TCP and RS232 have been used. However, the curve tracer can manage virtually any communication protocol given the wide availability of libraries on the Internet. Furthermore, this ability to support many other protocols provides features such as configurability and modularity, facilitating interoperability [46].
In particular, the use of open communication protocols such as Modbus TCP together with the ability of the open-source equipment allows for the establishment of seamless data exchange. This way, proprietary equipment (PLC) is combined with the curve tracer without interoperability issues. In fact, logical connections through communication protocols enable measurement information sharing and facilitate integration in real scenarios, which constitutes a disadvantage in most of the curve tracers in the literature [5]. In this regard, the deployed system is focused on PV facilities already existent, so the coupling is made through the aforementioned open protocol. The curve tracer even makes use of already existing sensors, which is a benefit since the PV generator can be re-characterized when required without essential alterations in the electrical and communications schemes.
Instead of using a variable resistor, capacitive load, or a power MOSFET, the proposal employs a real electronic programmable load to perform the I-V tracing. In addition, the used load is legacy equipment which does not support modern communication interfaces, so being able to manage such valuable equipment is an important advantage. In fact, IoT technologies must contribute to solve compatibility and interoperability issues with legacy devices [47,48].
Regarding economic assessments, the cost of the curve tracer is very low given the inexpensive nature of the IoT open-source equipment, which constitutes an advantage of scientific equipment based on this type of technology [49]. Namely, taking into account that all the software is free (Python, mariaDB, Grafana), only the RPi involves expenses; the overall cost is around EUR 70. Auxiliary elements such as a memory card, heatsink and fan for cooling, and power adapter are also included.
Analyses of the retrieved I-V curves allow decision making with respect to operation and maintenance of the PV modules as well as implementing accurate models. Moreover, further experiments will include partial shading of the PV modules in order to obtain and analyze the measured I-V curves.
Thanks to the flexibility and availability of open-source equipment, the system can be customized to fulfill particular requirements in research or academic contexts. The RPi provides a large number of analogue and digital inputs, allowing the connection of additional sensors or instruments. Indeed, advances in IoT technology, both hardware and software, can be integrated in the presented system.
Despite the obtained results, the presented system has some limitations which are now briefly described. To begin with, managing open-source technology does not imply ease of configuration when advanced functions are required. For example, programming skills and a certain expertise in communication protocols and networks are needed. In addition, the proposal does not allow online measurements of the PV modules; it is only devoted to offline characterization. For a proper data exchange, it is necessary that the automation unit (PLC or similar device) and the programmable load provide communication interfaces that the RPi can handle. It is not a probable boundary in modern devices, but for legacy equipment, it must be carefully tackled. Finally, the representation of the I-V curves requires manual data extraction from the files that Grafana stores and provides. This can be a time-consuming task when a large number of measurements have been conducted.

Conclusions
RES are key enablers for the evolution towards a more sustainable energetic global scenario, PV technology being one of the most applied RES in microgrids. In order to characterize and study the behavior of PV modules, an I-V curve tracer based on IoT opensource technologies has been presented. Namely, software such as Python, MariaDB, and Grafana run on an RPi are responsible for automating all the required tasks: load sweep, data acquisition, data storage, communications, and visualization in real-time. An open communication protocol (Modbus TCP) has been applied to exchange information with a PLC, whilst an RS232 allows for managing a legacy programmable load. Both proprietary devices belong to a research-oriented microgrid facility and serve as proof of concept to prove the suitability of the curve tracer.
It must be emphasized that this development is a novelty in the existing literature, addresses trends, and overcomes limitations identified in previous works, among which short-time measurements, low-cost measurement systems, low-cost communications, and IoT open-source technology can be highlighted.
Experimental results under real operating conditions are used to validate the proposal. Namely, a PV generator of 1110 W integrated into an SMG is characterized by means of the developed curve tracer.
Future research includes diagnostics and fault detection of the PV modules. Furthermore, another interesting topic deals with the development of an on-line characterization procedure using the presented system. Funding: This project was co-financed by European Regional Development Funds FEDER and by the Junta de Extremadura (IB18041).

Informed Consent Statement: Not applicable.
Data Availability Statement: Not applicable.

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

Abbreviations
The