Received date: October 2009; Revised date: December 2009; Accepted date: March 2010
Visit for more related articles at Global Journal of Technology and Optimization
Solar energy is rapidly advancing as an important means of renewable energy resource. More energy is produced by tracking the solar panel to remain aligned to the sun at a right angle to the rays of light. This paper describes in detail the design and construction of a prototype for solar tracking system with two degrees of freedom, which detects the sunlight using photocells. The control circuit for the solar tracker is based on a PIC16F84A microcontroller (MCU). This is programmed to detect the sunlight through the photocells and then actuate the motor to position the solar panel where it can receive maximum sunlight.
PIC MCU, tracking, photocell, frame, motion system
These days electrical generation is typically provided by fossil fuels such as coal, natural gas, and oil and also as nuclear power [1,19]. Some of today’s most serious environmental problems can be linked to world electricity production based primarily on the use of non-renewable resources. Currently one third of the world population do not have access to electricity and are not connected to the national grid, one solution to this problem is renewable energy in the form of photovoltaic (PV) systems. Despite high capital cost, PV systems are still a viable solution for rural areas . Studies suggest that the rate at which fossil fuels are consumed today, there are high chances that they will deplete by the end of this century. For a long time, it has been thought that atomic energy would be a solution for the growing energy problem, but in recent times solar energy has proved to be an efficient, more secure and safe way of providing energy Concepts related to the solar energy have constantly been under heavy research and development. The basic objective is to optimize the energy produced from photovoltaic cells, by making the overall systems more efficient and cost effective. Most solar panels are statically aligned; they have a fixed position at a certain angle towards the sky. Therefore, the time and intensity of direct sunlight falling upon the solar panel is greatly reduced, resulting in low power output from the photovoltaic (PV) cells. Solar tracking system is the solution to this issue as it plays a major role in overall solar energy optimization.
In order to ensure maximum power output from PV cells, the sunlight’s angle of incidence needs to be constantly perpendicular to the solar panel. This requires constant tracking of the sun’s apparent daytime motion, and hence develops an automated sun tracking system which carries the solar panel and positions it in such a way that direct sunlight is always focused on the PV cells .
This paper is about moving a solar panel along with the direction of sunlight; it uses a gear motor to control the position of the solar panel, which obtains its data from a PIC16F84A microcontroller. The objective is to design and implement an automated, double-axis solar-tracking mechanism using embedded system design in order to optimize the efficiency of overall solar energy output .
Two light dependent resistors (LDR) is used for each degree of freedom. LDRs are basically photocells that are sensitive to light. Software will be developed which would allow the PIC to detect and obtain its data from the two LDRs and then compare their resistance. The two LDRs will be positioned in such a way, so that if one of the two comes under a shadow, the MCU will detect the difference in resistance and thus actuate the motor to move the solar panel at a position where the light upon both LDRs is equal. Two separate but identical circuits will be utilized for both axes [3,4,20].
A light sensor is the most common electronic component which can be easily found. The simplest optical sensor is a photo resistor or photocell which is a light sensitive resistor these are made of two types, cadmium sulfide (CdS) and gallium arsenide (GaAs) ,
The sun tracker system designed here uses the cadmium sulfide (CdS) photocell for sensing the light. This photocell is a passive component whose resistance is inversely proportional to the amount of light intensity directed towards it. It is connected in series with capacitor. The photocell to be used for the tracker is based on its dark resistance and light saturation resistance. The term light saturation means that further increasing the light intensity to the CdS cells will not decrease its resistance any further. [4,5], Figure 1 shows the dimensions of the light dependent resistor.
Light intensity is measured in Lux, the illumination of sunlight is approximately 30,000 lux, Figure 1 shows how a typical light dependent resistor behaves in terms of its resistance with changes to light intensity.
From the graph shown in figure 2 it can be clearly seen that the resistance of the LDR is inversely proportional to the light intensity that as the light intensity increases the resistance of the LDR decreases .
There are three types of PIC16F84A packaging designs available in the market: PDIP (18-Lead Plastic Dual In-line), SOIP (18- Lead Plastic Small Outline), and SSOP (20-Lead Plastic Shrink Small Outline). PDIP type packaging will be used for the solar tracker embedded design. Figure 3 illustrates the PIC16F84A PDIP  and shows the name and pin positions [7,8,12].
• 8 bit multi-channel analog-to-digital converter
• 13 input/output pins
• 64 bytes of data EEPROM memory
The internal hardware architecture of PIC16F84A is represented by the block diagram shown in figure 4.
All the blocks of figure 4 are main bits of hardware and the lines that connect them are called buses. These buses are basically small parallel lines along which data can be passed simultaneously from one hardware block to the other. The number besides each bus indicates the number of lines present within that bus, denoting the bits that can be sent along these buses,
The PIC16F84A controls the H-bridge which consists of four transistors 2N2222, Four Diodes 1N4148 and two 10KΩ resistors. Although any NPN transistor can be used, it was decided to use CS9103 NPN transistor for tracker circuit. This was chosen because it is capable of handling high current as compared with 2N2222; the CS9013 can handle up to 500mA, which is sufficient enough to power up the motor. Figure 6 shows the appearance of the transistor. On first trial run of the Hbridge it was known that the speed of motor was not controlled and was moving very fast, to solve this problem a variable resistor bank was connected and a resistance of about 6 Ohm was set. This enabled the motor to move slowly producing the same amount of torque [6,9,10].
The 1N4148 diodes were chosen to be mounted on all four transistors because the PIC microcontroller is very sensitive to electrical spikes (which may cause a reset or lockup); the diodes are connected across the collector-emitter junction of each transistor. Their function is to stop any electrical spikes caused by switching the motor’s winding on and off.
The PIC16F84A needs a regulated supply D.C voltage of 5 Volts, the 7805voltage Regulator is used to provide the voltage required by the microcontroller. The top view of the regulator itself is shown in figure 7.
The circuit of figure 8 shows how to convert the unregulated supply of 12v to 5V, the capacitor of 0.1 microfarad is placed between the input and output to smoothen and maintain the voltage.
Before the schematic diagram was plotted for the program a prototype was made onto a Vero board and tested, all errors were rectified before final sketch was made, and figure 9 shows a description of prototype
The schematic diagram was plotted component by component on a program called Easy PC professional, which is used to make layouts of any circuit. A new project was created and each of the components were selected from its library and carefully placed onto the grid, each pad and hole were selected and added according to the sizes of the various components used, the components were connected and labeled carefully. Figure 10 shows a detailed picture of the schematic when plotted on the program. Once the plotting step was complete, the circuit diagram was printed on a special transparent paper using a plotter, and the following steps were taken:
a) Cut the printed circuit board (PCB) according to the size of the layout. Clean with any abrasive material.
b) Add photo-resist layer to PCB. Positive photocopying lacquer was used. The PCB was sprayed from a distance of approximately 20cm. Let lacquer layer to smoothen for at least 2 min.
c) The photo-resist layer was dried using hot air gun for about one min.
d) The pad hole layer paper was placed onto PCB (copper side) and glued with adhesive tape
e) The PCB was placed into the ultraviolet (UV) exposure unit and exposed to UV-light for about 140 to 200 seconds.
f) The PCB was developed using Sodium Hydroxide NaOH (5,8g/l) liquid, to remove all the photo resistant material and then rinsed with water.
g) The PCB was then etched using another chemical called ferric chloride, which removes all the unnecessary copper.
h) The final step was to drill holes onto the PCB using a high speed precision drill.
i) Once the PCB has been drilled, the various components were placed into the board and soldered using a soldering gun.
WinPic800 is a free application and its executable file can be downloaded from www.winpic800.com. With a few simple steps the executable can be installed within the PC at any desired location. After the installation is successful the program can be launched through the Program Files menu on Windows. Once WinPic800 has been launched the first step is to connect the program to the CPU’s COM via serial cable. The next step is to select the type of programmer which the WinPic800 will be using and also specify which COM port is connected to on the PC. This is done by clicking the Hardware button under the settings tab located in the main toolbar, as shown in figure 11.
Figure 12 shows the window that will appear once the Hardware menu is launched. Notice that JDM programmer has been selected as the hardware; COM1 has been selected for the address. Apply Edits button needs to be pressed in order to save the settings.
All steps following figure 12 are successively and correctly been selected by referring to the menus instruction, until reaching to the final step which is important to verify whether the code transferred onto the PIC has been uploaded properly. This is done by clicking on the Verify All button shown in figure 13. As a result the window shown in figure 14 will pop-up displaying a message that confirm the code has been uploaded correctly .
This concludes the PIC16F84A software development tools section, and the chip is now ready for testing and implementing procedures
Figure 15 shows the schematic for the solar tracker control circuit. A voltage supply of 12V is applied to the circuit which is then passed through a 5V voltage regulator. The regulated voltage is then supplied to the PIC. Notice that the LDRs are connected to port RB2 and RB3 of the PIC. The output which drives the motor is obtained from port RB0 and RB1. Pins RA0 and RA1 are connected to 5V power source. MCLR reset input port is also connected to 5V supply via 10k resistor. In order to supply power to the PIC, PIN 5 or Vss is set to ground whereas PIN 14 or Vdd is connected to positive 5V.
MHZ Crystal Oscillators
The external clock determines MCU fundamental operating characteristics; therefore it needs to be selected wisely. It was realized that faster is not always better in terms of MCUs operating speed and programming execution. The drawbacks associated with high frequency clock are: their requirement for large power consumption and also possibly the electromagnetic interference. All the instructions embedded within the MCU which require proper timing depend on the external clock. Therefore, if the clock speed is stable and accurate the operation of instructions will stable and accurate as well. Considering all these factors, a 4MHZ oscillator clock was selected. 4MHZ oscillator is considered an optimum choice when working with applications such as Solar Tracking.
Cadmium Sulfide Photocell
The solar tracker system will obtain its data from two CDS (Cadmium Sulfide) photocells, which are type light dependent resistors. The photocells data acquisition system will be based on fuzzy logic methodology; therefore there will be no need for A/D conversion in the circuit. The material used in CDS photocell is of high resistance semiconductor. Therefore, once light falls on its surface, photons absorbed by the semiconductor will give bound electrons enough energy to jump into the conduction band. As a result the free electrons conduct electricity and thus lower the resistance. In case of high light intensity, the photocell will produce lowest resistance, the opposite will occur in the case of complete darkness. Figure 16 shows how the resistance in the CDS photocells varies in proportion to the light intensity falling upon its surface.
Figure 17 is the model of Solar-Tracker prototype. As illustrated the solar tracker prototype accommodates both degrees of freedom: azimuth and vertical. Note that two LDR sensors module and thus two identical control circuits are implemented in both degrees of freedom.
The basic concept is that two CDS cells will be connected to port RB2 and RB3 of the PIC. As shown in figure 18, the two photocells will be positioned on a small straight piece of wood or plastic. Another piece will be mounted perpendicular to the straight piece, thereby dividing both the sensors. The concept is that if both the photocells are equally illuminated by the sun, their resistance level will be the same. As long as the resistance is the same with an error margin of ±10 points, the PIC will analyze this data and thus will not generate any signal to actuate the motor. Whereas in the case of figure 19, if one of the sensors comes under a shadow, then the PIC will detect this change and thus it will actuate the motor to move the sensor module to a position where equal light is being illuminated on both of them. The PIC is programmed so that it can obtain its resistance data from the two LDRs and to move motor either clock wise or anti clock wise depending on which LDR is under shadow. The basic concept of the software design is illustrated in the flowchart of figure 20. The software will specify on which pins the LDRs will be connected to provide input and which pins should produce output signal for the motor. Figure 21 shows the comprehensive flowchart which illustrates in detail how the code for the PIC will be written and what functions it will perform.
The operation of the solar tracker is simple to understand, it works by using a PIC16F84A which compares the light intensity illuminated onto the LDRs. The logic that works on the Microcontroller to detect the signal is based on a resistance capacitor timing circuit,(RC constant), this is necessary in order to set the pre-scalars on the program that will be stored inside the microcontroller. Once the signal is fed into the input for RB2 and RB3, the program compares the two input values and then the difference is detected and sends an output signal from port RB0 and RB1 to let the motor moves clockwise and counter clock wise respectively.
The signal that is sent from output port RB0 and RB1 is logic level of 1 and 0, logic 1 is high level and 0 is for low level, when a logic high is sent to the base of the transistor, it energizes and makes a closed circuit, thus a current flows through the motor, only two transistors can be switched on and off at a time.
The Materials used in the construction of the prototype include Polyvinyl Chloride (PVC), one and half inch pipes, wooden base of Medium-density fibreboard (MDF), stool which can rotate 360 degrees, automotive motor, bicycle gear mechanism. The description on how each section of the prototype was built is described as follows.
Five pieces of PVC pipe with equal length are connected back to back onto a T-junction and each junction is connected to Lshaped PVC making a stable base onto which the motor can be mounted. The length of each PVC pipe is approximately 0.5 meter. A wooden base is placed on top of the square shaped design, the motor is then mounted below the wooden board, this way the motor is upside down thus its gear is facing downward as well.
The hydraulics portion of the revolving office chair was used which can rotate 360 degrees. A gear was then welded onto the hydraulics part using an electric welding machine.
The chair is mounted onto the wooden base; this base has dimensions of one meter by 0.8 meter in length and wide respectively.
Once the hydraulics portion was mounted, the PVC base was placed in a position so that the small gear on the motor was in perfect alignment with the big gear which was mounted on the hydraulics. Once the two gears were aligned they were connected by a steel chain. The gear that was mounted on the motor has 14 teeth and that which was mounted on hydraulics portion had 30 teeth. These specific teeth were chosen because this combination produces more torque on less speed thus less current has to apply to the motor, this concept was used for both axis of movement. The gear ratio was calculated and was found to be 1:2.
The horizontal axis was constructed by using two PVC pipes of size three inches in diameter, which were cut to length of 0.3 meters in height, the (MDF) wood was then later cut, 0.4 meter by 0.3 meter in length and width respectively. The PVC pipes were mounted into the shape of T-junctions. These junctions were then mounted on the MDF base, a hole was drilled on the PVC pipe at approximately 0.6 meters from the bottom, and another one inch PVC pipe was cut to a length of 0.5 meters, this pipe was inserted inside the three inch pipe, and the solar panel was mounted on it.
Finally the motor and gear were mounted on the side and linked using a chain for the horizontal axis and all the LDR’s were mounted and wired.
The first step in testing the solar tracker design is to verify whether the LDRs are working properly. The light intensity directed onto the LDR increases, its resistance therefore decreases. The next step is to use the Tektronix TDS1012 in order to test the signals generated by the LDR and then sent to the PIC. Tektronix TDS1012 oscilloscope is a digital graphdisplaying device; it draws a graph of an electrical signal. In most applications, the graph shows how signals change over time .
Figure 22 shows the result when one of the Two LDRs is covered. Channel 1 and 2 represent the RB0 and RB1 on the PIC respectively. The signal represented by channel 1 illustrates that LRD1 is under shadow. The signal shown in the figure is sent to the motor drive from the PIC16F84A. The motor is therefore actuated, and it runs until the resistance on both LDRs is the same.
Figure 23 illustrates the result when both the LDRs are covered. The signal is sent to PIC16F84A to be analyzed. In this case PIC does not send any signal to the motor drive as the resistance value on both LDRs is the same.
It has been proven through research that solar tracking system with single-axis freedom can increase energy output by approximately 20%, whereas the tracking system with doubleaxis freedom can increase the output by more than 40%. Therefore this work was to develop and implement a solar tracking system with both degree of freedom and which detected the sunlight using sensors. The control circuit for the solar tracker was based on a PIC16F84A microcontroller. This PIC was the brain of the entire tracking system, and it was programmed to detect the sunlight through the sensors and then actuate the motor to position where maximum sunlight could be illuminated onto the surface of the solar panel
After many setbacks in testing of the solar tracker, a lot of time was needed to be set aside for verification and testing due to the unpredictability of the weather and debugging of errors. The tracking implementation is successfully achieved with complete design of two degree of freedom using the PIC microcontroller. Suitable components and gear dc motors are used for the prototype model, which exhibit a clear, stable and precise movement to face the sun.