Mechanical Dual Axis Solar Tracking System Engineering Essay

Published: November 21, 2015 Words: 4269

Problems Faced:

For this design, the bottom of the solar tracking system is fixed to big metal plate and screwed to the ground. The problem with this method is the top parts of the solar tracking system have a lot of weight from the solar panel and 2 servo motors. Thus, the bottom part of the solar tracking system needs a careful handling so that it can support the weight from the top part. To support the weight from the top part, a heavy object is needed to place on top of the bottom metal plate and it is screwed to the ground. Besides this, due to the weight from the top part, the rod( aluminum or PVC pipe) which connected the top part and bottom part need to be strong as well. If strong wind blows towards the direction of the solar panel, the rod might break or bended.

Solution:

To reduce the weight of the top part of the solar tracking design, the design is changed. The 2 servo motor is separated to top and bottom. The bottom servo motor I controls the X-axis direction and the top servo motor II controls the Y-axis direction. Besides this, to increase the support for the top of the solar tracking system, two rods are used instead of one.

Second Design:

b)

Figure: Dual axis solar tracking system from a) perspective view b) side view

Problems Faced:

The servo motor 2 which is at the bottom of the solar tracking system can't support the weight of the solar tracking system as the servo motor is made from plastic component. Thus the turning of the servo motor 2 is limited by the weight.

Solutions:

To reduce the burden by the servo motor 2, three wheels is used to support the movement of the servo motor.

Third Design (Final):

Figure: Dual axis solar tracking system with wheels to support at the bottom.

This is the final design for the dual axis solar tracking. The solar panel is supported by servo motor I. Servo motor II is to support the turning of X-axis and is supported by three wheels.

LDRs' Location on the Dual Axis Solar Tracking System

Figure: Location of LDRs on the dual axis solar tracking system.

The solar panel with LDR I and LDR II is placed on a big cardboard. The two LDRs are place on each end of the solar panel. This is because if the distance between the two LDRs is too near, it is hard for the PIC microcontroller to get a bigger difference from LDRs. Thus the LDRs are place further from each other and is being separated with two pieces of the cardboard. The cardboard acted as a tall wall to provide shadow to the LDR. If the Sun is directly above the LDR, then the shadow of the wall will not fall on LDR. On the other hand, the Sun is slight behind the wall, the shadow of the wall will fall on LDR and thus give the LDR is highest resistance and low voltage output to the PIC microcontroller.

Figure: The shadow of the wall falls on the LDR when the Sun is not perpendicular to the LDR.

3.2 MATERIALS / COMPONENTS SELECTION

3.2.1 SOLAR PANEL

Solar panels are used in standalone as well as grids connect systems. They are usually based on silicon. The three most common solar panels are mono-crystalline, polycrystalline and amorphous.

Figure: (a) Mono-crystalline Solar Panel (b) Poly-crystalline Solar Panel and (c) Amorphous solar panel [34]

Table: Comparison between mono-crystalline solar panels, poly-crystalline solar panels and amorphous solar panels.

Solar Panel

Mono-crystalline

Poly-crystalline

Amorphous

Advantages

Best in efficiency (24%)

Most common

Cheapest

Light weight

Ideal for curve surface as can be fold

Disadvantages

Expensive

Medium in efficiency (19%]

Newest

Efficiency low (17%)[4]

Poly-crystalline solar panel was chosen as price is the main factor as this is a low cost solar tracking system project. Besides this, the efficiency of this is not a main factor in this project and poly-crystalline solar panel is much lighter compare to mono-crystalline. Although amorphous solar panel is cheaper compare to poly-crystalline but it had to be bought in a big quantity. So the best option is to buy poly-crystalline solar panel.

3.2.2 MOTOR

Table: Comparison between servo motor, stepper motor and D.C motor

Servo Motor

Stepper Motor

DC Motor

Advantages

More reliable

Available in wide range of frame side

Easy to control

Most effective

Fast response

Motor driver is not needed

Precision in positioning

High holding torque

Overload safe

Does not need feedback

Long lifespan

High output power

Low maintenance

High efficiency

Very quiet at high speed

Disadvantages

Need to be control using self-defined PWM

Only 180 degrees turn

Motor can be damaged by overload

High initial cost

Requires a controller

Low efficiency

Low torque to inertia ratio

Motors gets very noisy when at high speed

High initial cost

Requires a controller

Heavy

Poor motor cooling

Motor can be damage by overload

Servo Motor was chosen as it can be controlled using self-defined PWM and the price of a servo is cheaper compare to D.C motor and stepper motor. Beside this, the voltage requires by the servo motor is much lower if compare to stepper motor and D.C motor. Servo motor also does not need an external motor driver or driver circuit to control. The microcontroller just need to send the direction pulse and the servo will turn to the direction.

Servo Motor

Figure: Servo Motor [35]

A servo is a small device that has an output shaft. This shaft can be placed to certain angular positions by directing the servo with a pulse signal. Provided the pulse signal to the servo at its input line, the servo motor will maintain the angular position. The angular position of the servo is changes if the pulse signal that is being received is changed. Servo motor is normally used in place where is the position holding is very important such as controlled airplanes, controlled cars, elevator, robots and etc. There are a few main parts in the servo motor such as gearbox, position sensor, error amplifier, a motor driver as well as a circuit to interpret the pulse signal.

Figure: Servo Motor Block Diagram [36]

3.2.3 RELAY

Relays are normally used as a remote control switch which is control by another switch. The relays are comes with different sizes, rating as well as application. A small current flow circuit to control another circuit with higher current is allowed with relays. A single pole double throw (SPDT) relay is used in this circuit. A SPDT have five terminals.

Relay Operation:

There are two type of operation in relay:

Relay energized (ON)

When the current starts flowing through the circuit, the relay will be energized which cause the switch to close and current is allowed to pass the pins. Thus, the relay is ON as the magnetic field is created.

Relay de-energized (OFF)

When the current stops flowing through the circuit, the relay will be de-energized which caused the switch to open and current is prevented from passing the pins. Thus, the relay is OFF as there will be no magnetic field.

In this tracking system, both relay set as ground when not function. When sensor detects sun movement, it will give signal to the 555 timer. Then, the 555 timer will trig relay to control the motor.

Figure: SPDT relay circuit diagram. [37]

3.2.4 MICROCONTROLLER

Peripheral Interface Controller (PIC) Microcontroller

Table: Comparison between PIC 16F, PIC 18F and AVR

Microcontroller

PIC 16F

PIC 18F

AVR

Advantages

Cheapest

Easy to work with

More commonly used

Programmer is easily available and cheap

Cheaper than AVR

Larger instruction set than PIC 16F

Programmer is easily available and cheap

Fast

More features

Disadvantages

Slowest

Smaller instruction set

Slower than AVR

Smaller instruction set

Programmer is expensive

PIC 16F was chosen since it easily available and the price is the cheapest. PIC16F877A is used in this dual axis solar tracking system project. It is a CMOS flash-based 8 bit microcontroller. Besides this, it has some special microcontroller features like in-circuit serial programming via two pins, selectable oscillator options, power-saving sleep mode and programmable code protection. Apart from that, PIC 16F 877A have 10bit PWM and 3timers which is Timer0 (8-bit timer), Timer1 (16 bit timer) and Timer2 (8 bit timer). The most important part of the PIC16F877A is it has 10 bit and 8 channel of A/D converter which is to convert analog input to digital output. For the programmer of PIC 16, it can be bought easily and thus time is saved from making a programmer. The cost of the program is cheap compare to the others.

Figure: The diagram of PIC16F877A

3.2.5 PHOTO SENSOR

Table: Comparison between light dependent resistor (LDR) and photodiode.

Photo Sensor

LDR

Photodiode

Advantages

More sensitive (can amplify current)

Inexpensive

Low power

Comes with many sizes and specification

Small in size

Low power

Inexpensive

Faster response time (in us)

Low noise

Long lifetime

Small in size

Disadvantages

Lower response time (in ms)

Lower sensitivity

Smaller area detection

Light dependent resistor (LDR) was chosen as sensitivity is very important in this project as resistance must be change accurately according to the light density and it is very useful especially in light or dark sensor circuit. Besides this, LDR comes with different resistance which some can be as high as few Mega ohms (during darkness) and drop dramatically until few ohms.

3.3 CIRCUIT

Block Diagram:

Low Battery Indicator

Day Light Activator

PV System

LDR I & LDR II

Battery Charger

Servo Motor I (Controlled by LDR)

Servo Motor II (Controlled by Buttons)

PIC Microcontroller Circuit

ADC

PIC 16F877A Microcontroller

Figure: Block diagram of the circuit.

3.3.1 PIC MICROCONTROLLER CIRCUIT

Figure: The schematic diagram of the PIC microcontroller circuit

PIC Microcontroller Circuit

Voltage regulator LM 7805 is used to regulate 12V battery voltage down to 5V that is required by the PIC microcontroller and servo motor. For this PIC microcontroller circuit, 2 LM7805 voltage regulators are needed since the circuit needs more than 2A of current and a LM7805 only can produce 1.5A at maximum. Two voltage regulator is needed because two servo motor need around 2A on full load while the rest are for the LCD and PIC microcontroller. The two polarity capacitors with value 0.1pF are act as a smoothing capacitor to allow the circuit to have a smooth D.C supply of 5V.

To generate a stable as well as high accuracy periodic clock signal to the PIC microcontroller, a crystal oscillator is used. The crystal oscillator that is used for this circuit is 20MHz. A 20MHz crystal oscillator is chosen as the need of the reaction speed in the solar tracking project. The PIC microcontroller needs to react very fast when there is a difference at input from the LDR pin, thus 20MHz crystal oscillator which is also the highest that the PIC microcontroller can support. The higher the crystal oscillator frequency, the higher the level of performance of the PIC microcontroller will be. For this project, pin 13 and pin 14 of the PIC microcontroller is interfaced with a 20MHz crystal oscillator. Two 22pF ceramic capacitors were used to filter the external noise which could interfere the crystal frequency.

A 10k resistor is place at the master clear pin (MCLR) which is at the top left corner of the PIC microcontroller. The MCLR pin is always given a 5V connected to a resistor so that it is always in high so that the PIC microcontroller would not keep on reset the program inside the memory. On the other hand, once the MCLR is supplied with 0V, the PIC microcontroller will be reset the memory location and start to execute the first instruction that is in the PIC microcontroller.

Buttons are connected at Pin B5, B6 and B7. The buttons are connected in an active low way which pin of the PIC microcontroller is connected to a pull up resistor and a 5V. This means that if the button is pressed, the PIC microcontroller will detect at strong low as the button voltage drop to the ground and all the current will flow through the resistor and the switch to ground. When the button is pressed, the pull up resistor controls the amount of current that is allowed to enter the PIC microcontroller pin. On the other hand, when the button is not pressed, the pull up resistor controls the voltage on the input pin. The input will have high impedance which allows little current flows through the circuit so there will be a little voltage drop across the resistor. A 10k resistor is used in the pull up resistor as if a lower the lower resistor value is used, the higher power consumption when the button is pressed. The advantage of the pull up resistor compare to the pull down resistor is the pull up resistor consumes lesser power.

For the LDRs (LDR I and LDR II) which are connect using a voltage divider rule to the pin A0 and A1. Pin A0 and A1 is the analog to digital pins. A Vcc which is 5V is connect to the LDRs and the 10kΩ potentiometers while output which is the between the LDRs is connected to the pin A0 and pin A1. The LDR is put before the potentiometer as a large output voltage is needed when the sensor has a small resistance.

3.3.2 LIGHT ACTIVATION CIRCUIT

Figure: The schematic diagram of the light activation circuit.

Light Activation Circuit

Light activation circuit means the circuit will only activate and allow voltage and current to pass through when light source is detected. The power source of the light activation circuit can be either from a 12V batter or a 12V D.C. power supply. The light activation circuit is a transistor switch circuit. The NPN transistor's (BC547) base connected to the output of voltage divider circuit which is between the LDR and the potentiometer. The NPN transistor (BC547) is place between a NPN transistor (2N2222) and the LDR. The emitter of the transistor (BC547) is connected to the base of the NPN transistor (2N2222) and to a resistor with value of 10k and to the ground. The emitter of the NPN transistor (2N2222) is connected to a diode and to a relay. The diode (IN4001) is to eliminate back voltage when the relay is being disarmed.

When light is detected with the LDR, the LDR resistance will change. The brighter the light, the lesser the resistance will be. Thus, the higher value of the voltage output to the base of the NPN transistor (BC 547). The output voltage from the voltage divider keeps increasing and is sent to the base of transistor (2N2222). The ICE of the transistor (2N2222) increases and turns on the relay. The amount of light which is needed to turn on the relay can be change by turning the 100kΩ trimmer potentiometer. The transistor (BC547) is used as it is an amplifier transistor which can amplify the voltage from the output of voltage divider. On the other hand, transistor (2N2222) is used as it is a switching transistor which is used to switch on the relay.

Light activation circuit is important in this solar tracking project as it can only activate the solar tracking circuit while light is detected. Thus energy is not wasted on solar tracking when there is no light source detected.

3.3.3 LOW BATTERY INDICATOR CIRCUIT

Figure: The schematic diagram of low battery indicator circuit.

Low Battery Indicator Circuit

The low battery indicator circuits will lights the LED when the battery voltage drops below the value set by the100k trimmer potentiometer. The end of the trimmer potentiometer is connected to the base of the NPN transistor 1 (BC547) and the emitter is connected to the ground. The collector of the NPN transistor 1(BC547) is connected to the battery using a 10kΩ resistor. The collector of the NPN transistor 1(BC547) is connected to the base of the NPN transistor 2(BC547). The emitter of the transistor 2(BC547) is connected to the 470Ω resistor and a diode.

For the circuit, it the 100kΩ trimmer potentiometer and NPN transistor 1 hold NPN transistor 2 (BC547) and turns the LED off. When the voltage drop below the set value by the 100kΩ trimmer potentiometer, NPN transistor 1will turn off and thus turn on NPN transistor 2(BC547) with LED. The circuit is suitable for up to 12V battery voltage.

3.3.4 SOLAR CHARGING CIRCUIT

Figure: The schematic of portable solar charging circuit.

Solar Charging Circuit

Solar charging circuit is based on a LM 358N operational amplifier and a PNP transistor (2N3906). The emitter of the PNP transistor (2N3906) is connected to the positive of the polarity capacitor and to a solar panel while the base of the PNP transistor (2N3906) is connected to the pin1 of operational amplifier (LM358N) which is the output of the operation amplifier. Pin 4 is connected to the ground and pin 8 is connected to Vdd.Pin2 of operational amplifier which is the inverting input is connected to a diode and to ground. The pin 3 is connected between the 26.1kΩ resistor and a 10kΩ resistor. An operational amplifier (LM358N) is used as it can amplify the input voltage and produce an output voltage which is hundreds or thousands time much higher than the input. This portable charging circuit can provide a constant 2.4V D.C. and can be used for charging two AA batteries.

MAIN COMPONENTS

1. Solar Panel:

The solar panel is an important component for this project because it uses the solar energy to produce the electricity to charge two AA batteries.

2. Solar Charger:

The voltage produce from solar panel being connect to Solar Charger to charge the battery.

3. Day time controller:

The tracker is only active during the day with sunny condition. If the sky is cloudy or at night, the tracker will be turn off.

4. Power Inverter:

The high voltage is step down to low voltage.

5. Servo Motor

To moving the solar panel and its move follow the program at programmable circuit.

6. Light Sensor

Light sensor is a resistor when the resistance is decrease with the increasing of incident light intensity. So that the microcontroller will control the servo motor to move to the higher light incident light intensity area.

3.4 SOFTWARE

START3.4.1 FLOW CHART

PIC MICROCONTROLLER

SERVO MOTOR 2 IS CONTROLLED BY 3 BUTTONS WHICH CAN CONTROL THE DIRECTION TO TURN

SERVO MOTOR 1 MOVE TO THE DIRECTION OF THE HIGHEST LDR RESISTANCE VALUE

SERVO MOTOR 1 IS EITHER STOP OR MOVE CCW OR CW

SERVO MOTOR 1 MOVE TO THE DIRECTION THAT IS DIRECTED BY THE USER

END

This is an overall program flow chart which shows how the control of the two servos motor. The servo motor I is control by LDR I and LDR II while servo motor II is control by the three buttons which each buttons represent a direction.

3.4.2 SERVO MOTOR I

START

POSIITON IS CHECKED EVERY 0.1ms

PIC MICROCONTROLLER

SERVO MOTOR I IS IN FIRST POSITION

LDR I & II VALUE ARE CONVERT FROM ANALOG TO DIGITAL, CHECK AND COMEPARE

LDR I < LDR II

PIC WILL CONTROL SERVO MOTOR I TO TURN CW DIRECTION

PIC WILL CONTROL SERVO MOTOR I TO TURN CCW DIRECTION

LDR I>LDRII

LDR I = LDR II

PIC WILL OUTPUT LOW PULSE AND SERVO MOTOR I WILL BE STOP

THE VALUE THAT OF EACH LDR IS SHOWN IN THE LCD IN THE VALUE V (voltage)

END

The PIC microcontroller control checks the difference of the LDR I and II by comparing the analog input data from the LDRs and convert it digital data. This is done by using the analog to digital converter (ADC) in PIC 16F877A microcontroller chip. When the ADC conversion is done, PIC microcontroller will then compare the differences between the two LDRs and it will turn to the direction where the higher voltage is received. If LDR I voltage value is bigger than LDR II voltage value or in other word, the resistance of LDR I is lower than LDR II resistance. The servo motor I will turn to counter clockwise direction. On the other hand, if LDR I voltage value is lesser than LDR II voltage value, the servo motor I will turn to clockwise direction. If both LDR I and LDR II have same voltage and resistance value, PIC microcontroller will output a low pulse which will stop the servo motor I from moving. The differences between the two LDR s are checked every 0.1 ms. The values after the ADC conversion are display in the LCD. The value from ADC conversion are multiply with 5 and then divide with 1024 to make the voltage values that are display in the LCD is from 0 to 4 range.

3.4.3SERVO MOTOR II

START

PIC MICROCONTROLLER

USER CAN COMMAND THE PIC TO CHANGE THE DIRECTION OF THE SRVO MOTOR WHEN IS NEEDED

USER PRESS THE BUTTON WHICH CONTROL THE DEGREES OF TURNNING OF SERVO MOTOR II

BUTTON 2

90°

BUTTON 1

43°

BUTTON 3

137°

SERVO MOTOR II IS TURNED TO THE DIRECTION WHICH IS COMMANDED BY THE USER

END

The three buttons control the X-axis by sending pulse to the servo motor II. The angle of direction on the three buttons is based on the latitude on 23.5°N, 0° and 23.5°S. 23.5°N is the tropic of cancer, 0° is the equator and 23.5°S is the tropic of capricon.

For latitude 23.5°N, during March equinox, the Sun is at 66.5° while during June Solstice, the Sun is at 90°. On the other hand, during September Equinox, the Sun is at 66.5° and during December Solstice, the Sun is at 43°.

Calculation for Equinox, A=90°-L

=90°-23.5°

=66.5°

Calculation for December Solstice, A= 90°- L-D

=90°-23.5°-23.5°

=43°

Calculation for June Solstice, A=90°-L+D

=90°-23.5°+23.5°

=90°

Figure: Solar noon Sun angle at 23.5°N. [5]

For latitude 0°, during March equinox, the Sun is at 90° while during June Solstice, the Sun is at66.5°. Besides this, during September Equinox, the Sun is at 90° and during December Solstice, the Sun is at 66.5°.

Calculation for Equinox, A=90°-L

=90°-0°

=90°

Calculation for December Solstice, A= 90°- L-D

=90-0-23.5

=66.5°

Calculation for June Solstice, A=90-(90-L+D-90)

=90-(90-0+23.5-90)

=113.5°

Figure: Solar noon Sun angle at 0°. [5]

For latitude 23.5°S, during March equinox, the Sun is at 66.5° while during June Solstice, the Sun is at 66.5°. Apart from that, during September Equinox, the Sun is at 66.5° and during December solstice, the Sun is at 90°.

Calculation for Equinox, A=90°-L

=90°-23.5°

=66.5°

Calculation for December Solstice, A= 90- L+D

=90°-23.5°+23.5°

=90°

Calculation for June Solstice, A=90-L+D

=90°+23.5°+23.5°

=137°

Figure: Solar noon Sun angle at 23.5°S. [5]

Table: Conversion of the X-axis degree to the servo motor pulse width.

X-axis Degree(°)

Servo Pulse Width(ms)

43

1.23 (Button 1)

66.5

1.37

90

1.50 (Button 2)

113.5

1.63

137

1.76 (Button 3)

Thus, the pulse is sent for 20 times each time the button is pressed so that the pulse is received by the servo motor II successfully. A debounce button code is also included in the code. The debounce button code is when a button press than half a second, the command of the code is send for 20 times. This debounce button code is to prevent the button from not sending the command when the button is pressed. This is mainly due to the duration the button is being pressed.

This is a sample code for debounce button.

if (button(PIN_B6,0,50,20,B6,1))

It means that if a button is pressed down more than 0.5seconds, the command will auto repeat for 20 times per second. The "0" means that it is an active low pin.

Servo Motor Pulse Sending

The pulse signal is sent to the servo motor II is about 20ms in length and the pulse width is around 1 to 2 ms in length. The pulse width is to determine the angular position of the servo's output shaft. Neutral of the servo motor is the direction when the volume of rotation to the clockwise and to the anticlockwise is the same. The neutral position of a servo is normally at 1.5ms pulse width.

The angle of the servo motor is determined by the length of a pulse which is sent through a wire. The pulse is called pulse width modulation where it can be generated by the microcontroller. The servo motor expects to see a pulse every 20ms. The angular position that the servo's output shaft turns to is the length of pulse width that the servo receive. When a pulse is sent to command the servo's output shaft to move, it will move the specific position and hold on to that position. The maximum value of the force that the servo motor can stand is the torque rating of the servo motor. To make the servo's output shaft stay at the current position, a continuous pulse should be sent.

A pulse width with less than 1.5ms is sent to the servo's output shaft will rotates to a specific position of a counter clockwise from neutral position. If the pulse width is more than 1.5ms, the servo's output shaft will turn to clockwise direction from the neutral position. The minimal and maximum width of the pulse width will determine the position the servo's output shaft would turn. Different servo's brands have different minimal and maximum pulse width. The normal pulse width for a servo motor is around 1ms to 2ms wide. [35]

Figure: Pulse Width Modulation of Servo motor [35]

Figure: Position of Servo Motor [35]