*3.1. Data-Acquisition System*

Image-based cloud tracking has become very popular for high-frequency photovoltaic modeling and short-term forecasting [13,37,45,54,66,67]. Cameras have massive variations of price depending on purpose, sensitivity, sturdiness, resolution and other various characteristics. The three main constraints for the camera used in this work were 180-degrees field of view to acquire total-sky images, enough resolution to provide all the information required for modeling the sky and the ability to be controlled by a low-cost embedded system. The system uses an ELP-USBFHD01M-L180 camera, which has a CMOS OV2710 sensor able to provide images with 1920 pixels by 1080 pixels resolution and is controlled directly via USB cable.

A 20 cm by 15 cm, 6 W solar panel was added to the data-acquisition system to provide a solar quantity to develop the image-based model. Power calculations were derived from voltage and current measurements provided by an Adafruit INA219 DC sensor. Another source of data was the panel temperature, provided by a Maxim Integrated DS18B20 temperature sensor attached to the back of the panel. Tying the system together, a Raspberry Pi 3B+ controls the camera and both sensors, synchronizing the data acquisition. Single board computers are ideal for this application due to their price, high tolerance to temperature variations and enough computing power for data acquisition in this scale.

In total, this equipment costs under US\$ 100.00, if compared with more traditional sky imagers, such as the Yankee TSI 880, which costs thousands of US dollars, or even some of the lower-cost equipment developed by some research institutions, using IP cameras that can reach hundreds of US dollars [25]. A sky imager expected to be used as part of control strategies for PV plant operation must be low in cost to be commercially attractive for investors.

A 3-dimensional rendering of the equipment is shown in Figure 2.

**Figure 2.** Three-dimensional model of the data-acquisition system.

The image acquisition software was developed using Python 3 with OpenCV 4 in conjunction the "pi\_ina219" [68] and "w1thermsensor" [69] libraries for accessing the power and temperature sensors with Python.

To be able to generate power, the PV panel must be in a closed circuit with a load component. The initial goal was to use a ceramic resistor; however, during the testing process, when higher currents were applied to the resistor, it started to overheat, so a dichroic light bulb was used instead.

The thermometer was placed under the PV panel enclosed by the fins from an aluminum heat exchanger pad with the flat part attached to the bottom of the panel. It was then covered by thick dense foam to act as a heat insulator between the thermometer and the environment. Both thermometer and heat exchange pad were assumed to possess higher heat-transfer coefficients than the panel and both have significantly less mass, meaning that they have lower thermal inertia. This causes the thermometer to quickly follow changes in panel temperature, which is a key variable in PV conversion efficiency [70].

As for the INA 219 sensor, it measures both circuit voltage and determines current by measuring voltage across a 0.1 Ω shunt resistor. It is capable of measuring voltages up to 26 V and currents up to 3.2 A at a maximum ADC resolution of 12 bit. Both sensors have well developed Python libraries for use with the Raspberry Pi, which will be presented in the next section, along with all the software components used by the DAS.

Both sensors are supplied by 3.3 V DC provided by the Raspberry Pi's 3V3 pin. The INA 219 communicates, via I2C protocol, with the Pi through the SDA and SCL pins, located on the GPIO2 and GPIO3 pins respectively. Voltage and current are measured between the V+ connector and ground. The current enters the INA 219 through the V+ connector, passes through the internal measurement circuit and exits through the V- connector, then through the dichroic light bulb.

The DS18B20 uses the 1-Wire communication protocol through GPIO4 pin. It requires a pull-up resistor of 10 kΩ to stabilize the signal when not communicating with the Pi. Figure 3 presents the measurement circuit schematics for temperature, voltage and current measurements. The green lines indicate connected terminals, and the camera was not included in this schematic because it uses a simple USB connection.

**Figure 3.** Measurement circuit schematic.
