Home > Other >Special Application Circuits > DIY Solar Detector

DIY Solar Detector

Source: InternetPublisher:拳制龙 Keywords: solar detector Arduino LDR Updated: 2024/08/06

This project provides an open hardware/software testbed for solar trackers.

The proposed prototype is based on a dual-axis solar tracker controlled by Arduino Uno, an open-source prototyping platform based on easy-to-use hardware and software.

The solar tracker can be controlled automatically with the help of LightDependentResistor (LDR) sensors or manually using potentiometers. In addition, the test bench provides Excel-based virtual instruments that can log and present solar tracker data. The hardware used is selected to be cheap, compact and versatile. The proposed test bench is intended to help students deepen their understanding of control theory and its applications.

The proposed test bench is shown in Figure 1. It is based on a solar tracker that can rotate automatically to track the sun with the help of four LDR sensors and two servo motors (SM1 and SM2), or manually using a potentiometer.

To switch between the two modes (automatic and manual), a push button is used. Another button is used to connect SM1 (up and down servo motors) or SM2 (left and right servo motors) to potentiometers to control their movements. In addition, the modes and current, voltage, and power of the photovoltaic panel are visualized in MS Excel against time using a computer as a virtual instrument. An Arduino Uno board is used to implement all the software requirements of the system.

Mechanical Design

As shown in Figure 2, the computer-aided design (CAD) 3D model of the solar tracker was designed in CATIA. It consists of a photovoltaic panel, left and right up and down servo motors, and four LDR sensors. For the horizontal axis, the bearings are fixed in parallel with the up and down servo motors for better flexibility. The solar tracker is designed with two degrees of freedom, from east to west by the left and right servo motors and from south to north by the up and down servo motors. The LDR sensors are placed on the four corners of the photovoltaic panel and in dark tubes with small holes on the top to detect the sun's illumination. These dark tubes are also considered radiation concentrators and are used to improve the robustness of the solar tracker.

Hardware System

Figure 3 shows the electronic circuit of the proposed testbed. For the automatic mode, the microcontroller converts the analog values ​​of the LDR sensor (pins A0 to A3) into digital. Then, it controls two servo motors (up and down and left and right) using two pulse width modulation (PWM) signals (pins 5 and 6) to track the sun. The rotational movement occurs on two axes, from east to west according to the azimuth of the daily sun path and from south to north altitude according to the seasonal sun path. For the manual mode, a potentiometer (pin A4) is used to control the movement of the two servo motors and a button (pin 11) is used to connect the potentiometer to the up and down servo motor or the left and right servo motor. In addition, another button (pin 12) is used to switch between the two modes. In addition, the PV voltage is measured through the analog pin A5 of the Arduino and then the PV current is calculated because the resistance of the load is known. Next, the relationship between the PV current, voltage, and power and time and the actual pattern are sent to the computer to be presented in real time on MSExcel.

The LDR sensor circuit is designed as a voltage divider circuit. The change in light intensity is proportional to the change in the voltage at the output of the voltage divider. The top of the voltage divider is 5V and the ground is 0V. The output of the voltage divider is connected to the analog input of the microcontroller (for example, A0). Subsequently, the analog value read by A0 is converted into a digital value between 0 and 1023 by the analog-to-digital converter (ADC) of the microcontroller. Since ADC is coded in 10 bits, the light level can be known based on this value. The resistor value used in the voltage divider is 330Ω.

Two 180 degree servo motors are used. One servo motor (MG996R) controls the solar tracker according to the vertical axis, i.e. the left and right servo motor. And one micro servo motor (SG90) controls the solar tracker according to the horizontal axis, i.e. the up and down servo motor. The advantage of the servo motor is that we can control its stop, run, rotation direction and speed using a single low current wire directly connected to the output of the microcontroller without any driver. The servo motor used is controlled by the Arduino UNO board through a 3-wire cable as shown in Figure 3, two wires are used for power supply and one wire is used for PWM control of its position.

Embedded Software Design

The embedded software is the part that will be embedded in the hardware (Arduino Uno) to control and monitor the solar tracker test bench. The embedded software is designed to meet the following requirements:

1. The test bench has two modes: manual and automatic. A button is connected to pin 12 to switch between the two modes.

2. In manual mode, the potentiometer can control the servo motor, the left and right motors are controlled from east to west, and the up and down motors are controlled from south to north. A button is connected to pin 11 to switch the potentiometer between the two motors, which controls the left and right servo motors or the up and down servo motors.

3. If the automatic mode is active, the algorithm shown in Figure 4 is executed. The latter uses the analog values ​​returned by the LDR sensors. For example, considering the azimuth or vertical axis, the average values ​​of the two right LDRs and the two left LDRs are compared, and if the left LDR receives more light, the solar tracker will move in that direction via the left and right servomotors. The latter will continue to rotate until the difference result is in the range [-10, 10]. This range is used to stabilize the controller, and once the solar tracker is perpendicular to the sun, no further control is performed. On the other hand, if the right LDR receives more light, the solar tracker moves in that direction via the left and right servomotors and will continue to rotate until the difference result is in the range [-10, 10]. The same way is used for the elevation axis. In addition, we determine the average irradiance between the four LDR sensors and if this value is less than a small value (8: a value that has been actually adjusted and tested, and is returned when the irradiance is zero). That is, night has fallen. In this case, the solar tracker must return to the position where the sun rises. For example, if the left and right servomotors are set to 0 degrees and the up and down servomotors are set to 30 degrees, the sun rise position can be reached. This can be provided by the ArduinoIDE through the C function "servox.write(angle)". A value that has been actually adjusted and tested is returned when irradiance is NULL). That is, night has fallen. In this case, the solar tracker must return to the position where the sun rises. For example, if the left and right servo motors are set to 0 degrees and the up and down servo motors are set to 30 degrees, the sun rises. This can be provided by the ArduinoIDE through the C function "servox.write(angle)". A value that has been actually adjusted and tested is returned when irradiance is NULL). That is, night has fallen. In this case, the solar tracker must return to the position where the sun rises. For example, if the left and right servo motors are set to 0 degrees and the up and down servo motors are set to 30 degrees, the sun rises. This can be provided by the ArduinoIDE through the C function "servox.write(angle)".

4.The PV voltage acquired through analog pin A5 has to be processed and used to calculate the PV current and power. Then all these data and the actual pattern have to be sent to the computer through the USB cable and then presented in MSExcel.

The PLX-DAQExcel macro is used for data acquisition from the Arduino microcontroller to an Excel spreadsheet. We just have to download it. After installation, a folder called "PLX-DAQ" is automatically created on the PC, in which there is a shortcut called "PLX-DAQSpreadsheet". Then, to establish communication between the development board and Excel, we just have to open the spreadsheet and define the connection settings (baud rate and port) in the PLX-DAQ window (Figure 5). After this, after clicking "Connect", the output data will be collected and displayed in real time on the Excel spreadsheet

prototype

Figure 6 shows the solar tracker in both separated and assembled states. As mentioned earlier, the entire structure is fabricated using wooden planks and it is obvious that all the mentioned components have been used to build a solar tracker with both manual and automatic modes (LDR sensor, Arduino Uno, servo motor, potentiometer, push button and small photovoltaic panel).

Fig. 7 shows the whole test bench, the solar tracker with virtual instruments, and the artificial light to expose the light to test the solar tracker. The solar tracker and the computer are connected via a USB data cable. Once the PV voltage is obtained, the controller processes this information and uses it to calculate the PV current and power. Then, all these data are sent to the computer to be presented in MSExcel. From Figs. 5 and 6, it can be seen that the proposed test bench is small, flexible, and easy to use. It allows students, researchers, and engineers to apply their algorithms in a simple way before implementing a large-scale solar tracking device.

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号