Fig. 1: Image showing AVR ATMega32 Microcontroller Board used in Light Tracking System
Electricity is the most required and important element of human life. We cannot imagine our day to day life without electricity. Electricity is generated using conventional (coal, diesel) and non conventional (water, wind, sunlight) energy sources. The recent and latest trend is to generate electricity from solar energy. The solar panel (made up of solar-photovoltaic cells) converts solar energy in to electrical energy. Several hundreds or thousands of solar panels to gather generates electrical energy in terms of Mega Watt (MW). For any small unit (single street light, solar light) single solar panel can used. Now to get maximum electrical energy from solar panel it is required that solar panel should always face towards sun. It should not be covered by any object (or obstacle) or should not come in shadow region. During day time sun moves from east to west. If solar panel is stationary it may be possible that it can be covered some time or may be in shadow region after a period. So there is a need of some mechanism that moves solar panel in the direction of sun. The arrangement should be made in such a way that solar panel automatically moves as it detects shadow region – that means less sunlight. In other way the solar panel should track sunlight (daylight).
Fig. 2: Image showing circuit connections of AVR ATMega32 Microcontroller Board used in Light Tracking System
The given project demonstrates how to move solar panel in the direction of light. It uses two LDRs as light sensor one for left and another for right and a stepper motor. The movement of stepper motor indicates movement of solar panel. When light is falling on both LDRs the motor is stationary. As light falling on any LDR increases it means other LDR is in shadow region or it is covered. So stepper motor moves in the direction of more light. Motor rotates till light falling on both LDR becomes same. That’s how motor rotates in either direction as light falling on any one LDR increases. The project uses AVR micro controller ATMega32 that will take controlling action to rotate stepper motor (solar panel) in the direction of maximum light. For this project reader should have knowledge of how to start with AVR .
Hardware & Software Connection
· LDRs are connected between Vcc and Gnd with 10 K pot that provide bias to LDRs. Pots are used to set/change/adjust threshold level of falling light on LDR.
· The LDR junction outputs are fed to ADC0 and ADC1 input pins of AVR microcontroller
· Four different colour LEDs are connected to PORTD pins with current limiting resistors. They are used to give different indications
· PORTC pins PC0 – PC3 are connected to input of UNL2003A.
· Four Outputs of UNL2003A are connected to four coils of stepper motor.
· Common coil terminal(s) of stepper motor is connected with Vcc supply
Fig. 3: Image showing stepper motor controlled by the direction of incident light
· When light falling on both LDRs is same, the voltage at both ADC inputs are less than or more than threshold level. So motor is stop. This is indicated by RED led. This is possible in two cases. 1st when both LDR exposed to max light (less than threshold level) and 2nd when both LDR gets less light (more than threshold level)
· Now suppose light falling on LDR1 increases than LDR2. So input voltage at ADC0 increases threshold level. But at ADC1 it is still below threshold level. (this means LDR2 may be in shadow region) So motor rotates in clockwise direction to rotate panel in the direction of LDR1 to get max light on both LDRs. This is indicated by GREEN LED
· Motor rotates till both ADC inputs become less than threshold level
· Similarly when light falling on LDR2 increases, motor rotates in anticlockwise direction. This is indicated by YELLOW LED
· Micro-controller ATMega32 reads analog voltage values of LDR1 and LDR2 after every 500 ms. This is indicated by blinking of BLUE LED. So falling light on both LDR is sensed at a rate of 2 samples / second.
Fig. 4: Image showing Blue LED glowing as indication of light intensity sensed by LDR sensors
The software program embedded into AVR micro controller is responsible for complete functionality. It performs following tasks
1. Reads analog voltage values and converts it in to digital equivalent
2. It converts this digital value into equivalent decimal value
3. Compare these decimal values with threshold levels to make decision to rotate motor
4. Give pulses to stepper motor to rotate it clockwise or anticlockwise
5. Give different indication on LEDs
The program is written in C language. It is compiled using AVR GCC compiler and simulated using AVR simulator for ATMega32 micro-controller. Both AVR GCC compiler and AVR simulator are available builtin in AVR studio (V4) software tool. When program is compiled successfully it generates HEX file. This file can be loaded into target device ATMege32 using any suitable programmer (like ponyprog). Here is the complete program code with necessary comments.