Designing the solar collector position with the Arduino electronic platform

The article deals with the utilizing of solar energy by the means of concentric trough collector based on own design. It focuses on achieving optimal position of the trough with respect to incident radiation during its operation. Due to the collector virtual sun tracking system, which was proved to be ineffective and could not achieve the desired results, the optimum position had to be maintained by manual control of rotation. The measurement of the angle of rotation of the concentric trough is realized using the ARDUINO electronic platform, for which the program was created in the software ARDUINO (IDE) 1.8.4.


Introduction
The thesis deals with the use of a concentric trough collector located on the building of University of Žilina. The design of the collector was made according to its own design. Due to its later modification and future application it is necessary to test the collector and determine its performance parameters. The collector has an automatic virtual tracking system, which uses mathematical algorithm to determine the position of the sun and subsequent rotation of the collector. Early measurement has shown some performance deviations due to incorrect trough position. Further tests have shown that the actual tracking system is unable to maintain an optimal position throughout the day. For the purposes of the following measurements, functional monitoring should be ensured. Tilt of the trough can be set manually using the control panel located in the laboratory. The optimal values of tilt angle for time interval of specific day was determined according to calculation of solar angles. However, for the manual operation of the collector and the angle of rotation, it is necessary to provide a response that can be recorded in the form of data. This task is accomplished by the Arduino Mega 2560 Rev3 electronic programmable platform with an additional module MPU-6050 filling function of accelerometer and gyroscope. The program for calculating the angle of rotation and recording the measured values into Excel was created in the freely available ARDUINO (IDE) software 1.8.4. The device itself and the attached modules are powered via the USB A/B connecting data cable. Thus, the device can be programmed and simultaneously powered by one cable. Once the device is connected to an external power source, we can also use it in difficult-to-access areas such as the roof of a building and its operation is limited by the capacity of the battery.
However, in our case, for measurement purposes, it is not enough to simply put the measured data on the microSD card but also to get a real-time response. For this reason, the created program displays the measured values in the specified time interval via the serial monitor. For real-time data transmission, you must ensure that the device is connected continuously to a computer using a data cable. The USB data cable can fully transfer the data to a distance of approximately 10 m, but this is not enough in our case. For data transmission over longer distances the signal has to be amplified by repeater. A better solution is to use an easy-to-get network cable with RJ-45 and a USB/LAN extension to a distance of 30 m. A short measurement of the collector power parameters was performed to verify the device's functionality under realistic conditions. Measured data using the MPU-6050 chip was compared with data obtained from the control panel.

Solar tracking systems
The tracking mechanism must be reliable and capable of monitoring the sun with a certain degree of accuracy, even during alternating cloud, which depends on the collector acceptance angle. Another important task that the mechanism provides is to return the collector to its original position at the end of the day or at night. Some systems, in addition to tracking, also perform a protective function and turn the collector out of focus to protect it from hazardous environmental and working conditions such as severe wind shocks, overheating, and failure of the heat flow mechanism. There are different forms of tracking mechanisms from complex to very simple. They can be divided into two broad categories: mechanical and electronic systems. Electronic systems generally have greater reliability and tracking accuracy. These can be further subdivided into mechanisms using electronically controlled motors through sensors that measure the size of solar illumination and mechanisms using computer controlled engines with feedback provided by solar-flow sensors on the receiver [1, 2, 3]. Another form of tracking system is called "virtual" tracking, where a traditional sun monitoring unit with sensors that detect the position of the sun has been replaced by a system based on calculating the position of the sun using a mathematical algorithm. The unit is implemented with a 13-bit optical angle encoder mechanically coupled to the collector rotation axis. By comparing the position of the sun and the collector axis with the electronic devices, a signal will be sent to the propulsion system to move to the optimal position [4].

Design of measurement device
Arduino is a freely available electronic platform based on easy-to-use hardware and software. Arduino boards can read input values using additional modules. The input can be light on the sensor, finger on the button, Twitter message or other. Any input parameter can be changed to output, e.g. engine activation, LED on, online publishing. The function and usage depend on the set of instructions that are sent to the microcontroller on the board. The Arduino programming language, based on the Wiring programming framework, allows you to write multi-layer software to control devices connected to a wide range of microprocessor boards to create all kinds of creative codes, interactive objects and environments. The Arduino platform is used by a wide community of students, musicians, artists and professionals. It has been used for thousands of projects ranging from everyday objects to complex scientific instruments.
There are several Arduino platforms and a number of sensor types. For our project, the Arduino Mega 2560 Rev3 microcontroller model, the MPU-6050 with accelerometer and gyro function, and the Arduino SD card module were used. The design of the program was based on a manual for the Arduino programming language and tutorials, which are freely available on the Internet. Program created in ARDUINO (IDE) software 1.8.4 can be theoretically divided into four functional units.
For proper communication of the microcontroller with peripheral devices, it is necessary to address the corresponding pins via bus. This step can be done manually by using physical addresses or automatically by placing the appropriate library in the program.
In the first part of the program we will include the necessary libraries, whose commands we will use. Define the bit length and variable type with the appropriate name. Next, we create a file object to record data to the SD card and define the pin chipset for the SD card module.
In the second part we start one of the main parts of the program, which contains commands executed only once, always when the program is turned on. Commands include initiating communication with the COM serial port and defining the pin of the chipset as the output. Next, initialization of the SD card with the corresponding response in the form of a message on the serial monitor follows. The following is the creation of a text file named Data.txt, in which the beginning of the new measurement is written, and it is simultaneously printed on the serial monitor. If a file is not created, the process failure information is listed. In the last step, we begin communication with the gyro module and read the values recorded by the gyroscope thousands of times every 3 microseconds into the created variables. We divide the recorded values by thousands to get the average value. The last set of commands is important for the next program run, such as the start of integrated time logging, resetting the calculation loop, and the write loop. Since, in our case, no real-time module is used to fill the required I2C pin with the gyro module, time will be measured using an integrated timer that will count down seconds after the measurement starts. Since the number of calculations per time unit is different from the number of entries, different timers have to be loaded.
The third part contains a calculation loop that reads the gyro value and subtracts it from the previous value, calculating the difference. This value is converted to the climb angle.

Results comparison
The created program was loaded on the measuring device placed on the counterweight frame of the collector. This part is a solid plane intersecting the axis of the concentric trough and is the ideal place for mounting the measuring device. Since the solar collector is located in an outdoor environment where it is exposed to environmental influences such as rain, snow, wind, sun, or birds, it is essential to protect the surface connections of the measuring device. For proper fitting, protection, and ease of access when replacing chips or removing a microSD card, the device was stored in a modified plastic container with a removable cap ( Figure 4). Device communication and initialization is controlled via a combination of USB/LAN cables, as mentioned earlier, through the shaft to the laboratory premises. In order to verify the correct operation of the device, the tilt angle indicated by control panel display and the angle obtained from the designed device located on the collector was compared ( Figure 5). The graph was designed for reference angles from -90° to 90° in 10° increments. Based on the geographic position and the location of the collector, it was found that the 180° range is sufficient to provide optimal position throughout the day. Angle -90° is the standby position (trough facing downwards) and the 90° is a fully open collector with the focus in the vertical axis. On the chart we can see that the values measured by Arduino in the range of -90° to 0° are higher than the values obtained from the control panel and vice versa in the range of 0° to 90°. The measurement results show relatively small deviations in the area around the horizontal position of the gyroscope, maximum of 2.53° at a 30° inclination. Deviation values gradually increase with increasing tilt angle to the vertical position. The highest deviation of 11.62° was measured in a vertical position of 90°. The measurement shows that the deviances range from 0.15° to 11.62°.