Arduino Based Solar Tracking System
Arduino Based Solar Tracking System
CHAPTER:1
1.1 Introduction
Energy is a prime factor for the development of a nation.An enormous amount of energy is
extracted,distributed,converted and consumed in the global society daily.85% of the
energyproduction is dependent on fossil fules.The resources of the fossil fules are limited and
their use results in global warming due to emission f green house gases.To provide a sustainable
power production and safe world to the future generation,there is a growing demand for energy
from renewable sources like solar,wind,geothermal and ocean tidal wave.
Solar Panels directly convert solar radiation into electrical energy.Solar Panel is
mainly made from semiconductor materials.Si used as the main components of solar
panels,which is maximum of 24.5% efficient. Increasing the cell efficiency,maximizing the
power output and employing a trcking system with solar panel are three ways to increase the
overall efficiency of solar panel.Improvement of solar cell efficiency is the ongoing research
work and people throughout the world are actively doing research on this.Maximising the output
power from solar panneland integrating solar tracking syatem are two ways where electronic
methodology can bring success.Solar tracking is a mechanized syatem to track the sun’s position
that increases power output of the solar panel 30% to 60% than the stationary syatem .This is far
more cost effective solution than purchasing additional solar panels.
DEPARTMENT-EEE Page 1
ARDUINO BASED SOLAR TRACKING SYSTEM
Temperature
Automatic temperature control system is an important application used in almost all modern
gadgets and smart homes. The system for controlling temperature automatically is achieved by
using Arduino Uno-based microcontroller system. Arduino Uno due to its increased popularity
finds its varied range of applications. Temperature sensor LM35 and Arduino Uno are the
hardware used interfaced with computer, and the temperature is controlled in the room.
Temperature is displayed on LCD display employing A1 pin of hardware with the help of analog
pin utilizing pulse width modulation (PWM). We have designed temperature control as an
automatic system that has been not attempted before the way it has been implemented.
DEPARTMENT-EEE Page 2
ARDUINO BASED SOLAR TRACKING SYSTEM
Concept of using two LDRs for sensing is explained in the figure above. The stable position is
when the two LDRs having the same light intensity.When the light source moves, i.e. the sun
DEPARTMENT-EEE Page 3
ARDUINO BASED SOLAR TRACKING SYSTEM
moves from west to east, the level of intensity falling on both the LDRs changes and this change
is calibrated into voltage using voltage dividers. The changes in voltage are compared using
built-in comparator of microcontroller and motor is used to rotate the solar panel in a way so as
to track the light source
DEPARTMENT-EEE Page 4
ARDUINO BASED SOLAR TRACKING SYSTEM
CHAPTER-II
Solar Pannels with panels can turn around the central axis.The panels can turn
around the axis.LINAK can provide the actuators that tilt the panels.
Dual axis tracking is typically used to orient a minor and redirect sunlight along
a fixed axis towards a stationary receiver.But the system can also gain additional yield on your
PV cells.LINAK can provide you with quality actuators That move these panels on dual axis.
DEPARTMENT-EEE Page 5
ARDUINO BASED SOLAR TRACKING SYSTEM
DEPARTMENT-EEE Page 6
ARDUINO BASED SOLAR TRACKING SYSTEM
Dependent Resistors (LDR) as a light sensor has been used.The two light sensors are
separated by divider which will create shadow on one side of the light sensor if the solar panel is
not perpendicular to the sun.For the controlling circuit, microcontroller(ATMega328) act as a
brain that controls the movement of the servomotor.Data received from the sensors and
processed by the microcontroller.The microcontroller will send a data to the servomotor to
ensure soalr panel is perpendicular towards the sun.Microcontroller controls the rotation of the
motor either to rotate clockwise and anticlockwise.The solar panel that aatached to the motor
will be reacted according to the direction of the motor.
DEPARTMENT-EEE Page 7
ARDUINO BASED SOLAR TRACKING SYSTEM
CHAPTER-III
DEPARTMENT-EEE Page 8
ARDUINO BASED SOLAR TRACKING SYSTEM
DEPARTMENT-EEE Page 9
ARDUINO BASED SOLAR TRACKING SYSTEM
DEPARTMENT-EEE Page 10
ARDUINO BASED SOLAR TRACKING SYSTEM
3.2.2Microcontroller(Atmega328):-
Microcontroller is a single chip micro computer made through VLSI fabrication. A
microcontroller also called an embedded controller because the microcontroller and its support
circuits are often built into, or embedded in, the devices they control. A microcontroller is
available in different word lengths like microprocessors (4bit,8bit,16bit,32bit,64bit and 128 bit
microcontrollers are available today).
A microcontroller contains one or more of the following components:
Central processing unit (CPU)
Random Access Memory (RAM)
Read Only Memory (ROM)
Input/Output ports
Timers and Counters
Interrupt controls
Analog to digital converters
Digital analog converters
Serial interfacing ports
Oscillatory circuits
Microcontrollers need to be programmed to be capable of performing anything useful. It then
executes the program loaded in its flash memory – the code comprised of a sequence of zeros
and ones. It is organized in 12-, 14- or 16-bit wide words, depending on the microcontroller’s
architecture. Every word is considered by the CPU as a command being executed during the
operation of the microcontroller.
DEPARTMENT-EEE Page 11
ARDUINO BASED SOLAR TRACKING SYSTEM
Fig.3.2:Microcontroller Architecture
ATmega328P
The ATmega328P is a low-power CMOS 8-bit microcontroller based on the AVR
enhancedRISC architecture. By executing powerful instructions in a single clock cycle, the
ATmega328Pachieves throughputs approaching 1 MIPS per MHz allowing the system designer
to optimizepower consumption versus processing speed.
It has 28 pins. There are 14 digital I/O pins from which 6 can be used as PWM outputs and
6analog input pins. The I/O pins account for 20 of the pins. The 20 pins can act as input to
thecircuit or as output. Whether they are input or output is set in the software.Two of the pins are
for the crystal oscillator and are supposed to provide a clock pulse for theAtmega chip. The clock
pulse is needed for synchronization so that communication occurs insynchrony between the
Atmega chip and a device connected to it. Two of the pins, Vcc andGND are for powering the
chip. The microcontroller requires between 1.8-5.5V of power tooperate.
DEPARTMENT-EEE Page 12
ARDUINO BASED SOLAR TRACKING SYSTEM
Atmega 328P:
The Atmega328 chip has an analog-to-digital converter (ADC) inside of it. This must be or else
the Atmega328 wouldn't be capable of interpreting analog signals. Because there is an ADC, the
chip can interpret analog input, which is why the chip has 6 pins for analog input. The ADC has
3 pins set aside for it to function- AVCC, AREF, and GND. AVCC is the power supply, positive
voltage, that for the ADC. The ADC needs its own power supply in order to work. GND is the
power supply ground. AREF is the reference voltage that the ADC uses to convert an analog
signal to its corresponding digital value. Analog voltages higher than the reference voltage will
be assigned to a digital value of 1, while analog voltages below the reference voltage will be
assigned the digital value of 0. Since the ADC for the Atmega328 is a 10-bit ADC, meaning it
produces a 10-bit digital value, it converts an analog signal to its digital value, with the AREF
value being a reference for which digital values are high or low. Thus, a portrait of an analog
signal is shown by this digital value; thus, it is its digital correspondent value.
DEPARTMENT-EEE Page 13
ARDUINO BASED SOLAR TRACKING SYSTEM
The last pin is the RESET pin. This allows a program to be rerun and start over.
The table below gives a description for each of the pins and their functions.
Table 3.1 Pins and their functions
DEPARTMENT-EEE Page 14
ARDUINO BASED SOLAR TRACKING SYSTEM
There are various features that make the ATmega 328P a good choice for the project:
1. Temperature Range:-40°C to 85°C
2. Operating Voltage: 1.8 - 5.5V
3. Low Power Consumption at 1 MHz, 1.8V, 25°C
Active Mode: 0.2 mA
Power-down Mode: 0.1 μA
Power-save Mode: 0.75
I. Special Microcontroller Features:
Power-on Reset and Programmable Brown-out Detection
Internal Calibrated Oscillator
External and Internal Interrupt Sources
Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby, and
Extended Standby
II.High Endurance Non-volatile Memory Segments
32K Bytes of In-System Self-Programmable Flash progam memory
1K Bytes EEPROM
2K Bytes Internal SRAM
Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
Data retention: 20 years at 85°C/100 years at 25°C
Optional Boot Code Section with Independent Lock Bits
Programming Lock for Software Security
The design tool
Arduino IDE
The software design was done using Arduino IDE which was used for the programming. The
pargram was written using the C language. The Proteus circuit editing software was used for
drawing the PCB circuit. The design of the circuit was done using Eagle software.
DEPARTMENT-EEE Page 15
ARDUINO BASED SOLAR TRACKING SYSTEM
DEPARTMENT-EEE Page 16
ARDUINO BASED SOLAR TRACKING SYSTEM
There is a reset button for positioning the panel to an initial position which is at an inclination of
DEPARTMENT-EEE Page 17
ARDUINO BASED SOLAR TRACKING SYSTEM
40 degrees. This is done preferably in the evening after the sun has set. It makes the LDR go
back to an initial position, ready for tracking sunlight on the next day. There is also a push button
for initializing the servo motor. It switches it on, leaving it on standby mode.
Pins 7, 20 and 21 are for powering the microcontroller. It requires 5V. The inputs to the LDR are
Simulated.
Code:
#include <Servo.h> //including the library of servo motor
Servo sg90; //initializing a variable for servo named sg90
int initial_position = 90; //Declaring the initial position at 90
int LDR1 = A0; //Pin at which LDR is connected
int LDR2 = A1; //Pin at which LDR is connected
int error = 5; //initializing variable for error
int servopin=9;
void setup()
{
sg90.attach(servopin); // attaches the servo on pin 9
pinMode(LDR1, INPUT); //Making the LDR pin as input
pinMode(LDR2, INPUT);
sg90.write(initial_position); //Move servo at 90 degree
delay(2000); // giving a delay of 2 seconds
}
void loop()
{
int R1 = analogRead(LDR1); // reading value from LDR 1
int R2 = analogRead(LDR2); // reading value from LDR 2
int diff1= abs(R1 - R2); // Calculating the difference between the LDR's
int diff2= abs(R2 - R1);
if((diff1 <= error) || (diff2 <= error)) {
//if the difference is under the error then do nothing
} else {
if(R1 > R2)
DEPARTMENT-EEE Page 18
ARDUINO BASED SOLAR TRACKING SYSTEM
{
initial_position = --initial_position; //Move the servo towards 0 degree
}
if(R1 < R2)
{
initial_position = ++initial_position; //Move the servo towards 180 degree
}
}
sg90.write(initial_position); // write the position to servo
delay(100);
}
DEPARTMENT-EEE Page 19
ARDUINO BASED SOLAR TRACKING SYSTEM
DEPARTMENT-EEE Page 20
ARDUINO BASED SOLAR TRACKING SYSTEM
DEPARTMENT-EEE Page 21
ARDUINO BASED SOLAR TRACKING SYSTEM
3.2.3 Servomotor:-
Servo motors are used for various applications. They are normally small in size and have good
energy efficiency. The servo circuitry is built inside the motor unit and comes with a positionable
shaft that is fitted with a gear. The motor is controlled with an electric signal that determines the
amount of shaft movement.
DEPARTMENT-EEE Page 22
ARDUINO BASED SOLAR TRACKING SYSTEM
sent to the motor determines the position of the shaft, and based on the duration of the pulse sent
through the control wire the rotor will turn to the position that is desired.The servo motor expects
to see a pulse after every 20 milliseconds and the length of the pulse will determine how far the
motor will turn. For instance, a 1.5ms pulse makes the motor to turn in the 90 degrees position. If
the pulse was shorter than 1.5ms, it will move to 0 degrees and alonger pulse moves it to 180
degrees. This is shown below.
DEPARTMENT-EEE Page 23
ARDUINO BASED SOLAR TRACKING SYSTEM
especially for lower operation speeds. The requirement for a gear box and position encoder
makes the designs more mechanically complex. Maintenance requirements will also increase.
Crystal:
Crystal oscillators are electronic oscillator circuits that use inverse piezoelectric effect. With this
effect, when electric field is applied across certain materials they will produce mechanical
deformation. Therefore a crystal uses mechanical resonance of a vibrating crystal of piezoelectric
material so that there is creation of an electric signal with precise frequency. They have high
stability, are low cost and quality factor which makes them superior over such resonators as LC
circuits, ceramic resonators and turning forks.The crystal action can be represented by an
equivalent electrical resonant circuit.
DEPARTMENT-EEE Page 24
ARDUINO BASED SOLAR TRACKING SYSTEM
3.2.4 Battery:-
An electric battery is a device consisting of one or more electromechanical cells with
external connections provided to power electrical devices such as flash lights,smart phones,and
electrical cars.When a battery is supplying a electrical power,its positive terminal is the cathode
and its negative terminal is the anode.The terminal marked negative is the source external
device.When a battery is connected to an external circuit,electrolytes are able to move as ions
within,allowing the chemical reaction will be completed at the separate terminals and so deliver
energy to the external circuit.It is the movement of those ions within the battery to perform
work.Historically the term “battery” specifically reffered to a device composed of multiple
cells,however the usage has evolved to additionally include devices composed of a single cell.
DEPARTMENT-EEE Page 25
ARDUINO BASED SOLAR TRACKING SYSTEM
3.2.6 RESISTORS:-
A resistor is a two-dimentional electronic component designed to oppose an electric current by
producing a voltage drop between its terminals in proportion to the current,that is,in accordance
with Ohm’s law:
V=IR
The Primary characteristics of resistors are their resistance and the power they can
dissipate.Other characteristics include temperature coefficient,noise,and inductance.Less well-
known is critical resistance.
Fig.3.9: Resistors
DEPARTMENT-EEE Page 26
ARDUINO BASED SOLAR TRACKING SYSTEM
DEPARTMENT-EEE Page 27
ARDUINO BASED SOLAR TRACKING SYSTEM
CHAPTER-IV
Operation Of The Solar Tracker:-
In this project, LDR’s are working as light detectors. Before we go into detail, we will have to
understand how the LDR’s work. LDR (Light Dependent Resistor) also known as photo resistor
is the light sensitive device. Its resistance decrease when the light falls on it and that’s why it is
frequently used in Dark or Light Detector Circuit.The two LDR’s are placed at the two sides of
solar panel and the Servo Motor is used to rotate the solar panel. The servo will move the solar0.
panel towards the LDR whose resistance will be low, mean towards the LDR on which light is
falling, that way it will keep following the light. And if there is same amount of light falling on
both the LDR, then servo will not rotate. The servo will try to move the solar panel in the
position where both LDR’s will have the same resistance means where same amount of light will
fall on both the resistors and if resistance of one of the LDR will change then it rotates towards
lower resistance LDR.
IMPLEMENTED CIRCUIT:
Fig.4.1:Implemented Circuit
DEPARTMENT-EEE Page 28
ARDUINO BASED SOLAR TRACKING SYSTEM
CHAPTER-V
5.1RESULT AND DISCUSSION :
Result of this project is, when light falls on the LDR, itsresistance varies and a potential divider
circuit is used to obtain corresponding voltage value (5v) from the resistancece of LDR. The
voltage signal is send to the Arduino microcontroller. Established on the voltage signal, a
corresponding PWM signal is send to the servo motor which causes it to rotate and to end with
attains a position where intensity of light falls on the solar panel is maximum.
5.2 Conclusion:-
An arduino solar tracker was designed and constructed inthe current work. LDR light sensors
were used to sense the intensity of the solar light occurrence on the photo-voltaic cells panel.
Conclusions of this project is summarized as ,The existing tracking system successfully sketched
the light source even it is a small torch light, in a dark room, or it is the sun light rays. The
Arduino solar tracker with servo motor is employed by means of Ardiuno
ATmega328pmicrocontroller. The essential software is developed via Arduino Uno. The cost
and reliability of this solar tracker creates it suitable for the rural usage. The purpose of
renewable energy from this paper offered new and advanced idea to help the people.
DEPARTMENT-EEE Page 29
ARDUINO BASED SOLAR TRACKING SYSTEM
REFERENCES:
[1] Koyuncu B and Balasubramanian K, “A microprocessorcontrolled automatic sun tracker,”
IEEE Trans. Consumer Electron., vol. 37, no. 4,pp. 913-917, 1991.
[2] Konar A and Mandal A K, “Microprocessor based automatic sun tracker,” IEEE Proc. Sci.,
Meas. Technol., vol. 138, no. 4, pp. 237-241,1991.
[3] Rizk J. and Chaiko Y. “Solar Tracking System: More Efficient Use of Solar Panels”, World
Academy of Science, Engineering and Technology 2008.
[4] Filfil Ahmed Nasir, Mohussen Deia Halboot, Dr. ZidanKhamis A. “Microcontroller-Based
Sun Path Tracking System”, Eng. & Tech. Journal, Vol. 29, No.7, 2011.
[5] Ashok Kumar Saxena, V.Dutta. “A Versatile Microprocessor Based Controller For Solar
Tracking”.Proc. IEEE, 1990', pp.1105-1109.
[6] Damm, J “An active solar tracking system, Home Brew Magazine “ Issue #17, June/July
1990
[7] GamalM.Dousoky,Abou-Hashema M.EL- SAYED,MasahitoShoyama. “Maximizing Energy-
EfficencyInSingle Axis Solar Tracker Photovoltaic Panels”.8th International Conference on
Power Electronic- ECCEAsia –May 30 June, 2011.
[8] Alimazidi Mohammad, Gillispie J, Mazidi, Rolin D. McKinlay, “The 8051 Microcontroller
and Embedded Systems”, an imprint of Pearson Education, 2006.
DEPARTMENT-EEE Page 30