## 2 Materials and Method
### Electronic Board Integrated in Photovoltaic Modules  
For the local measurements over each PV module, an electronic board has been designed to be installed within the module connecting box. In order to obtain a full I-V curve of the PV module under dark conditions, it is necessary to sweep the forward current injected from the bidirectional inverter explained above between zero and its maximum value (100% of \(I_{sc}\)). This way, a set of module current values and their corresponding voltage values can be measured and stored as points of the I-V curve. It is possible to perform this sweep controlling the current supplied by the bidirectional inverter, but if a good resolution in the current values is needed, it will require a  
Figure 4: Bidirectional power inverter of the Campus Duques de Soria of the University of Valladolid. precise regulation of string voltages of some hundreds of volts, increasing the complexity of the bidirectional inverter, and in addition, a communications system between the inverter and the module electronics will be required to synchronize the sweep with the measurements. For these reasons, we have opted for a local sweeping electronics integrated in the PV module. Figure 5 shows the schematic of the PV module electronic board. An 8-bit microcontroller is the heart of the circuit as it stores and executes the firmware for generating all the necessary signals that perform the I-V tracing process. For the measurement of current and voltage values, two of the microcontroller pins (labelled as V and I in Figure 5) can be configured as analog inputs for an internal analog-to-digital converter (ADC) of 10-bits. The module voltage analog input (V) is fed from the positive module terminal through a voltage divider. The resistive values of the voltage divider are much greater than the PV module \(R_{sh}\); therefore, they do not alter the module parallel resistance. This divider reduces the module voltage for a full-scale matching with the positive reference of the ADC (5 V). Consequently, the resolution of the 10-bits ADC is 5 mV (5 V/1024), which corresponds with the full scale of the I-V curve measurement, which results in a resolution of 50 mV (50V/1024) in voltage measurements. The module current is measured with an AMR (Anisotropic Magnetoresistance) sensor (\(I_{s}\)), which outputs a voltage proportional to the current with a 5 volts swing for a current value from zero to 5 Amps, so it can be connected directly to the 10 bit ADC input (\(I\)). This setup allows for a current resolution of 5 mA (5 Amps/1024). The MOSFET transistor M1 will be responsible for the local current sweeping process. The M1 gate is driven directly by the microcontroller pin (Cm), which is configured as an analog output from an internal digital-to-analog converter (DAC). For a smooth and as linear as possible sweep, a closed control loop has been implemented in firmware, where the current and voltage values sampled by the ADC are used as a feedback for adjusting the gate voltage of M1. This strategy allows for the tuning of the control loop by simply changing some parameters in the firmware (as delay or gain). The power supply for the entire system is provided by the voltage module established when the forward current from the bidirectional inverter flows along the string, via a DC/DC converter that outputs the 5 volts needed by the electronics. Since during the I-V tracing, the current sweep forces the module to different operating points, including the zero voltage, a power supply holding circuit has been implemented in order to keep the supply voltage at the input of the DC/DC converter high enough during the time that the I-V tracing is performed. This circuit is composed by the capacitor (C) and the diode (D) in such a way that capacitor (C) is charged up to the module voltage when the circuit is idle.