Documente Academic
Documente Profesional
Documente Cultură
REPORT
AIM
DESIGN DEVELOPMENT OF
MICROCONTROLLER BASED A SUN
SEEKER
INTRODUCTION
Background Math:
Basics:
Solar Math:
For a photovoltaic(PV) cell, the voltage produced is proportional
to the power of the light hitting the surface. If the PV cell is not
orthogonal to the light source, the voltage decreases with the
projected area, or the cosine of the angle. See diagram:
Figure 1:
light
Vo
V0cosθ
V0
V2
φ
V1
θ
We can say
V1=V0cos(θ) (1)
And
V2=V0cos(θ-
φ)=V0cosθcosφ+V0sinθsinφ=V1cosφ+V0sinθsinφ (2)
Rearranging, we have
(V2-V1cosφ)/sinφ=V0sinθ (3)
inserting (1) into (3) we get
(V2-V1cosφ)/sinφ=V1tanθ (4)
and rearranging, we get:
arctan((V2-V1cosφ)/V1sinφ)=θ
(5)
So if we know V2 and V1 and φ, we can calculate where we want
to go, θ. This method is used in the algorithm TrackD(), to be
discussed later.
For a really smart solar tracker we need the equation of the sun
in our coordinates. As found by Szokolay[1996] and Carruthers,
et al [1990](and found on the Square One website in the
appendix), it is:
t = (2 * pi * ((day - 1) / 365.0))
Where day is the number of the day of the year on the Julian
calendar(0-365), time is the hour of the day(0-24), and latitude is
the latitude of our position on the earth in radians. We won’t go
into the derivation of this equation, but the real point is, the
altitude and azimuth are dependent on 3 values, the day of the
year, the latitude, and the time of the day. We can use these
equations to make a cool graph of the path of the sun
today(we’re at 43 degrees latitude in Ithaca and it’s the 120th
day of the year):
Of course we can’t see the sun when it has a negative altitude,
but if we could see through the earth that’s where it would be.
18
16
14
12
10
0
0 2 4 6 8 10 12 14
Now we know the equation for a line is y=mx+b, where m and b
are unknowns. From just looking at the graph we can probably
guess that b, the y-intercept, is somewhere between 0 and 5, and
m, the slope, is somewhere between 0 and 2. One way of
figuring out the line of best fit is to search through a bunch of
values of m and b, try them in the equation, and figure out the
square of the error. Which ever values of m and b have the
lowest error squared are the ones we’ll use. So we could try
every value of m from 0 to 2 in increments of .02 and every
value of b from 0 to 5 in increments of 0.05, but this would be
10,000 attempts, and would take quite a bit of computing time.
A much more frugal way to do it and end up with the same
accuracy would be to try every value of m from 0 to 2 in
increments of .2 and every value of b from 0 to 5 in .5
increments, find the best value, and then refine our search. We
could then do a search in m of range .4 in increments of 0.02
around the best previous value, and a search in b of range 1 in
increments of 0.05 around the best previous value of b, and find
the best values. This will give us the same accuracy as our
calculation before, but instead of taking 10,000 attempts, we’ll
do it in only 500(100 for the first run, 400 for the second) which
will take us 20 times less computing. We could then keep
refining our search if we desired to get more accurate values.
We use a modified version of this method in TrackC(),
discussed later on.
Logical Structure
CIRCUIT DESCRIPTION
POWER SUPPLY
Component list
1. 7805 regulator IC
2. 9V DC Battery.
3. 1000uf., 10uf. Capacitor, at least 25V voltage
rating.
4. 0-9 Step down transformer
DESCRITION OF POWER SUPPLY
This circuit is a small + 5 volts power supply Which is
useful when experimenting with digital electronics. Small
inexpensive battery with variable output voltage are
available, but usually their voltage regulation is very poor,
which makes them not very usable for digital circuit
experimenter unless a better regulation can be achieved in
some way. The following circuit is the answer to the
problem.
This circuit can give +5V output at about 500mA
current. The circuit has overload and terminal protection.
MICROCONTROLLERS VERSUS
MICROPROCESSORS
I/O ports on the chip itself. For this reason they are
referred as general- purpose microprocessors. A system
and I/O ports make the system bulkier and much more
I/o ports needed to fit the task at hand. This is the not the
INTERRUPTS
ETC.
ON-CHIP TIMER 0
ROM for ON-CHIP
program code RAM TIMER 1
INTERRUPT
CONTROL
C
BUS 4 I/O SERIAL
O
CONTROL PORTS PORT
TXD RXD
data and print it. Contrasting this with a IBM PC which can
INTRODUCTION TO 8051
one serial port, and four ports (8-bit) all on a single chip.
The 8051 has a total of four I/O ports, each 8- bit wide.
chip.
The 8051 became widely popular after Intel allowed
with the 8051. This has led to many versions of the 8051
of the 8051, they are all compatible with the original 8051
you write your program for one, it will run on any one of
- 4K on-chip ROM
- 128 bytes internal RAM (8-bit)
- 32 I/O pins
- Two 16-bit timers
- Six Interrupts
- Serial programming facility
- 40 pin Dual-in-line Package
PIN DESCRIPTION
for the four ports P0, P1, P2, and P3, where each port
GND, XTAL1, XTAL, RST, EA, and PSEN. All these pins
family. The other two pins, PSEN and ALE are used
Vcc
voltage source is +5 V.
GND
XTAL2
C1
XTAL1
GND
oscilloscope.
RST
reset, forcing the CPU to fetch the first code from ROM
PSEN
cycle.
ALE
through port 0 to save pins. The ALE pin is used for de-
pins, making them 8-bit ports. All the ports upon RESET
74LS373.
Port 1
bits.
Port 2
Port 3
Registers
A
B
R0
R1
R2 DPH DPL
R3
R4
R5
DPTR
R6
R7
Program Counter
PC
installed.
address each.
CY AC F0 RS1 RS0 OV -- P
CY PSW.7 Carry flag
purpose
BCD arithmetic.
arithmetic operations.
1. Internal ROM
The 89C51 has a 4K bytes of on-chip
2. Internal RAM
The 1289 bytes of RAM inside the 8051 are
As for four poles, the top and the bottom and either side
are a pair. coil, coil and coil, coil correspond
respectively. For example, coil and coil are put to the
upper and lower pole. coil and coil are rolled up for the
direction of the pole to become opposite when applying an
electric current to the coil and applying an electric current
to the coil. It is similar about and , too.
The turn of the motor is controlled by the electric current
which pours into , , and . The rotor rotational speed
and the direction of the turn can be controlled by this
control.
Clockwise control
, , and are controlled in the following order.
Step
angle
0 1 0 1 0°
1 0 0 1 90°
1 0 1 0 180°
0 1 1 0 270°
1.WWW.ELECTROGUGS.COM
2. WWW.GOOGLE.COM