Arduino Solar Tracker
Solar energy is one of the fastest growing industries in the world; today more than 65 GW energy is produced by solar power. Since solar energy is renewable, it is a good power source, especially for developing countries.
In this project, I am going to show you how to make a solar tracker using Arduino Nano. The solar panel tracker is designed to follow the sun movement so that maximum light intensity hits on the solar panel, thus increasing the power efficiency. Use of a solar tracker circuit in the field of energy production will increase its efficiency by almost 25%. This system can also be successfully implemented in other solar energy based projects water heaters and steam turbines.
There are basically two types of Arduino sun trackers. One of them is the single axis solar tracker and the other is dual axis. Single axis solar tracking system moves the solar panel from east to west in a day to point in the direction of the sun. Dual axis solar trackers uses the motor to move the solar panel in all four directions (North-South & East-West).
South to north is not a viable or big movement, because this movement covers only 20 degreesÂ in half year and in remaining half year it moves from north to south and we can set this, manually in a week. Since the East-West tracking is more important, I will be explaining more of the single axis solar tracking.
Arduino Solar Tracker – Working
In this project an Arduino Nano is used, which works as a controlling unit. Two LDRâ€™s (Light Dependent Resistor) are also connected to analog pins of the Arduino. A dummy solar plate is attached in parallel to the axis of servo motor and both the sensors are kept on the dummy solar plate as shown in the figure below.
The arrangement is made in such a way that the movement of sun is from sensor 1 to sensor 2, as shown in the mage below.
There are three conditions to be followed:-
Sun is in left side – Light on sensor1 is high because shadow of barrierÂ falls on sensor 2 so solar plate moves clockwise.
Sun is in right Side – Light on sensor2 is high because shadow of barrier falls on sensor1 so solar plate movie anticlockwise.
Sun is in the middle – Light on both sensors are equal so, plate will not rotate in any direction.
Output is shown in the demo video below. You can see that the plate moves in the direction of light, but some fluctuation is visible in video because light is coming from multiple sources. Fluctuation is automatically removed when system is placed in direct sunlight.
|USB Cable||For Programming||1|
|Power Source||9 or 12 Volt||1|
|PCB||Copper Clad/Zero PCB|
A PCB (Printed circuit board) is designed for this Solar Tracker Arduino. Using a breadboard or Zero PCB are also other simpler options to create this solar tracker circuit. For PCB printing refer the PCB design shown below.
The circuit diagram shown below. This is useful for ZERO PCB or breadboard circuit.
In the circuit two LDR (Light Dependent Resistors) sensors are used to sense the light. Since LDR is an analogue sensor they are connected to the analog pins A0 and A1 of Arduino. The sensors are connected in series with 10 k ohm resistors.
A servomotor is also connected to the digital pin D10. D10 is a PWM (pulse width modulation) pin. A momentary switch is also connected to digital pin D2, mainly for calibration purposes. When the switch is pressed D2 pin will act as the ground (GND). A 12-volt adapter or 9 volt battery, can be used to power this whole circuit. RAW pin in Arduino Nano is the power pin.
We are using EEPROM and Servo Motor so two header files “EEPROM.h” and “Servo.h” are used in the starting of code. Next a servo motor is defined by the name “myservo”. Two integers are defined by names sensor1 and sensor2.Â Calibration switch is connected to D2 pin so another integer is defined by â€œcalswitchâ€. Other integers are defined by names val1, val2, pos, & error. All these states are used for internal processes.
In the void setup sensor1, sensor2 and calswitch are defined as input. Now servo is activated by â€œmyservo.attach(10)â€ function.
In the void loop section first of all an â€œifâ€ condition is used for calibration. When momentary switch is pressed this â€œifâ€ condition becomes true. In this condition servo the motor is deactivated by function “myservo.detach(10)”. Next values of sensors are assigned in integer “val1” and “val2”. According to the value of val1, val2 & error, thestate is saved in EEPROM using function â€œEEPROM.write()â€, and a delay of 1 second is used at the end of this loop. Now calibration process is done.
In else loop â€œmyservo.attachâ€ is used to activate the servo, val1 and val2 are read by using â€œanalogReadâ€ function, after that state and error is read from EEPROM using â€œEEPROM.readâ€ function after that error is removed from val1 or val2.
Three conditions are described in working of project, these conditions are executed in the code using “if else” conditions, in this way servo rotates clockwise or anticlockwise according to sunlight.
The rotational movement of the solar panel should not should be confined between o and 90 degrees. When “pos” becomes more then 90 degree an if condition is used for making this 90 degree and same concept is used when it becomes less than 0 degree.
This project is featured by self-calibration so it does not need any preset or variable resistor for calibration; you just need to press a momentary switch. For calibration, press and holdÂ the switch, which is connected to pin D2 and rotate the solar plate in direction of sun and release after 2- 3 seconds. By using this simple process, Arduino reads the value of sensors and saves the error state in EEPROM. This system needs one time calibration.