Raw readings of the a/D converters with range from 0 to 4095.
Methods to detect the position of the sun and orientate a solar panel to its position are used in order to optimize the power generated. Two possible approaches are using light depending resistor (LDR) sensors, or using a GPS and equations that model the geometry between the Earth and the Sun. The main objective of this work is the proposal of a prototype system to optimize the harvesting of solar energy on photovoltaic panels. In this chapter, a mobile robot powered by a solar panel orientated by a LDR matrix and a GPS device was developed. The LDRs were used as the representation of vectors normal to a surface, where its sum resulted in the most lighted point. The GPS, in turn, provided location, date and time data, which were used in the calculations of the Sun?s azimuth and zenith, used to orientate the panel. The obtained results show that an orientated photovoltaic panel has a better performance when compared to a static panel. Possibilities and opportunities of research tend to grow for the next years with many possible works to be done in the future, both in mobile robotics and in other systems powered by photovoltaic panels.
The use of photovoltaic energy is one of the most promising alternative energy resources. Given the high fossil fuel consumption and economic and environmental impact of other sources, solar energy has become one of the most viable alternatives, given its low impact and the fact that it is renewable.
The sun provides both thermal and light energies, and in order to convert its light energy to electrical energy, photovoltaic cells are used. The cells of the panel used in this work are made of silicon. According to , the efficiency of large-area commercial cells is about 24%, and the upper limit of the silicon solar cell efficiency is 29%. In order to optimize the energy generated by a photovoltaic panel, instead of using it in a fixed position, methods of tracking the position of the sun and adjusting the panel accordingly are used, so the sun’s rays are perpendicular to the photosensitive surface .
The works of [3, 4] show systems that use light-dependent resistor (LDR) as a way to obtain the sun’s position . On the other hand, the work of  shows an approach that allows the control of a photovoltaic cell based on its temperature, and the work of  shows a different design to the motors that control the position of photovoltaic panels, in order to decrease the energy used by the drivers .
In this chapter a method that uses both GPS and a LDR matrix is described, with the solar panel attached to a mobile robot, using ARM microcontroller device (STM32F407). Also there is a comparison of both approaches, in order to find the most efficient position for the panel and the possible applications both in the field of mobile robots and in others.
2. Solar tracking approaches
Similar to the work of , in this paper a solar panel powers a mobile robot, but the main difference is that the panel on the robot of  has two motors to move it in the x-axis and y-axis . The robot used in this work has a panel that moves in the φ-axis (spherical coordinates), and the adjustment of the panel position consists in operating this φ-axis motor and adjusting the position of the robot [11, 12].
2.1 LDR approach
The LDR matrix consists of a Styrofoam half-sphere with 20 LDRs attached on its surface, each one representing a coordinate of the three-dimensional space. Figure 1 shows a 3D model representing the LDR positions.
The LDRs have a voltage divider, and the microcontroller’s A/D converter reads its value. As light reaches the LDR, its resistance decreases. The design of the voltage divider was done in a way that its output voltage increases, so the more light reaches on the LDR, the higher the readings will be on the A/D converter.
However, the LDRs are sensitive not just to sunlight but also the environment’s reflected lights, and the A/D converter reads these lights with a small difference between them. In order to find which reading corresponds to the direct sunlight, a series of mathematical operations are performed, in a way that increases this difference.
When representing the LDRs in spherical coordinates , we may change to the A/D converter read value. So, we can write the coordinates as , where is the LDR A/D reading on the corresponding and coordinates. Since the microcontroller A/D converter has a 12 bit resolution, its value range is seen on Eq. (1):
In order to find the most relevant readings, all of them are divided by the average and then squared. In this way, it is possible to obtain the most significant readings. These readings are represented by , as seen on Eq. (2), where represents the average of the readings of all LDRs:
The next step to obtain the position of the sun via the LDRs is to convert the spherical coordinates to the Cartesian coordinate system and then sum all elements. As a result, we obtain the coordinates of the position on the Styrofoam surface that represents a vector pointing towards the sunlight. The spherical coordinates to Cartesian equations can be seen on Eqs. (3)–(5):
Having the and coordinates, it is possible to adjust the position of the panel in such way it is perpendicular do the direct sunlight, using to adjust the position of the robot and to adjust the servomotor.
2.2 GPS approach
The use of the GPS device to obtain the position of the sun is based on a set of equations that return the coordinates of the sun in the horizontal coordinate system. These coordinates are the zenith angle, the altitude angle, and the azimuth angle, and all of them are seen in Figure 2.
where θz: incidence angle (or zenith angle); δ: declination angle; α: altitude angle; φ: local latitude; ω: hour angle; A: Azimuth angle.
The declination angle δ is the angle between the equator and a line connecting the earth and the sun, and it varies according to the current date. The hour angle ω is the angle that depends on the current time, representing the position of the sun above the observer.
The GPS device used is shown in Figure 3, and it provides the current time and location and, with these data, is possible to calculate the solar angles and correct the panel position accordingly.
It sends data on an interval of 1 second. The data received is a string that uses National Marine Electronics Association (NMEA) specification. The string contains coded phrases, and each phrase contains a specific set of information. Among the phrases, there is information containing the current location, time, and date. Figure 4 shows an example of all phrases received.
The first phrase, being the one with the code $GPRMC, contains all the information required to obtain the current position of the sun. Commas separate each part of the data. After the code, the first number is 134759.00, which represents the time 13h47min59s. The second number is 2319.68361 followed by the letter S, which represents south latitude 23°1,968,361′. After that is the number representing the longitude followed by the letter W, which stands for west, so the longitude is 51°1215109’West. The next piece of information, which is 0.019, is the current speed over the surface in knots, followed by the number 170518, which stands for the date, in this case meaning May 17th of 2018.
A set of PWM signals drive the motors of the robot, and its speed is proportional to the duty cycle used. The duty cycle in turn is proportional to the difference between the direction of the robot and the direction of the sun. A picture of the robot is seen in Figure 5.
This difference is obtained calculating the Euclidian distance between the obtained position of the sun and the direction of either the front or the back of the robot (whichever is the nearest one) and minimizing it. As this difference is calculated using unit vectors, its range, as seen on Eq. (12), is never higher than 2:
So is the maximum possible distance between the position of the robot and the position of the sun; therefore, implies a maximum use of the motors to correct the position of the robot, and means the robot is at the desired position.
However, as a control method, is not used as a parameter to determine if the desired position is achieved, for it is an ideal situation. Instead, a value close to is used. So, for example, a possible condition to consider that the robot is in the correct position is to consider .
Sections 3.1 and 3.2 have a detailed description of each approach used to detect the direction of the sun, and Figure 6 contains a block diagram of the system.
3.1 LDR implementation
A half-sphere of Styrofoam was used to arrange the LDRs symmetrically, and the position of each LDR was chosen based on the manufacturing marks on its surface, having a total of 20 positions. All LDRs had a common terminal connected to a voltage source, and the other ends were connected to a multiplexer circuit. This multiplexer circuit is connected to the microcontroller, which selects the LDR and also reads its analogic value.
After the microcontroller calculates the position of the sun, it sends a signal to the motors of the mobile robot, to adjust its position in a way that its front or its back faces the sun and to the servomotor to adjust it to the proper inclination. The decision of if it is either the front or the back of the robot that should face the sun is based on which of these sides are closer to sunlight, in order to minimize the motion of the robot.
The signal sent to the motors of the robot, as said in the beginning of Section 3, is a PWM signal, proportional to the Euclidian distance in the x-y plane of the position of the sun and the front, or back, of the robot, which is seen in Eq. (13):
The value of is either 1, if the sun is closer to the front of the robot, or − 1, if the sun is closer to the back of the robot. As gets closer to 0, it means the robot is getting closer to the direction of the sun.
3.2 GPS implementation
An electronic GPS device was used to obtain the required data to calculate the position of the sun, these data being latitude, longitude, day, month, year, hour, and minute. In addition, an electronic compass was used to obtain the angle the front of the robot formed with the north direction.
In order to keep the same reference as the LDR approach, the compass returns 90° when the front of the robot faces north and −90° when its back faces north. The value of the zenith angle is used as a signal in the servomotor to adjust the inclination of the solar panel. To make the robot face the sun, the Euclidian distance between its front or its back, depending on which one is closer, and the azimuth of the sun must be minimized. Eq. (14) returns this distance, where θn is the angle of the north direction and the robot:
As in Section 3.1, the value of is either 1, if the sun is closer to the front of the robot, or − 1, if the sun is closer to the back of the robot. As gets closer to 0, it means the direction of the robot is getting closer to the direction of the sun.
4.1 LDR results
The preliminary tests on the LDR matrix were done in a darkroom with a flashlight. Figure 7 shows a picture of the position that was tested.
Then, with each LDR connected to the A/D converter, the data were collected and processed in order to obtain the light position on the surface. In Table 1, written in the color red are the values read by the A/D converter, with the range mentioned on Eq. (1), for each LDR on its respective position in Figure 7, and NA (not applicable) represents the positions where there are no LDRs.
|LDR spherical coordinates|
The sum of these values as vectors equals the resulting position (), which is seen as the blue arrow in Figure 8. The spherical coordinates obtained are (24.952508o, 38.555257o, 97.442222o). However, in Figure 8, the ρ coordinate was reduced in order to fit in the figure.
Table 2 shows a set of 10 samples of Figure 7 on a 1 second interval, in which n = 1 is the sample plotted in Figure 8. The table also includes the mean value of the samples and the standard deviation.
|Sample time (seconds)||φ coordinate [o]||θ coordinate [o]|
|Mean φ [o]||38.524916|
|Std. deviation of φ [o]||0.068990|
|Mean θ [o]||−97.781321|
|Std. deviation of θ [o]||0.855672|
4.2 GPS results
The GPS was tested under the following conditions:
Local: Londrina State University
Sample time: 1 s
The GPS device received its fix data in the default interval of 1 second, and for each sample, an altitude angle and an azimuth angle were calculated. Table 3 shows the solar angle data and its mean values and standard deviations.
|Sample time (seconds)||Altitude α [o]||Azimuth A [o]|
|Mean α [o]||42.096819|
|std. deviation of α [o]||0.003493|
|Mean A [o]||−28.697007|
|std. deviation of A [o]||0.019659|
4.3 Power results
Three test scenarios were executed. One is where the solar panel is fixed and the other two where the sun is tracked, one using LDR and the other using the GPS. The sampling period was 5 minutes.
In Figure 9 it is possible to observe the power generated by the panel on each scenario. The LDR and the GPS approaches have shown a very similar performance compared to each other, and both of them demonstrated to be much better than a fixed panel, having a gain of approximately 30%. The yellow line in the figure represents what would be the ideal maximum generated power by the panel, considering the average solar irradiation nearby the site and the surface area of the panel. The LDR approach as the GPS has shown an efficiency of 80% compared to the ideal maximum power.
During the data collection, the LDR matrix has showed to be very sensitive to noise, so it presented a higher deviation. On the other hand, the GPS data had a much lower deviation. However, during the data collection, it took a certain amount of time to get a fix and obtain the current date, time, and location.
Besides the solar panel orientation, i.e., for applications in the mobile robotics, the GPS device provides navigation data that may be useful, which is an advantage. However, if the device takes too long to get a fix or loses the fix, the data will be null or delayed. So, in order for a mobile robot to obtain full-time orientation, both the GPS and LDR approaches may be used together.
For other applications, such as a panel on a fixed position, the latitude and longitude are fixed, so there is no need for a GPS device, just a real-time clock (RTC) device, which eliminates the GPS fix time issue and also has a lower cost compared to the LDR approach.
Having all things considered, the LDR is a low-cost method to track the position of the sun; however, it is more affected by noise. The sun-earth equations have shown problems only when depending of a GPS device to provide data; otherwise, it is the most precise approach.