You are on page 1of 97

"In the name of ALLAH, most Gracious, most Compassionate".

Photo Voltaic Energy System



By

Muhammad Asim Rashid (Reg. # 10D2-310010)
A thesis submitted in partial fulfillment of the requirements for the degree of
B-Tech Electronics (Pass)
Preston University Islamabad
2011

Approved by ____________________________________________________
Chair Person of Supervisory Committee




Date: - 02-09-2011







Preston University Islamabad
Photo Voltaic Energy System

By

Muhammad Asim Rashid (Reg. # 10D2-310010)

A thesis presented on the Design, Operation & Application of Solar/Photovoltaic Power System
for domestic & commercial usage. The thesis covers all aspects of design, charging of Batteries,
inversion into AC Power & supply of power to appliances.
















ACKNOWLEDGEMENT

In the name of Almighty Allah who is most merciful, and who give me strength to write this
study report in a different way.
I extend my heartiest thanks to my seniors, colleagues, and subordinates who assist me on every
occasion to enable me to write this report.
My parents, classmates, friends come next in the list of those whom I have to thank.


















EXECUTIVE SUMMARY
TITLE: A Study Report On Photo Voltaic Energy System.

AUTHORIZATION: This report is a necessary part of B-Tech Electronics (Pass) degree
program.
REOCMMENDATION: Department of Engineering & Technology of the university
advised every student to submit. It was done during the 6
th

semester. The main purpose of this report is review of Technical
knowledge & command on practical grounds.
PROCESS OF REVIEW Practical & on job implementation of green Energy resources such
as Photovoltaic power source.
METHODOLOGY: Design & study of solar powered system using solar voltaic panel
for charging a backup battery & conversion into AC power to use
for normal domestic appliances.
PROBLEMS: Designing of a Solar/Sun tracker for better sunlight supply to solar
panel.
Designing of Battery charge controller.
Designing of a invertor unit to convert the DC voltage in this case
12V into AC voltage 220V AC/50 Hz.
TIME FRAME: All the steps of designing & implementation/study are done during
period of 04 weeks & now are ready to implement in only 08 hrs
duration.















We dedicate this book to our parents...






A pessimist sees the difficulty in every opportunity;
An optimist sees the opportunity in every difficulty.

Winston Churchill



TABLE OF CONTENTS

CHAPTER 1: Introduction ....................................................................................................... 1
Solaris Power ............................................................................................................................... 2
Solar Power Plants....3
Objective & Feasibility.....6
1.1 Block Diagram & Description ........................................................................................... 8
CHAPTER 2: Project Design & Implementation .............................................................. 11
Module Explanation ................................................................................................................... 12
2.1 Tracker ............................................................................................................................. 12
2.2 Charge Controller Board .................................................................................................. 14
2.2.1 Modified Charge Controller Board ........................................................................... 17
2.2.2 PV Regulator ............................................................................................................. 23
2.2.3 AC Charger ............................................................................................................... 27
2.3 Inverter ............................................................................................................................. 28
2.3.1 Methodology ............................................................................................................. 30
2.3.2 Block Diagram .......................................................................................................... 30
2.3.3 PWM Control Circuit ................................................................................................ 32
2.3.4 H-Bridge .................................................................................................................... 38
2.3.5 Half Bridge Converter ............................................................................................... 40
2.3.5.3 Ferrite Core Transformer ................................................................................... 46
2.3.6 Modified Sine-wave Inverter .................................................................................... 54
CHAPTER 3: Accessories ....................................................................................................... 58
3.1 Battery .............................................................................................................................. 59
3.2 Photo Voltaic Cells .......................................................................................................... 61
3.3 Display Panel ................................................................................................................... 63
3.4 PIC Microcontroller ......................................................................................................... 64
CHAPTER 4: Fabrication & Performance Evaluation ................................................... 67
Summary & Summation ............................................................................................................. 68
4.1 Final Designs & Pictures .................................................................................................. 59
4.2 Performance Charts .......................................................................................................... 70
4.2.1 Tracker ...................................................................................................................... 70
4.2.2 PV Regulator ............................................................................................................. 70
4.2.3 Battery Charge Monitoring Board............................................................................. 70
4.2.4 Inverter ...................................................................................................................... 71

4.3 Conclusion ....................................................................................................................... 71


4.4 Cost Analysis ................................................................................................................... 72
APPENDIX A: Firmware ........................................................................................................ 73
APPENDIX B: Transformer Core Datasheets ................................................................... 80
APPENDIX C: Test Points & Troubleshooting ................................................................. 86
APPENDIX D: Software and Instruments .......................................................................... 87
APPENDIX E: References ...................................................................................................... 88

CHAPTER:1
INTRODUCTION

OverviewofSolarEnergy
Currentprojectsoftheworld
ObjectiveoftheSolarisPower
Generaldescription
-2-
CHAPTER 1
Solaris Power
Based on the current scenario presented by the rise in global energy consumption, we
have to face the fact that there is not enough oil in this world left to continue to support
our needs...eventually, our supply will stop and following it, the grinding halt of the
world's economy. Fossil fuels are becoming costly and people are worried as our nation
is so dependent on everyone else, but ourselves. Solar energy is becoming more and more
common as a means to power things that normally run off of electricity. Alternative
energy is starting to become more prominent now, and environmental concern is no
longer for the environmental conservationists. People are starting to wake up and see that
our planet is slowly being destroyed by pollution and lack of responsibility. Prime
examples are the introduction of the fuel cell, solar energy generators, hybrid cars etc.
Future Uses of Solar Energy:
The sun holds a very prominent place in the history of human development, numerous
examples of its precedence in the minds of those before us is evidence of it, even today
this is proving to be the case as of all the sources of renewable energy available to
mankind in its pursuit of a sustainable future, solar power is a pivotal one. Plentiful, free
and absolutely clean, the main challenge to fully tap its huge potential is to harness and
distribute it. We have made considerable progress with solar power, but future uses of
solar energy will be spawned by innovations still to come. At present, solar power is used
in three main ways, that is, to heat air, water and space. Photovoltaic cells are also one of
the most popular forms whereby sun energy is converted into power. According to the
U.S. Department of Energys Energy Efficiency and Renewable Energy arm, there will
be more breakthroughs in new materials, cell designs, and novel approaches to product
development in photovoltaic research and development. Future uses of solar energy could
-3-
include our mode of transportation and even clothing, which will be equipped to produce
clean, safe electric power.
In the future, use of solar energy will be ubiquitous because concentrating solar power
will be fully competitive with conventional power-generating technologies within a
decade. Concentrating solar power, or solar thermal electricity, could harness enough of
the sun's energy to provide large-scale, domestically secure, and environmentally friendly
electricity.
Solar Power Plants:
There are several solar power plants in the Mojave Desert in the US, which supply power
to the electricity grid. Solar Energy Generating Systems (SEGS) is the name given to
nine solar power plants in the Mojave Desert which were built in the 1980s. These plants
have a combined capacity of 354 megawatts (MW) making them the largest solar power
installation in the world.
Solar One and Solar Two (Solar Towers):

Solar towers use many large, computer controlled, sun


tracking mirrors (heliostats) to focus the suns energy on a
receiver located at the top of a tower. A heat transfer fluid, usually molten nitrate salt, is
heated in the receiver and used either to drive a turbine/generator to produce electricity or
to provide high temperature thermal heat. The molten salt can be used to store the
thermal energy for producing electricity at night or during cloudy weather. The U.S.
Department of Energy, and a consortium of U.S. utilities and industry, built the first two
large-scale, demonstration solar power towers in the desert near Barstow, CA.
-4-
Solar One operated
successfully from
1982 to 1988,
proving that power
towers perform
efficiently to produce
utility-scale power
from sunlight. The
Solar One plant used water/steam as the heat-transfer fluid in the receiver; this presented
several problems in terms of storage and continuous turbine operation. To address these
problems, Solar One was upgraded to Solar Two, which operated from 1996 to 1999.
Both systems had the capacity to produce 10 MW of power.
The unique feature of Solar Two was its use of molten salt to capture and store the sun's
heat. The very hot salt was stored and used when needed to produce steam to drive a
turbine/generator that produces electricity. The system operated smoothly through
intermittent clouds and continued generating electricity long into the night.
Solar Electricity Generating Systems:
The trough systems predominate among today's
commercial solar power plants. Nine trough power plants,
called Solar Energy Generating Systems (SEGS), were
built in the 1980s in the Mojave Desert near Barstow by
the Israeli company Luz Industries. These plants have a combined capacity of 354 MW
making them the largest solar power installation in the world. Today they generate
enough electricity to meet the power needs of approximately 500,000 people.

-5-


Sketch of a Parabolic Trough Collector system
Trough systems convert the heat from the sun into electricity. Because of their parabolic
shape, trough collectors can focus the sun at 30-60 times its normal intensity on a
receiver pipe located along the focal line of the trough. Synthetic oil circulates through
the pipe and captures this heat, reaching temperatures of 390 C (735 F). The hot oil is
pumped to a generating station and routed through a heat exchanger to produce steam.
Finally, electricity is produced in a conventional steam turbine. The SEGS plants are
configured as hybrids to operate on natural gas on cloudy days or after dark, and natural
gas provides 25% of the total output.

Solar Technology in Pakistan:
Although solar technology has been in operation since the 1980s however, it has only
come to light in Pakistan in recent years.
Even now its use is only limited to Solar Heaters and DC to DC power generation.


-6-
Objective:
This project has aimed to utilize all available technologies regarding the implementation
of solar power as well as those applied in inverters to produce a fully autonomous
electrical charging system catering to the energy consumption requirements of industries
as well as homes.
The implementation of this project was sought because the current technology available
in Pakistan is Solar DC to DC power conversion whose primary limitation is the
alteration of the appliances operating on AC power. The vendors have designed the new
equipment for the utilization of this converted DC to DC energy.
Therefore, our goal was to devise a system which does not require the alteration of the
appliances installed. Another subsequent advantage of our project is that no such system
exists in Pakistan.
Feasibility:
It provides electricity when and where power is most limited and most expensive, which
is a highly valuable and strategic contribution. Solar electricity mitigates the risk of fuel-
price volatility and improves grid reliability.
While many of the costs of fossil fuels are well known, others (pollution related health
problems, environmental degradation, the impact on national security from relying on
foreign energy sources) are indirect and difficult to calculate. These are traditionally
external to the pricing system, and are thus often referred to as externalities. A corrective
pricing mechanism, such as a carbon tax, could lead to renewable energy, such as solar
thermal power, becoming cheaper to the consumer than fossil fuel based energy.
Also solar
are built a
types of c
lead times
The feasib
survey sho






From the
generation
r thermal po
almost enti
conventiona
s.
bility of su
own below:
above pi-c
n sector of P
ower plants
irely with m
al power pr
uch a system

chart one ca
Pakistan.
-
can general
modular, re
rojects, esp
m in Pakis
an see that
-7-
lly be built
eadily avail
ecially coa
tan is appr

t there is n
in a few ye
lable mater
l and nucle
ropriate as
no share of
ears because
rials. In con
ear plants,
displayed b
solar energ
e solar plant
ntrast, man
require lon
by statistica

gy in powe
ts
ny
ng
al
er
-8-
1.1 Block Diagram:


Figure 1.1

3D CAD Layout of the system:


Figure 1.2

A descript

1.1.1 Phot
Th
semicondu
centimeter
view, the
top surfac
are assemb
in a modu

1.1.2 Trac
It perform

1.1.3 Safe
Th
fed into
combines
safety circ

1.1.4 Cha
Th
of equipm
overcharg
tion of the c
to-Voltaic A
he photovo
uctor cells
rs in size.
cell is basic
e. The cell
bled
le to genera
cker:
ms the solar t
ety & Comb
he pure DC
the combi
all of the p
cuit which s
rge Contro
he charge co
ment utilized
ing of the
critical comp
Array:
oltaic (PV)
(Wafers),
From the
cally a large
converts th
ate required
tracking of
biner Circu
electricity
iner circuit
hoto-voltaic
afeguards f
oller:
ontroller or
d in this pro
batteries w
-
ponents of t
) power
, generally
solid-state
e area p-n d
he sunlight
power.
PV module
uit:
from the ph
t which as
c electricity
from overloa
r regulator
oject; it is n
which can
-9-
the project i
technology
y several
physics po
diode with t
into direct
e to increase
hoto-voltaic
s the nam
y. It also con
ad and over
is a signific
needed to p
be hazard
is provided
y uses
square
oint of
the junction
current elec
e the efficien
c panels is
me implies
nsists on a
r current pot
cant piece
prevent the
dous. Also
below:
n positioned
ctricity. Num
ncy of the s
tential cond
d close to th
merous cell
system.
ditions.
he
ls
proper cha
There are
project are
(a) DC-D
the PV pan
(b) AC-D
unavailabl
be used.
1.1.5 Batt
Th
on the typ
DC energy
inverter.
1.1.6 Inve
Th
consists on
voltages s
will be uti
capable of
1.1.7 Disp
Th
showing m
load cond
as circuit b
arging preve
two types
e:
DC charger (
nels is avail
DC charge
le (due to a
tery Bank:
he battery ba
pe of voltag
y. Also the
erter:
he power i
n a DC-AC
supplied by
ilizable for
f providing
play Panel:
he display
meters, char
ditions. This
breakers, fu
ents any dam
s of charge
(PV Regula
lable.
er, used w
atmospheric
ank consist
ge and curre
ey will supp
inverter is
C converter
y the batter
the electric
output load
panel con
rging sourc
s board also
uses and em
-
mage to the
e controller
ator), used w
when phot
c conditions
ts of several
ent ratings
ply this stor
the heart
circuit whi
ries into A
cal applianc
d up to 1KV
sists on a
e selection,
o contains t
mergency shu
10-
e batteries an
rs being us
when electr
to-voltaic e
s), in the ca
l batteries, d
will be use
red DC pow
of this sy
ich converts
C electricit
ces. And for
VA.

liquid cry
, and overlo
the safety e
utdown butt
nd hence in
ed in this
ricity from
energy is
se of which
depending
ed to store
wer to the
ystem. It
s the DC
ty which
r this projec
ystal displa
oad and und
elements su
ton.
ncreases the
h AC mains
ct the Invert
ay,
der
uch
battery life
s supply wi
ter would b
e.
ll
be


CHAPTER:2
PR0}ECT BESIuN &
INPLENENTATI0N

Design&CircuitLayouts
ModuleOperation
TestingandSimulation
Troubleshooting
CHAPTE

2.1 Track

The tracke
capability
pair of se
sun.
[3]




2.1.1 Circ

It takes in
direction w





Here th

The tra
8-bit m

ER 2
ker:
er here is b
of the syst
ensors for h
cuit Explan
nput from th
with greater
he scan rate
acker is imp
microcontro

being used
tem. This i
horizontal a
nation:
he 2 sensor
r sunlight in








e has been s
plemented u
oller unit.
[8]
-
Module E
to increase
is accompli
and vertical
rs (LDR) &
ntensity.
Figu
set at 30 min
using PIC12
12-
Explanation

e light gath
ished by us
l tracking o
& then take


ure 2.1
nutes.
2F675
n
hering
sing a
of the
es decision
A
to move th
PHOTO
A
he panel in
SENSORS
B
a
2.1.2 Circ

Problem S

The T
panel r
We fo
sensor
Even w
a very
microc
4.8mv

Solution

In order to
than comp
two senso
the other
intensity a
*

Reference

[5
cuit Implem
Statement:
Tracker was
right or left
und that it w
rs.
when almos
y small diffe
controller w
v was sharp
n:
o remove th
paring the o
rs is facing
sensor also
a balanced c
5], [6]

mentation
:
rarely dete
. It was not
was very di
st the same i
erence in th
with 10bits
enough to d
he stated p
output of the
g sufficient l
o faces suffi
condition is
LDR
-
ecting a ba
stopping th
ifficult to a
intensity of
he output vo
output & a
detect this ti
roblems we
e two LDR
light intensi
ficient inten
achieved.
R Voltage R
Figu
13-
lance condi
he motor.
chieve the s
f light was f
oltage (in m
a resolution
iny variatio
e decided to
Rs. In this w
ity it moves
nsity. When
Reference C
ure 2.2
ition i.e. it
same Outpu
falling over
millivolts) th
n of (Vdd
n.
o take an in
way the track
s the panel
both senso
Circuit
was either
ut directly f
the 2 senso
he internal
Vss)/2
n
=
nternal refe
ker checks
in that dire
ors are facin
r moving th
from the tw
rs, there wa
ADC of th
= (5-0)/2
10

erence rathe
if one of th
ection so tha
ng sufficien

he
wo
as
he
=
er
he
at
nt
Implemen

2.2 Charg

Th
voltage ra
Battery Un
Di
typical ap
Diode and
Diodes are
nted PCB o
ge Controll
he circuit fo
ating is 12V
nit will be c
iode D4 is
pplications o
d are differe
e Small Rev
of the Circu
ler Board:
or a Charge
V (variable
connected to
a schottky
of a schott
ent from Sil
verse Recov
-
uit:
Figu
Figu
e Controller
e range up
o their respe
y diode use
ky diode. S
licon Diode
very Period
14-


ure 2.3



ure 2.4

r is rated 6
to 14V). In
ective junct
ed for disch
Schottky D
s. Advantag
d, Faster and
A and batte
n the abov
tions with pr
harge preve
Diodes are m
ges of Scho
d have smal
ery (i.e. to
ve figure, P
roper polari
ention. It is
metal to n-
ottky Diode
ll forward v

be charged
PV Panels &
ities.
s one of th
-type Silico
over Silico
voltage drop

d)
&
he
on
on
p.
-15-
Disadvantage of Schottky diode is that their reverse voltage is very small as compared to
Silicon Diodes which makes them unsuitable for high power applications.
80SQ035/80SQ045 has a breakdown voltage of 50V it means that D4 will withstand a
potential of 50V which is large enough to prevent Batteries from discharging through the
PV panel. This is necessary so that the PV panel does not get damaged.
Transistor T3 turns on when the PV panel voltage is large enough to cross the
potential V
be
of T3 which is typically 0.7V, voltage drop across R9 & the 12V drop
across D6. Here D6 ensures that T3 does not turn on at a voltage below 12V, R9 limits
current through the B-E junction.
IC3 is a 5V voltage regulator which ensures a constant voltage of 5V at its output.
Capacitors C6 & C7 are used to filter the input and output. VR1 is a potentiometer used
to change the Float Voltage Setting i.e. the Depth of Charging. The Temperature Sensor
TM1 (thermistor) modulates the float voltage setting slightly, the full voltage set point
rises in colder temperatures & falls at hot temperatures. Shorting the equalize terminals
J 1 causes the circuit to stay in the charging state, this is useful for occasionally
overcharging (equalizing) a battery.
IC1 has been split up into IC1a & IC1b just to make the schematic clear.
Otherwise both are part of the same IC. IC1a & IC1b are Op-Amps operating as
Comparator. Each Op-Amp produces an output which is the counterpart of the other for
driving the bipolar LED.
Battery Voltages are compared to the float voltage setting by the Op-Amp IC1a &
IC1b. If the battery voltage is less than the float voltage setting then the Red light turns
on and the battery gets charging. Once Battery voltages become equal to the Float
Voltage Setting Green LED glows indicating the battery voltage has reached the floating
-16-
voltage, then the circuit starts oscillating above and below the Float voltage and RED &
GREEN LED glows alternatively.
The opto-coupler OC1 provides electrical isolation to the Output of IC1a & the
Gate of MOSFET T1. It provides optical coupling, & switches on or off depending on the
input. As a signal passes through the pin 1 & pin 2 of OC1 i.e. when the battery is
charging & RED led is glowing the opto-coupler turns on. As soon as the signal through
pin 1 & pin 2 fades away OC1 turns off.
T1 is an Enhancement-Type N-MOS which modulates the Charging Current of
the battery. When there is no input at its gate (OC1 is off due to IC1a output low)
minimum current flows through T1. As the output of IC1a goes high this turns OC1 on &
transistor T1 resistance decreases (Enhancement Mode of MOSFET) causing greater
amount of charging current.
F1 is a 6.0A Fuse to provide protection to the circuit. It breaks if the current goes
above 6.0A. D5 is a Crowbar Diode for safety purpose. If the Battery is inserted in the
reverse position by mistake, i.e. the polarities are not proper then the diode D5 provides a
short part through itself & a 6.0A fuse. Thus prevents other parts of the circuit from
damage. The current Rating of the Diode must be greater than 6.0A so that it does not
burn before the fuse breaks.

Implemented PCB of the Circuit:

Figure 2.5
2.2.1 Mod

Problem S

We tr
compo
desired
Also w
unavai

Solution

A microco






*

Reference

[5
dified Char
Statement:
ried to sim
onents on a
d result cou
we encount
ilable in the
n:
ontroller bas
5], [6], [7]

rge Control
:
mulate the t
a simulatio
uld not be ac
tered a pro
e Market, so
sed charge c
-
ller Board:
test circuit
n software
chieved.
oblem with
o we have d
controlling
Figu
17-
:
of the cha
, however
the 6A Sc
ecided to us
device is m

ure 2.6
arge contro
due to cer
chottky Dio
se a combin
more in tune
oller based
rtain circum
ode which
nation of Sc
with our re
on discret
mstances th
is currentl
chottkys.
equirements
te
he
ly
s.
Descriptio
Th
'brain', the
checking
reference i
P2. Both r
and theref
last bridge
convert th
voltage to
actions.
The differ
require a l
Ini
Re
Re
Re
Ch
Adjustme
To
normal op
voltage cr
intrinsic co
on:
he schemati
e PIC micr
voltages
is centered
resistor brid
fore indepe
e is dedicate
hese three
o the two
rent tasks to
lot of code s
itialize the c
ead the uppe
ead the lowe
ead the actua
heck if TEST
o Do act
ent:
o set the des
peration mo
eates an int
onsumption
ic is divide
rocontroller
through r
on P1; HIG
dges are pow
endent from
ed to the bat
voltages a
references.
o be perform
space, the ta
controller (v
er limit (P1
er limit (P2
al voltage o
T is High in
tions Is th
sired HIGH
ode, the PIC
eraction aro
n of the mod
-
ed in two
and the ot
resistors b
GH reference
wered by re
m the batter
ttery voltag
and compa
The PIC
med by the p
asks preform
variables, po
on GP0)
on GP1)
of the battery
n order to ch
he battery v
voltage ref
C performs
ound the 'sw
dule.
18-
main parts
ther part is
bridges. L
e is centered
egulated 5V
ry voltage.
ge. The PIC
are the bat
will then
program in t
med by the p
orts,)
y (on GP2)
hoose the ad
voltage too l
ference, a te
s actions w
witching' po
the
s for
LOW
d on
Volts
The
will
ttery
take
the PIC are
program are

djustment ro
low?
est mode is
with delays.
int. Moreov
quite simpl
e:
outine or no
used. Why
Modifying
ver, it helps
le and do no
ot.
y? because i
g the batter
to lower th
ot
in
ry
he
-19-
This delay process makes the adjustment process a bit difficult. By putting the TEST
point at +5volt, we inform the PIC to run the adjustment routine, means without delays.
To adjust the reference values:
Set Test point to HIGH to enter adjustment mode.
Use an adjustable power supply ; Connect it in place of the battery.
Set power supply to 10.8 volts. Adjust P1 to get a LOW level on GPIO.4 (pin 3).
Set power supply to 13.8 volts. Adjust P2 to get a LOW level on GPIO.5 (pin
2).This means that the 'Solar Panel' is disconnected above 13.8 volts (or other
reference suitable for our needs)
By varying the power supply voltage, check that :
Between 10.8 and 13.8, GPIO.5 is HIGH and GPIO.4 is HIGH (Solar Panel and
Load connected)
Above 13.8, GPIO.5 is LOW and GPIO.4 is HIGH (Solar Panel disconnected)
When this has been achieved, disconnect test point (TP) from +5 volts to go back to
Normal Mode.
2.2.1.1Problem Faced in Programming:
Problem Statement:
At this step we were unable to achieve the desired output from the controller. The
output of the microcontroller was unpredictable even though we had programmed it.

Observation:
We realized that, there was some problem with the configuration registers. The
HEX file for the source code generated by Microchip was incorrect.

-20-
MPLAB
o Major problem is to configure the registers.
o It changes the register variables after every step, i.e. it reset the values in certian
file registers while in a delay loop.
o Also encountered ADC initializing problem
o If you leave the simulator continue running it doesnt update the variables.
o There are different types of PIC and each uses a different compiler.
o For the PIC12/16 you need a different compiler compared to PIC18,PIC24/30.
After wasting too much of our time on MPLAB we switch to the new tool i.e. MikroC of
Mikroelektronica.
MikroC
Most excellent Features:
o MikroC uses high level approach.
o MikroC covers PIC12/16 and 18.
o MikroC is supposed to have a decent library.
o MikroC provide 'built in functions' which we have no access in MPLAB.
For our programming requirement we finally opted for MikroC
[9]
.
2.2.1.2Final Charge Controller Design:

For the final design we shifted from the 12F675 having 6 I/O pins to the 16F877A which
has 33 I/O pins. Here the decision will be made according to the Present Battery Level.
We also added the Source Selection feature to the design & finally the decisions taken by
the Charge Controller depending on the present conditions (input) is as follows.

-21-
Read battery level and check whether it is in the nominal range i.e. Sufficient
enough to drive the inverter.
If battery level is sufficient enough (present level falls within the nominal range)
then there is no need to charge the battery.
If battery level is insufficient then check which of the source is available for
charging & give the indication for available sources.
Decides whether PV is to be selected for charging or AC from the wall outlet is to
be used for charging depending upon the user input.
Charge the battery until it saturates. But dont over charger it!!!

Charge controller disconnects the charger from battery when the battery voltages
become constant (does not increase further) indicating saturation is achieved & thus
prevents overcharging & extends battery life.

Modifications in Initial Design:
Initially the idea was to have hardware controlled limits; however when using software
controlled limits to control charging, this modification freed up more pins of controller &
enhanced charge controller efficiency.

We merged the AC Charge Controller & DC Charge Controller into a single
microcontroller for a more efficient and compact design; this is also a slight modification
from the initial design.

The battery voltage drops after the charging is turned off & it took some time for the
battery to go back to its new holding voltage, thus we introduced a delay in the code so
that the controller waits for sometime after switching off charging, so that the battery
-22-
voltage stabilizes & then reads the present battery level to make Charging Decision i.e.
either Continue Charging, Indicate Battery Full or Indicate Battery Error.


CIRCUIT SCHEMATIC


Figure 2.7


PCB LAYOUT



*

Reference

[5], [6], [7]

-23-



3D LAYOUT & CIRCUIT


Figure 2.8

2.2.2 PV Regulator:
The voltage levels being obtained from the solar panel are unregulated; to stabilize the
voltages we designed a PV regulator circuit
[4]
. The block diagram is as follows:



Figure 2.9
Configuration
Q1, Q2 & Q5, Q6 are wired in a Darlington pair arrangement.
Q3 & Q4 forms the control circuit. These two transistors are wired in parallel &
the charging current for the battery flows equally through this parallel
combination of transistors.
The amount of current that can pass through the Darlington pair can be calculated by:
-24-










OUTPUT =DESIRED OUTPUT
When no modulation is needed, i.e. the output voltage is equal to input voltage &
there is no error.
The sensing circuit remains OFF, therefore entire current flows though the Q1 &
Q2.
Q1 & Q2 conducts max current & drives Q3 & Q4 into full conduction so that V
ce

is closer to V
ce(sat)
for Q3 & Q4 both.
Thus the output voltage is almost equal to input voltage.
OUTPUT >DESIRED OUTPUT
Once Q5 & Q6 detects error then the current that drives Q1 & Q2, conducts
through Q5 & Q6 too. Thus the entire current is divided between transistors Q1,
Q2 & Q5, Q6.
Thus Q1 & Q2 moves towards cutoff region (away from saturation) as their input
current is decreased.
Which in turn moves Q3 & Q4 away from saturation (towards cutoff), as a
consequence Vce increases & thus output decreases until it becomes equal to
desired voltage setting.
Input current * gain of transistor 1 (hFE1)* current gain of
Th
vo
Ou
On
ent
As
inp
Th
con
des
Th
set
De
Schematic
herefore Q5
ltage setting
utput voltag
nce Q5 & Q
tire current
s a result Q1
put current i
his in turn m
nsequence V
sired voltag
hus Q5 & Q
tting
esired Outpu
c Diagram
& Q6 keep
g.
ge setting ca
OUT
Q6 detect err
flows throu
1 & Q2 mov
is increased
moves Q3 &
Vce decreas
ge setting.
6 keeps mo
ut voltage s
:
-
p monitoring
an be change
TPUT <DE
ror then the
ugh Q1& Q2
ves towards
d.
& Q4 away fr
ses & thus o
onitoring out
etting can b
Figu
25-
g the output
ed through R
ESIRED OU
Q5 & Q6 m
2.
s saturation
from cutoff
output incre
tput and ma
be changed t


ure 2.10
t and mainta
R6.
UTPUT
moves towar
region (awa
region (tow
eases until it
aintains outp
through R6
ain output a
rds cutoff, t
ay from cut
wards saturat
t become eq
put at desire
.
at the desire
thus the
off) as their
tion), as a
qual to
ed voltage

d
r
Implemen


Testing th




First we
circuit v
transforme
unregulate
nted PCB o
he PV Regu
provided
voltages
er, used
ed voltages
of the Circu
ulator:
the PV r
from an
d to
from a PV p
-
uit:

Figu
regulator
auto-
simulate
panel.
26-




ure 2.11


Secondly
controlle
order to
the regu
board.
y we co
er board wi
test the co
ulator as w
onnected
th the PV
ontrolling c
well as th


the charg
regulator, i
capability o
he controlle
ge
in
of
er

2.2.3 AC C
Here the m
is to provi
accordingl
be control

The block






Circuit D





Simulatio


Charger:
main supply
ide chargin
ly with the
led and mon
k diagram is
iagram:
on Result:
y source wil
g when the
size of the
nitored by t
as follows:
220VAC
50Hz
-
ll be from K
e sunlight is
battery
[13]
.
the microco
:
Figu
RECT
27-
KESC. The p
s unavailabl
The chargin
ontroller.
ure 2.12

TIFIER
primary pur
le. Current
ng ON/OFF
CONTROL
CIRCUIT
rpose of the
requiremen
F time and v


BATT
e AC charge
nt is adjuste
voltages wi
TERY
er
ed
ill
-28-

Figure 2.13

2.3 Inverter:
Power inverters are devices which can convert electrical energy of DC form into AC.
[14]
They come in all shapes and sizes, from low power functions such as powering a car
radio to that of backing up a building in case of power outage. Inverters can come in
many different varieties, differing in price, power, efficiency and purpose. The purpose
of a DC/AC power inverter is typically to take DC power supplied by a battery, such as a
12 volt car battery, and transform it into a 220 volt AC power source operating at 60Hz,
emulating the power available at an ordinary household electrical outlet.

Figure provides an idea of what a small power inverter looks like. Power inverters are
used today for many tasks like powering appliances in a car such as cell phones, radios
and televisions. They also come in handy for consumers who own camping vehicles,
boats and at construction sites where an electric grid may not be as accessible to hook
-29-
into. Inverters allow the user to provide AC power in areas where only batteries can be
made available, allowing portability and freeing the user of long power cords.

On the market today are two different types of power inverters, modified sine wave and
pure sine wave generators. These inverters differ in their outputs, providing varying
levels of efficiency and distortion that can affect electronic devices in different ways.

A modified sine wave is similar to a square wave but instead has a stepping look to it
that relates more in shape to a sine wave. This can be seen in Figure 2.14, which displays
how a modified sine wave tries to emulate the sine wave itself. The waveform is easy to
produce because it is just the product of switching between 3 values at set frequencies,
thereby leaving out the more complicated circuitry needed for a pure sine wave. The
modified sine wave inverter provides a cheap and easy solution to powering devices that
need AC power. It does have some drawbacks as not all devices work properly on a
modified sine wave, products such as computers and medical equipment are not resistant
to the distortion of the signal and must be run on a pure sine wave power source.



Figure 2.14

-30-
2.3.1 Methodology

The construction of the pure sine wave inverter can be complex when thought of as a
whole but when broken up into smaller projects and divisions it becomes a much easier
to manage project. The following sections detail each specific part of the project as well
as how each section is constructed and interacts with other blocks to result in the
production of a 220 volt pure sine wave power inverter
[16]
.

2.3.2 Block Diagram

Analog circuitry, as well as discrete components, a MOSFET drive integrated circuit and
a low pass filter is all that is necessary to generate a 60Hz, 220V AC sine wave across a
load. The block diagram shown in figure shows the varying parts of the project that will
be addressed.
The control circuit is comprised of three basic blocks, the 6.0V reference, sine wave
generator and triangle wave generator; when these blocks are implemented with
comparators and other small analog circuitry they control the PWM signals that the two
MOSFET drivers will send. The PWM signals are fed into these MOSFET drivers that
perform level translation to drive four N-Channel MOSFETs in an H-Bridge
configuration.
From here the signal is sent through a low pass LC filter so that the output delivers a pure
sine wave. The specific operation, construction, and resulting output waveforms for each
block will be discussed in detail in the following sections.



The block






2.3.2.1 Flo

























k diagram is
ow Diagram
PWM
DCAC
INVERTER
SINEPW
CONTROL
CIRCUI
FULLBRID
INVERTE
LOWPASSF
220VAC6
OUTPU
as follows:
m
M&SIGNALL
12
R
WM
LLER
T
DGE
ER
FILTER
60Hz
T
-
:
Figu
LING
VDCINPUTFRO
Figur
31-

ure 2.15
OMBATTERY
re 2.16
CO
OUTPUTDRI
DCDC
ONVERTER
PWMCONTR
CIRCUIT
HALFBRIDG
CONVERTER
HIGH
FREQUENCY
TRANSFORM
IVER
R
OL
GE
R
Y
ER


2.3.3 PWM

Th
signal ove
to achieve
modifying
obtain:

M Control
he top pictu
erlaid. The b
e the PWM
g the triangl
Circuit
ure shows t
bottom pictu
M waveform
le wave. If
-
Figu
the input re
ure shows t
m. The sine
these wave
32-


ure 2.17



eference wa
the signals w
e reference
eforms are
aveform, an
which are p
is included
passed into


nd the gene
assed into a
d to show t
o a compara
erated PWM
a comparato
the result o
ator, we wi
M
or
of
ll
-33-
PWM H-BRIDGE CONTROL SIGNAL
Now, using an H-Bridge MOSFET
configuration, and utilizing both the above
PWM signal and the square wave generated, we
can obtain:
This is the final signal if filtered the Sine
Output will arrive.



Sine Wave Generator:
The first step to creating an accurate pulse width modulation signal using analog
circuitry is to construct an accurate representation of the signal. Therefore an oscillator
was needed to produce a stable 60Hz sine wave that had little distortion so that the output
could be as accurate as possible. A Bubba oscillator was chosen as the means to
produce this signal because of its ability to produce a stable sine wave that contains very
little distortion. The circuitry and values chosen are shown in Figure and the
[10]
op-amp
chip chosen to complete the task was an LM348 as it is an inexpensive part and meets all
the requirements of creating this sine wave.

Figure 2.18


-34-
Results:



60Hz Sine wave was achieved.

Carrier Wave Generator:

Generating a sine wave at 60Hz requires both the reference sine wave and a carrier wave
at the switching speed of the power supply. Carrier waves can be either saw-tooth or
triangular signals; in this case, a triangular wave is used. The generation of the triangular
carrier wave has been done with analog components. The circuit for the construction of
the triangle wave generator consists of a square wave generator and integrator
[10]
, as
shown in Figure 2.19.











Figure 2.19
-35-

The above circuit will oscillate at a frequency of 1/4RtC, and the amplitude can
be controlled by the amplitude of R1 and R2. R
t
=150K VR, R1=8.2K & R2=1.5M VR,
and C=0.1uF, this circuit generates square and triangle waves.

Results:




Problem Statement:
Difficulties with this circuit were mainly caused by the operational amplifier
selected in its design. The square and triangle waves may be skewed due to the op-amps
inability to reach output rails. Also, if the frequency is too high for the op-amp to handle,
the square wave will be skewed and the triangle wave will be noticeably clipped or
distorted.
We have used 9 ICs for generating the required signals. The behavior of discrete
component is sometimes unpredictable and again in the PWM output we get the result as
show in the oscilloscope output. The output signals are not very clean PWM pulses; this
is due to the op-amp behavior towards high frequency.


Solution:

As the re
work we h
Op-amp b
the XR
generator
Now after
circuit be
the pulses
driving the

P
medy of p
have to conv
based circ
R-2206 Fu
IC.
r implement
elow we ac
s which wo
e MOSFET
Previous out
revious
vert the
uits to
unction
ting the
chieved
ould be
T Driver IC I
tput from Op
-
IR-2110.

p-Amps.
36-
OOutput of XRR-2206 bas
(Figure

ed PWM.
e 2.20)
-37-

Complete circuit of PWM:

-38-
2.3.4 H-Bridge

Generating a sine wave centered on zero volts requires both a positive and negative
voltage across the load, for the positive and negative parts of the wave, respectively. This
can be achieved from a single source through the use of four MOSFET switches arranged
in an H-Bridge configuration. To minimize power losses and utilize higher switching
speeds, N-Channel MOSFETs were chosen as switches in the bridge. Level translation
between PWM signals and voltages required to forward bias high side N-Channel
MOSFETS, the IR2110 MOSFET driver integrated circuit was chosen. A diagram of the
H-Bridge circuit with MOSFETS and drivers is shown in the figure below:


Figure 2.21

The IR2110 High and Low Side Drive device exceeds all requirements for driving the
MOSFETs in the bridge. It is capable of up to 500V at a current rating of 2A at fast
switching speeds. This device is required to drive the high side MOSFETS in the circuit
designated HO, due to the fact that the gate to source voltage must be higher than the
drain to source voltage, which is the highest voltage in the system. This device utilizes a
bootstrapping capacitor to maintain a voltage difference of approximately 10V above the
drain to source voltage. With a full bridge configuration, two of these devices are
utilized, as shown in the above figure. A typical connection of a single IR2110 device is
shown in Figure.
-39-




Operation of the IR2110 device will be controlled through generated PWM signals. The
PWM signals will be fed to the HIN and LIN pins simultaneously. If the internal logic
detects a logic high, the HO pin will be driven; if a logic low is detected, the LO pin will
be driven. The SD pin controls shut down of the device and will be unused and tied to the
ground. Additional pins that require external connections are the Vss pin which will also
be tied to the ground, the V
cc
pin which will be tied to 12V, pins requiring connections to
Boot-strapping components and outputs to the MOSFETS.

Driving four MOSFETs in an H-Bridge configuration allows +350, 350, or 0 volts across
the load at any time. To utilize PWM signals and this technology, the left and right sides
of the bridge will be driven by different signals. The MOSFET driver on the left side of
the bridge will receive a square wave of 60Hz, and the right side will receive the 50KHz
PWM signal. The 60Hz square wave will control the polarity of the output sine wave,
while the PWM signal will control the amplitude. The MOSFETs to be used in the design
are the IRFB20N50KPbF (IRF740) Hexfet Power MOSFET, rated for 500V at 20A with
an R
ds
of 0.21ohm.


-40-
The implemented PCB:






Overall Circuit diagram of PWM & Output Control Circuit:



Figure 2.22


2.3.5 Half Bridge Converter:
A schematic of the half-bridge converter is shown in Figure 2.23. The major components
of the half-bridge converter are the two transistors, which are illustrated in the figure. The
purpose of the half-bridge converter is to chop up the 12 VDC supplied by a battery so
that an alternating current is seen by the transformer. The red and blue paths have been
added to figure to illustrate the switching technique used to create and alternating current
from direc
the transfo
When the
toggled,
forced in
the blu
producing
waveform
that contr
are comp
half-bridg
never be
time and th
The transi
IRFZ44 di


Why to us



* Reference [1
ct current. T
ormer when
e transistor
the curre
the directi
e path,
g an
m. Since the
rol the tran
plimentary,
e transistor
on at the
he process r
istors select
issipated the
se Push-Pu
5]
The red path
n the upper t
rs are
ent is
ion of
thus
AC
pulses
nsistors
both
rs will
same
repeats 100
ted for the h
e least amou
ull techniqu
-
h shows tha
transistor is
0,000 times p
half-bridge
unt of heat
ue?
41-
at current is
open and th
per second.
were IRFZ
for long dur

s forced acr
he lower tra

Z44 by Inte
rations of o
ross the prim
ansistor is c
rnational R
operation.
Figu
mary side o
losed.
Rectifier. Th

ure 2.23
of
he
-42-


2.3.5.1 Half Bridge Converter Implementation:
TheTL494wasselected;ashortdescriptionoftheICisgivenbelow:

The schematic diagram of circuit is given below:













Figure 2.24












-43-
Now the TL494 circuit was interfaced with transformer of rating; Input =15+0+15 Volt
AC, Output=220VAC and current of 2A.




The results:




-44-
Problem Statement:
From the above oscilloscope output we can see the output is not pure Square output,
although the amplitude was about 155VAC.

2.3.5.2 Solution for the TL494 Circuit:
Now we used the SG3525 module; the short description of IC is as follows:








Figure 2.25

-45-


Figure 2.26




Now we got the 60Hz (16.67msec) Square outputs with an rms value of 211VAC.
Problem Statement:

The output was about 190VAC on load; however
the shape of the output waveform was neither
MODIFIED
CIRCUIT
AMPLITUDE
300Vpp
-46-
Sine nor Square. It has a peak value for few microseconds and then it decrease with
manydumpingsignals.
Observation:

From above simulation we noticed that the core gets saturated after 3040 minutes.
Andthevoltagestartsdecreasingby35voltsperminute.

Conclusion:

Therefore, we decided to wind a Ferrite-Core transformer to rectify the load current
problem.


2.3.5.3 Ferrite Core Transformer
The term ferrite core may refer to a core used to build an electric transformer; there are
two kinds of core (nucleous) applications following the size and frequencies, one for
signal transformers and the other for power transformers.
The ferrite cores used for power transformers are working in the range of low frequencies
(1 to 50KHz usually) and are quiet big size, can either be toroidal, shell or C shaped and
are useful in all kind of switching electronic device (especially power supplies from 1W
to 100W maximum because usually powerful applications are out of range of ferritic
single core and require grain oriented lamination cores).
The ferrite cores used for signal have a range of applications from 1KHz to many MHz
perhaps up to 300, and found its main application in electronics.
Ferrite is a class of ceramic material with useful electromagnetic properties and an
interesting history. Ferrite is rigid and brittle. Like other ceramics, ferrite can chip and
break if handled roughly. Luckily it is not as fragile as porcelain and often such chips and
cracks will be merely cosmetic. Ferrite varies from silver gray to black in color. The
-47-
electromagnetic properties of ferrite materials can be affected by operating conditions
such as temperature, pressure, field strength, frequency and time.
There are basically two varieties of ferrite: soft and hard. This is not a tactile quality but
rather a magnetic characteristic. 'Soft ferrite' does not retain significant magnetization
whereas 'hard ferrite' magnetization is considered permanent. Fair-Rite ferrite materials
are of the 'soft' variety.
Ferrite has a cubic crystalline structure with the chemical formula MO.Fe
2
O
3
where
Fe
2
O
3
is iron oxide and MO refers to a combination of two or more divalent metal (i.e:
zinc, nickel, manganese and copper) oxides. The addition of such metal oxides in various
amounts allows the creation of many different materials whose properties can be tailored
for a variety of uses.
Ferrite components are pressed from a powdered precursor and then sintered (fired) in a
kiln. The mechanical and electromagnetic properties of the ferrite are heavily affected by
the sintering process which is time-temperature-atmosphere dependent.
Ferrite shrinks when sintered. Depending on the specific ferrite, this shrinkage can range
from 10% to 17% in each dimension. Thus the unfired component's volume may be as
much as 60% larger than the sintered value. Maintaining correct dimensional tolerances
as well as the prevention of cracking related to this shrinkage are fundamental concerns
of the manufacturing process.



*

Reference

[17], [18], [19], [20]


-48-
Types of Ferrite Cores:
Magnetics cores can be divided
into many types of
categories. This discussion will
divide magnetic cores into two
major categories, structure (shape)
and material. These major core
categories will then be sub-divided
into additional categories. This
includes; various standard types
of core with bobbin structures
(E, EP, EFD, EC, ETD, PQ, POT, U and others), toroids, and some custom designs.


Transformer Formulae & Calculations:


ETD-49:

A
p
= w
ucu
A
c
= 2.11cm
2
- 2.71cm
2
= S.72cm
4


A
p
=
p - 1u
4
k - - B
m
- [ - K
w


P = 2S14.21SS wott
B
m
=
P - 1u
4
A
p
- k - - [ - K
w
= u.1u1

-49-
B = 1 Icslo = 1u
4
0omo = 1wbm
2

Prim Iurns = I
n
- _
turns
:olt
] = 1.S
Scc Iurns =
N
p
- I
s
I
p
= Su
N =
I - 1u
8
4 - - A
c
- B - F
F = 1 (Squorc wo:c)
= 1uukEz => 1uuuwotts
A
c
= 211mm
2
= 2.11cm
2

w
ucu
= 271mm
2
= 2.71cm
2

B = 9uu 0ouss
N =
I - 1u
8
4 - - A
c
- B

Input Winding =16#AWG
Output Winding =14#AWG
w
A
- A
c
=
P
o
- C - 1u
8
4 - c - B - - k

k = u.S, c = 8u%
w
A
- A
c
= S.71
1
wb
m
2
, = 1u
4
0ouss
1
1u
4
wb
m
2
, = 1 0ouss
1
1u
4
- 9uu
wb
m
2
, = 9uu 0ouss
244 - 1u
-3

wb
m
2
,
1
1u
wb
m
2
, = 1 0ouss
For Details of Symbols & Constants, Refer to the Appendix B Page # 73
-50-
ETD-44:

= 2SkEz
w
ucu
= 21Smm
2
= 2.1Scm
2

A
p
= 17Smm
2
= 1.7Scm
2

A
p
= w
ucu
A
c
= 2.1Scm
2
- 1.7Scm
2
= S.684cm
4


A
p
=
p - 1u
4
k - - B
m
- [ - K
w

w
ucu
A
c
=
p
o
- C - 1u
3
4 - c - k - - B


Iurns
:olt
=
1
B
m
- - k
1
- A
c
- 1u
-4
,
; N
p
= I
n
(
Iurns
:olt) ;
,
N
s
=
N
p
(
I
I
, )
_

C = currcnt copocity = S.u7 - 1u
-3 cm
2
Amp
,
P = 4Suwott
k = u.S winJing Foctor
c = cicicncy = 8u%
B = .
w
A
- A
c
= S.684cm
4

S.684 = 4Su(S.u7 - 1u
-3
) -
1u
8
4
- u.8 - B - 2Sk - u.S
B
m
=
u.22 - 1u
8
4 - u.8 - B - 2Sk - u.S
= 248.820ouss
k
1
= 4 (Fig 14.2)
B = 248.82 Icslo
For

Designing
The first p
market th
ferrite-cor
ferrite-cor
cores, how
core manu
cores, dow
with the m

Details of S
g a Transfo
problem in m
ere is no d
res in Pakist
res, and fina
wever these
ufacturers w
wnloaded th
mechanical d

Symbols &
ormer Base
making the
data availab
tan. Now ou
ally after ma
were witho
websites, an
he pictures
data. The co
-
& Constants
ed on Calcu
ferrite core
ble for the
ur first chal
any days of
out any spec
nd we dow
and we co
ores we hav
51-
s, Refer to t
ulations:
e transform
ferrite core
llenge was
f searching,
cifications o
wnloaded the
ompared the
ve now are E
the Append
er is the co
es, also it i
to search th
we finally
or data. We
e datasheets
e features o
ETD-44 and
dix B Pag
re. Unfortu
is very diff
he whole m
got two siz
browsed th
s of their m
of cores tha
d ETD-49.


ge # 70
unately in th
ficult to fin
market for th
zes of ferrite
hrough man
manufacture
at we bough
he
nd
he
e-
ny
ed
ht

The Wind

Now from
W
A
=2.71c
From our
Turns/volt
As compa

It is now c
ding Result
m the datashe
cm
2
, B=900
calculation
t=0.1173,
ared with the
confirmed th
ts:
eets and cat
0 Gauss, V
we got:
Primary T
e results fro
hat our calc
-
Figu
talog charts
in
=12V,
Turns=1.45T
om an online
culations are
52-



ure 2.27

the Core E
f=100KHz
T,
e calculator
e on cue.
ETD-49 valu
z, V
out
=4
Secon
r:

ues are:
400V
ndary Turns=

=56T.
-53-

Testing the design:


Figure 2.28

AC voltage at the output are varying due to the output frequency of 4.51 KHz, however,
the digital meters that we have are operating at a less approximation speed. We rectified
the output and measured the DC voltage for first three transformers using an analog
meter, and the results were very shocking. The DC voltages were more than 800VDC. As
for the forth one, which was designed for 400V we got 300VDC as shown in the above
picture. And the output waveform is on the right picture.
Problem Statement:
Output of transformer in terms of voltage is ok but when a capacitor is connected to
smooth the output, the transformer starts to generate noise and voltage drops to 20-
30VDC. While searching through different forums on the internet we found that for
primary side Strip wire of the same width of the Bobbin is used for winding however,
this is unavailable in Pakistan, so we tried to use copper sheet of same thickness but still
failed to achieve the desired output. And one more critical factor of Ferrite core winding
is the type of core, of which three types are available namely, F-Type, R-Type and P-
Type. The component vendors in Pakistan do not have any data related to the type of
materials being used.
Conclusio
After work
output. An
towards th
However,
as near as

2.3.6 Mod
Now for te
The Resu
The no lo
238VAC
load of 20
the volta
about 1
happened,
current of
was insuf
this amoun
on:
king for 3 w
nd after se
he square
the theme
possible to
dified Sine-
est bases we
lt:
oad voltages
and whe
00W was a
age droppe
188VAC.
, because
f the transf
fficient to
nt of load. H
weeks on th
eeking the a
wave inver
of impleme
the Sine wa
-wave Inver
e implemen
s were
n the
applied
ed to
This
e the
former
drive
Hence the v
-
his part of o
advice of o
rter based
enting the sq
ave using L
rter
nted SG3525
Figu
voltage decr
54-
our project,
our internal
on the con
quare wave
LC Filters at
5 based inve
ure 2.29

eases as a r
we were u
l advisor w
nventional
e inverter w
t the output
erter circuit

esult.
[21]
unable to ge
we shifted o
iron core
was to modif
of inverter.
t operating a
et the desire
our attentio
transformer
fy the outpu
.
at 60Hz.
ed
on
r.
ut
2.3.6.1 Im
The reason
to set the
by the mic
cutoff con
as follows
The Filter
The outpu
values are





mplementin
n of using a
parameters
crocontrolle
ndition
[11]
fo
s; Input 12 +
r Design:
ut low-pass
as follows:
g the Inver
a PIC micro
s according
er to drive t
for the safety
+0 +12 VA
LC Filter w
:
-
rter using P
ocontroller w
to our requ
the Push-Pu
y of the sys
AC, Output
Figu
was design
55-
PIC Microc
was to cont
uirements. T
ull MOSFET
stem. And th
220 +240 +
ure 2.30
ned using on
controller:
trol the circ
The up-dow
Ts. Circuit
he transform
+260 VAC
nline calcul
uit more ef
wn pulses a
also holds
mer used he
C at current o
lator and th
fficiently an
are generate
the overloa
ere has ratin
of 7A.
he calculate


nd
ed
ad
ng

ed
The P-Spi
The violet
resulting w
also increa
ice Simulat
t line indica
waveform a
ased due to
tion of Filte
ates the squ
after passin
the energiz
-
er:
Figu
uare output f
ng through t
zing of the in
56-
ure 2.31
from the tra
the low-pas
nductor coil
ansformer a
ss LC Filter
ls.
and the gree
r. And the
en line is th
amplitude i


he
is


CHAPTER:3
ACCESSORIES

Battery
PVPanel
16X2LCDModule
PICMicrocontroller
CHAPTE


3.1 Batter
The batter
constant 1
General S
Charging
The charg
Hour
The charg
nickel-bas
time of a
batteries).
can be red
or lithium-
It takes ab
to discharg
ER 3
ry
ry in our p
2VDC from
Sizes of Ava
g Rate:
ing rate is d
rs of Charge
ge algorithm
sed chemist
sealed lea
With highe
duced to 10
-based syste
bout 5 times
ge. On nick
project is b
m the charge
ailable Batt
determined b
e =(Ah Rat
m for lead-
tries in that
d-acid batte
er charge cu
hours or les
ems.
s as long to
kel-based ba
-
Acce
asically the
e controller
teries:
Tab
by the follo
ting x % of
acid batteri
voltage rat
ery is 12-1
urrents and
ss. Lead-aci
o recharge a
atteries, this
59-
essories
e heart of o
, and it prov
ble 3.1
owing formu
Charge Nee

ies is simil
ther than cu
6 hours (u
d multi-stage
id cannot be
a lead-acid b
ratio is 1:1
our backup
vides input t
ula,
eded x 1.25
ar to lithiu
urrent limiti
up to 36 ho
e charge m
e fully charg
battery to th
, and rough
system. It
to the inver
) / Charger
um-ion but
ing is used.
ours for lar
methods, the
ged as quick
he same lev
hly 1:2 on li
t is fed wit
rter.
Setting
differs from
. The charg
rger capacit
charge tim
kly as nicke
vel as it doe
thium-ion.
th

m
ge
ty
me
el
es
Battery ra
12VDC, 8
With suffi
accurate S
polarizatio
not to men
Do and do
Each batte
The Do an
each batte

-
Used in
Charging
atings:
85Ah ,18Pla
icient rest a
SoC estimat
on. If conne
ntion freque
ont battery
ery has uniq
nd dont ba
ry type.
Nickel-ca
(NiC
Two-way ra
power tools
medical.
Do run the
fully down
month; try
all energy b
charging.

Do not leav
in charger
than 2 days
of memory

Avoid getti
battery too
during char

Charge me
Constant cu
followed by
charge whe
Fast-charge
preferred o
charge.
Slow charg
Rapid charg
Fast charge
ate Phoenix
and stable te
tion for lead
ected in a s
ent starting a
y table:
que needs t
attery table
admium
Cd)
adios,
s,
S
N
battery
once per
to use up
before
ve battery
for more
s because
.
ng
o hot
rge.
thods:
urrent,
y trickle
en full.
e
over slow
e = 16h
ge = 3h
e = 1h+
D
fu
ev
O
a

D
in
th
of

A
to
ch


C
C
fo
ch
S
re
B
w
ch
R
Fa
-
x Brand Lea
emperature,
d acid batte
ystem, such
and driving
Tab
that must be
summarize
Nickel-meta
hydride (NiM
imilar applicat
NiCd; higher de
Do run the batte
ully down once
very 3 months
Over-cycling is
dvised.
Do not leave ba
n charger for m
han 2 days bec
f memory.
Avoid getting ba
oo hot during
harge.
Charge methods
Constant curren
ollowed by trick
harge when fu
low charge not
ecommended.
attery will get
warm towards f
harge.
Rapid charge =
ast charge = 1
60-
ad Acid Batt
, voltage m
eries. It is im
h as in a ca
g.
ble 3.2
e met to ob
es these nee
al-
MH)
ion as
ensity.
Cell p
video
ery

s.
not
attery
more
cause
attery
s:
nt,
kle
ll.
t


full
3h
1h+
Do ch
often.
longe
rather
discha

Do no
hot du
Check

Charg
Const
4.20V
trickle
full. L
in the
memo
remai
charg

Rapid
tery is used
easurement
mportant th
ar, there are
btain reliabl
eds and adv
Lithium-ion
(Li-ion)
hones, laptops
cameras.
harge the batte
. The battery la
r with partial
r than full
arges.
ot use if pack g
uring charge.
k also charger.
ge methods:
tant voltage to
V/cell (typical).
e-charge when
Li-ion may rema
e charger (no
ory). Battery m
n cool. No fast
e possible.
charge = 3h
BCIStand
ofa12Vl
d in the syste
ts provide a
hat the batte
e steady aux
le service a
vises proper
Le
(Seale
s, Motorcy
wheelch
ery
asts
gets


No

ain
must
t-
Do char
immedi
use. Lea
always
charged
The bat
longer w
rather t
discharg
cycling

Charge
Constan
2.40/ce
followed
at 2.25V
Battery
cool. Fa
possible
on float

Slow ch
Rapid c
dardforSoC
eadacidcar
em.
an amazingl
ery is free o
xiliary loads
and long life
r handling o
ead-acid
ed or flooded)
ycles, cars,
hairs, UPS.
rge the battery
ately after
ad-acid must
be kept in a
d condition.
ttery lasts
with partial
than full
ges. Over-
is not advised.
methods:
nt voltage to
ell (typical),
d by float held
V/cell.
must remain
ast charge not
e; can remain
t charge.
harge = 14h
harge = 10h
estimation
rbattery.
ly
of
s,

e.
of
)
y
.

Discharging
Service
needs
Storage
Disposal
3.2 Photo
A solar ce
solar cell
energy in
Photovolta
to the ap
Sometime
energy fro
unspecifie
Assemblie
photovolta
Solar cells
such as
electricity
unavailabl
g Full cycle d
harm NiCd.
NiCd is one
most hardy
durable che
Discharge t
every 1 to
to prevent
Do not disc
before each
Best to sto
charge in a
place. Open
voltage can
determine
charge. 5 y
longer stor
possible. Pr
battery if s
longer than
months.
Do not disp
contains to
metals; mu
recycled.
Voltaic Ce
ell, made fro
or photovol
nto electrica
aic is the fi
pplication
es the term
om sunligh
ed.
es of cells
aic arrays.
s have many
electronic
, particular
le such as
does not
.
e of the
y and
emistries.
A
cy
w
d
N
en
N
of
to 1V/cell
2 months
memory.
charge
h charge.
D
ev
p
D
b
re at 40%
a cool
n terminal
nnot
state-of-
years and
age
rime
tored
n 6
S
in
te
ca
st
P
st
m
pose;
oxic
ust be
S
Lo
h
b
ells
om a mono
ltaic cell is
al energy b
eld of techn
of solar c
solar cell
ht, while th
are used to
y applicatio
calculators
rly useful i
in remote
-
Avoid too many
ycles because
wear. Use 80%
epth-of-discha
NiMH has highe
nergy density
NiCd at the exp
f shorter cycle
Discharge to 1V
very 3 months
revent memory
Do not discharg
efore each cha
tore at 40% ch
n a cool place.
erminal voltage
annot determin
tate-of-charge
rime battery if
tored longer th
months.
hould be recyc
ow volume
ousehold NiMH
e disposed.
Tab
ocrystalline
a device th
by the pho
nology and
cells as so
is reserved
he term ph
o make sola
ons. Individ
. Photovolt
in situation
area power
61-
y full
of

rge.
r
than
ense
life.
Avoid
becau
depth
recom
charg
Avoid
Low v
off sa
V/cell
s to
y.
ge
arge
No ma
neede
due to
used o
harge
Open
e
ne
.
f
han 6
Store
a cool
state-
3.75-
open
Do no
charg
tempe
of acc
cled.
H may
Shoul
Low v
Li-ion
ble 3.3
silicon waf
hat converts
otovoltaic e
research re
olar energy
d for device
hotovoltaic
ar modules
dual cells ar
taic arrays
ns where e
r systems, E
full cycle
use of wear. 80
-of-discharge
mmended. Re-
e more often.
full discharge.
voltage may cu
fety circuit
aintenance
ed. Loses capac
o aging whethe
or not.
at 40% charge
l place (40%
-of-charge read
3.80V/cell at
terminal.
ot store at full
e and at warm
eratures becau
celerated aging
d be recycled.
volume househ
may be dispos
fer. A
s light
effect.
elated
y.
[1]

es intended
cell is use
s, which ma
re used for p
generate
electrical po
Earth-orbiti
0%
.
t
Avoid fu
because
80% de
discharg
more of
larger b
Low ene
limits le
wheeled
city
er
Apply to
every 6
Occasio
charge
perform
e in
ds
m
use
g.
Store a
state-of
not stor
2.10V/c
topping
6 month

old
sed
Do not
be recy
specifically
ed when th
ay in turn b
powering sm
a form of
ower from
ing satellite
ull cycle
e of wear. Use
epth-of-
ge. Recharge
ften or use
battery.
ergy density
ead-acid to
d applications
opping charge
months.
onal discharge/
may improve
mance.
lways at a full
f-charge. Do
re below
cell; apply
charge every
hs.
dispose; must
cled.
y to captur
he source i
be linked i
mall device
f renewabl
the grid i
es and spac


/


re
is
in
es
le
is
ce
probes, re
is also incr
PV panel





*

Reference

[2

mote radiot
reasingly de
ratings:
2]

telephones
eployed in g
-
and water p
grid-tied ele
62-
pumping ap
ectrical syst
pplications.
tems.
Photovolta aic electricitty


3.3 Displa
The displ
modules o
16 x 2 Alp
Int
com
61
5 x
Ca
Lo
Po
TT
Co
The displa





ay Panel
lay panel c
of 16 x 2 lin
phanumeri
telligent, w
mpatible LC
x 15.8 mm
x 7 dot matr
an display 2
ow power co
owerful com
TL and CMO
onnector for
ay outputs a
ON
consists of
nes.
c LCD Mo
with built
CD controll
m viewing ar
rix format fo
24 different
onsumption
mmand set an
OS compati
r standard 0
are as follow
.
N O
MO
INVERTER
-
Liquid Cr
dule Featu
t-in Hitach
ler and RAM
rea
for 2.96 x 5.
t symbols
n (1 mA typi
nd user-pro
ible
.1-pitch pin
ws:
FF
ODESELECT
63-
rystal Disp
ures
hi HD447
M providing
56 mm char
ical)
oduced chara
n headers
.
PV
TION
CHARGIN
lay
780
g simple int
racters, plus
acters
AC
NG
terfacing
s cursor line e

-64-
3.4 PIC Microcontroller
Introduction:
The microcontroller is a very common component in modern electronic systems. Its use
is so widespread that it is almost impossible to work in electronics without coming across
it.
Microcontrollers are used in a wide number of electronic systems such as:
Engine management systems in automobiles.
Keyboard of a PC.
Electronic measurement instruments (such as digital multimeters,
frequency synthesizers, and oscilloscopes)
Printers.
Mobile phones.
Televisions, radios, CD players, tape recording equipment.
Hearing aids.
Security alarm systems, fire alarm systems, and building services systems.

What is a microprocessor?
The microprocessor is the integration of a number of useful functions into a single IC
package. These functions are:
The ability to execute a stored set of instructions to carry out user defined
tasks.
The ability to be able to access external memory chips to both read and
write data from and to the memory.
-65-
What is a microcontroller?
Basically, a microcontroller is a device which integrates a number of the components of a
microprocessor system onto a single microchip.

The PIC Microcontroller:
PIC stands for Peripheral Interface Controller. The original PIC was designed to be a
Peripheral Interface Controller for 6502 microcontroller from Rockwell late 70s.

Why did we choose Microchip PIC Family of Microcontrollers?
Free development softwares MPLAB IDE and Mikro C.
Low cost development hardware.
Devices are easy to obtain through distributors and can be sampled.
A wide range of devices are available with varying feature sets.
Microchip is in continuous development of new PIC devices.
Has a large Internet based development community (piclist.com).

-66-
The Architecture of 16F877:
The architecture of 16F877 has wide range of built-in modules so that no need for
external hardware components.

Figure 3.1
Supporting Hardware:

PIC Test bench for code checking. PIC Programmer.


CHAPTER:4
FABRICATION&
PERFORMANCE
EVALUATION

SystemWiringDiagrams
ModularPerformanceCharts
CostAnalysis
Conclusion
-68-
CHAPTER 4
Fabrication & Performance Evaluation

4.1 Final Designs & Pictures

Complete wiring layout between various modules of the system.

Figure 4.1

The true scaled CAD layout based on the above wiring diagram:



Finished M

Modules

-

69-
-70-
4.2 Performance Charts
4.2.1 Tracker

Name Design Constraints Results Pass / Fail
Tracking Horizontal Tracking Controlled Tracking Pass
Scan rate 30 minutes
Designed
Programmable
Pass
Sensitivity
Tracker should be stable &
parallel to Sun
Approx 50mV
sensitivity
Pass
Efficiency >90% >95% Pass

Table 4.1

4.2.2 PV Regulator

Name Design Constraints Results Pass / Fail
Variable
Input
Up to 36 Volts Achieved Pass
Regulated
Output
Desired level
(Set Externally)
O/P deflection is
only 400mV
Pass
Charging
Current
Provide constant 6A Designed for 10A Pass
Regulation
Efficiency
>90% Achieved Pass
Temperature Not more than 50
o
C
Operating
temperature is 45
o
C
Pass
Size Should be compact 97mm * 100mm Pass

Table 4.2

4.2.3 Battery Charge Monitoring Board

Name Design Constraints Results Pass / Fail
Controller
Based
Intelligent Charging
PIC based
monitored charging
Pass
Indications Display all conditions 8 Status LEDs Pass
Modes User defined
Multiple source
selection
Pass
Cutoff
Status
Low & full battery
conditions
Limits achieved Pass
Size Should be compact 110mm * 130mm Pass
Efficiency >90% >95% Pass

Table 4.3

-71-
4.2.4 Inverter

Name Design Constraints Results Pass / Fail
Voltage
Convert 12VDC to
220VAC
12VDC to 220VAC
50Hz
Pass
Power
Provide 850VA continuous
power
>900VA Pass
Waveform Pure 50Hz Sine wave Modified Sine Fail
Output
Stage
MOSFET based Achieved Pass
Control
Circuit
Microcontroller based PIC microcontroller Pass
Transformer Ferrite Core
Iron core
transformer used
due to unavailability
of ferrite core.
--
Size Should be compact 115mm * 200mm Pass
Table 4.4

4.3 Conclusion:
As you can see from the information above most of the more important design constraints were
met. The packaged product did convert 12VDC to a 220VAC, 50 Hz. Some of the more
aggressive constraints were however not met. We were unable to produce a pure sine wave. Even
though, we have designed the PWM circuitry for the Sine wave generation, however for the
failure of the ferrite core transformer phase of the project, we feel that this constraint was set
pretty aggressively without enough knowledge of the availability of the data and the categorized
core itself. We feel that while this constraint was a failure that it is an acceptable failure. The
packaged unit size was efficiently controlled by using the CAD tools. The overall efficiency of
the entire system is 85% which is appreciable on the research and testing level. In the end our
project stands as a fully functional finished product ready to be marketed.

Future Improvement:
With the proper implementation of ferrite core transformers the efficiency, weight
reduction and the pure sine wave output can be achieved. If one is able to find the
respective data and specifications of the ferrite core and its materials.
-72-
4.4 Cost Analysis

Part Name Cost (Rs.)
Tracker
i. PV Panel
ii. Drive & Mechanical Stand
iii. Circuit

20,000
10,000
150
Charge Controller
i. BCM Circuit
ii. PV Regulator
iii. AC Charger

200
650
850
Battery 5,500
Box 2,000
Inverter
i. Ferrite Cores
ii. Winding Wires
iii. Circuit
iv. Transformer (Iron Core)
v. MOSFETS

500
750
350
1,500
450
Miscellaneous
i. Development Boards
ii. Programmer
iii. LCD
iv. Heat Sinks
v. Fans
vi. Relays
vii. Function Generator ICs
viii. Mix ICs
ix. PCBs
a) Tracker
b) PV Regulator
c) Display Board
d) BCM
e) Inverter
f) Relay Control Board
x. Connectors
xi. Wires
xii. Switches & Fuses
xiii. Components Damaged During
Testing
a) MOSFETS
b) ICs

120
50
230
400
600
450
900
600

70
150
100
200
250
150
300
700
650


900
230
Total Cost 49,950

Table 4.5

Our estimated cost was Rs.75,000; however we have been able to complete the project in
under Rs.50,000, this cost reduction has been quite an achievement for us.

APPENDICES

Firmware
TransformerCoreDatasheets
ListofTestPointsTroubleshooting
Software&Instruments
References
-74-
APPENDIX A: FIRMWARE

BATTERY MONITORING BOARD

voi d Bf check( ) ; / / Checks whet her Bat t er y i s
f ul l or needs t o be char ged
voi d Sr cCheck( ) ; / / Checks Avai l abl e Sour ce &
gi ve I ndi cat i on on LED
voi d CC( ) ; / / DC Char ger
voi d BC( ) ; / / AC Char ger
i nt bat t =0, bn=0, pv=0, i =0, j =0;
voi d mai n( )
{
OPTI ON_REG = 2; / / Pr escal er 1: 8
ADCON0 = 1; ADCON0. 0 = ADON = 1;
ADCON1 = 132; / / AN0 t o AN4 Anal og, AN5 t o
AN7 Di gi t al , ADC Cl ock = Fosc/ 2, Ri ght J ust i f i ed
TRI SA = 0xFF; / / Por t A/ RA = I nput
TRI SB = 0; PORTB/ RB = Out put ;
PORTB = 0; / / Reset PORTB
TRI SC = 0; / / PORTC/ RC = Out put
PORTC = 0; / / Reset PORTC
Bf check( ) ; / / I ndi cat es i f bat t er y i s
f ul l or needa t o be char ged
Sr cCheck( ) ; / / I ndi cat es Avai l abl e
Sour ces
PORTB. f 4 = 1; / / I ndi cat es Sour ce
Sel ect i on I nput Needed
del ay_ms( 2000) ; / / Wai t f or i nput
PORTB. f 4 = 0; / / Reset Sour ce Sel ect i on
I ndi cat i on
i f ( PORTA. f 5==0) / / I f Swi t ch Pr essed
{ / / Swi t ch Debounci ng
del ay_ms( 1000) ;
i f ( PORTA. f 5==0)
{
PORTB. f 2 = 1; / / I ndi cat es DC Char ger
PORTB. f 3 = 0; / / I ndi cat es AC Char ger
J umps t o DC Char ger ;
}
el se i f ( PORTA. f 5==1)
{
PORTB. f 2 = 0; / / I ndi cat es DC Char ger
PORTB. f 3 = 1; / / I ndi cat es AC Char ger
BC( ) ; J umps t o AC Char ger ; ;
}
}

voi d bf check( )
{
bat t = ADC_Read( 1) ; / / Read Bat t er y
i f ( bat t >= 690) / / I f Bat t er y i s i n
{ / / Nomi nal Range t hen
hang: PORTB. f 7 = 1; / / I NDI CATE BATTERY FULL
got o hang; / / LOOP BACK ( HANG)
}
el se
-75-
PORTB. f 7 = 0; / / I ndi cat es Bat t er y not
f ul l y char ged
}

voi d Sr cCheck( )
{
pv = ADC_Read( 0) ; / / Read PV
i f ( pv >= 700) / / I f PV = 3. 42v i s
suf f i ci ent
{
PORTB. f 5 = 1; / / PV Avai l abl e I ndi cat i on
}
el se
{
PORTB. f 5 = 0; / / PV not avai l abl e
}

voi d CC( )
{
OPTI ON_REG = 2; / / Pr escal er 1: 8
ADCON0 = 1; / / ADCON0. 0 = ADON =
1
ADCON1 = 130; / / AN0 t o AN4 Anal og,
AN5 t o AN7 Di gi t al , ADC Cl ock = Fosc/ 2, Ri ght J ust i f i ed
TRI SA = 0xFF; / / Por t A/ RA = I nput
TRI SB = 0; / / Por t B/ RB = Out put
TRI SC = 0; / / Por t B/ RB = Out put
PORTC = 0; / / Reset Out put Por t
bat t = ADC_Read( 1) ;
del ay_ms( 1) ; / / Acqui si t i on Ti me
pv = ADC_Read( 0) ;
del ay_ms( 1) ;
whi l e ( pv > 700)
{
PORTB. f 7 = 1; / / Bat t er y Ful l
I ndi cat i on
whi l e( bat t < 690) / / I f bat t er y i s not i n
nomi nal r ange
{
char ge1: PORTB. f 7 = 0; / / Bat t er y not f ul l
PORTC. f 0 = 1; / / Tur n DC Char ger RELAY ON
PORTB. f 1 = 1; / / Char gi ng I NDI CATI ON
f or ( i =0; i <600 ; i ++) / / Wai t f or 30 mi nut es
{
del ay_ms( 3000) ;
}
PORTB. f 1 = 0; / / Char gi ng I NDI CATI ON OFF
PORTC. f 0 = 0; / / DC Char ger RELAY OFF
f or ( j =0; j <60 ; j - - ) / / wai t f or 3 mi nut es
{ / / so t hat bat t er y vol t age
st abi l i se
del ay_ms( 300) ;
}
bn = ADC_Read( 1) ; / / Read Bat t er y l evel af t er
bei ng char ged f or " i " mi nut es
del ay_ms( 1) ;
i f ( bat t < bn) / / i f bat t er y vol t age r i ses
{
bat t = bn; / / st or e new bat t er y l evel
-76-
got o char ge1; / / l oop back
}
el se / / i f bat t er y vol t age not
r i si ng
i f ( bn > 685) / / i f bat t er y i s i n nomi nal
r ange
{
got o bf ul l 1; / / bat t er y f ul l
}
el se / / bat t er y not i n nomi nal
r ange
{
got o er r or 1; / / er r or i ndi cat i on
}
bf ul l 1: PORTB. f 7 = 1; / / BATTERY FULL LED
PORTC. f 0 = 0; / / DC CHARGER RELAY OFF
whi l e( 1) ; / / HANG I NDEFI NI TELY
er r or 1: PORTB. f 7 = 0; / / BATTERY FULL LED
PORTC. f 0 = 0; / / DC CHARGER RELAY OFF
PORTB. f 0 = 1; / / ERROR LED
whi l e( 1) ; / / HANG I NDEFI NI TELY
}

}

voi d BC( )
{
OPTI ON_REG = 2; / / Pr escal er 1: 8
ADCON0 = 1; / / ADCON0. 0 = ADON = 1
ADCON1 = 130; / / AN0 t o AN4 Anal og,
AN5 t o AN7 Di gi t al , ADC Cl ock = Fosc/ 2, Ri ght J ust i f i ed
TRI SA = 0xFF; / / Por t A/ RA = I nput
TRI SB = 0; / / Por t B/ RB = Out put
bat t = ADC_Read( 10) ;
del ay_Us( 2000) ;
PORTA. f 7 = 1; / / BATTERY FULL
whi l e( bat t < 690) 645 = 3. 068vol t == 11. 19v;
{
char ge: PORTB. f 7 = 0; / / BATTERY FULL
PORTC. f 1 = 1; / / AC CHARGER RELAY
PORTB. f 1 = 1; / / CHARGI NG I NDI CATI ON
f or ( i =0; i <600 ; i ++) / / WAI T FOR 30mi nut es
{
del ay_ms( 3000) ;
}
PORTB. f 1 = 0; / / CHARGI NG LED
PORTC. f 1 = 0; / / AC CHARGER RELAY
f or ( j =0; j <60 ; j ++) / / WAI T 3mi nut es
{
del ay_ms( 3000) ;
}
bn = ADC_Read( 1) ;
del ay_ms( 1) ;
i f ( bat t < bn) / / I F BATTERY VOLTAGE RI SI NG
{
bat t = bn; / / UPDATE CURRENT BATTERY
LEVEL
got o char ge; / / LOOP BACK
}
-77-
el se
i f ( bn > 685) 3. 34vol t s == 0;
{
got o bf ul l ; / / J UMP TO BATTERY FULL
}
el se
{
er r or ; / / J UMP TO ERROR
}
bf ul l : PORTB. f 7 = 1; / / BATTERY FULL
PORTC. f 1 = 0; / / AC CHARGER RELAY OFF
whi l e( 1) ;
er r or : PORTB. f 7 = 0; / / BATTERY FULL
PORTC. f 1 = 0; / / AC CHARGER RELAY OFF
PORTB. f 0 = 1; / / ERROR LED
whi l e( 1) ;
}
}

TRACKER

i nt l ef t , r i ght ;
voi d mai n( )
{
OPTI ON_REG = 2; Pr escal er 1: 8;
ADCON0 = 1; ADCON0. 0 = ADON = 1;
ADCON1 = 128; / / AN0 t o AN4 Anal og, AN5 t o
AN7 Di gi t al , ADC Cl ock = Fosc/ 2, Ri ght J ust i f i ed
TRI SA = 0xFF; / / Por t A/ RA = I nput
TRI SB = 0; PORTB/ RB = Out put ;
PORTB = 0; / / Reset PORTB
whi l e( 1)
{
l ef t = ADC_Read( 0) ;
Del ay_ms( 100) ;
r i ght = ADC_Read( 1) ;
Del ay_ms( 100) ;
i f ( l ef t > 500 && r i ght < 500)
{
PORTB. f 7 = 1; / / LEFT PI N
PORTB. f 6 = 0; / / RI GHT PI N
PORTB. f 5 = 0;
Del ay_ms( 5000) ;
PORTB. f 7 = 0;
}
el se i f ( r i ght > 500 && l ef t < 500)
{
PORTB. f 7 = 0; / / LEFT PI N
PORTB. f 6 = 1; / / RI GHT PI N
PORTB. f 5 = 0;
Del ay_ms( 5000) ;
PORTB. f 6 = 0;
}
el se
{
PORTB. f 7 = 0; / / LEFT PI N
PORTB. f 6 = 0; / / RI GHT PI N
PORTB. f 5 = 1;
-78-
del ay_ms( 20000) ;
PORTB. f 5 = 0;
}
}

DISPLAY BOARD

DEVI CE : PI C16F877A
CLOCK : 12MHz
HS
RS = C. 4 , R/ W= C. 5 , En = C. 6 , Dat a Bus = D. 7 t o D. 0
Lcd8_I ni t ( *por t ct r l , *por t dat a) ;
E ? ct r l por t . 6
RS ? ct r l por t . 4
R/ W ? ct r l por t . 5

D7 ? dat apor t . 7
D6 ? dat apor t . 6
D5 ? dat apor t . 5
D4 ? dat apor t . 4
D3 ? dat apor t . 3
D2 ? dat apor t . 2
D1 ? dat apor t . 1
D0 ? dat apor t . 0

voi d mai n( )
{
i nt i np, m, bf ul l ; / / i np St or es t he val ue at PORTE ( Sw
I nput )
m= 0; / / mst or es t he cur r ent mode
sel ect i on
TRI SA = 63; / / Di gi t al I nput s
TRI SB = 0; / / LED
TRI SC = 0; / / PORTC i s out put ( Ct r l Por t - LCD)
TRI SD = 0; / / PORTD i s out put ( Dat a Bus - LCD)
/ / TRI SE = 7; / / PORTE i s i nput ( Keypad)
ADCON1= 7; / / Al l i nput s ar e Di gi t al
PORTC = 0; / / Reset PORTC
PORTD = 0; / / Reset PORTD
Lcd8_I ni t ( &PORTC, &PORTD) ; / / I ni t i al i ze LCD at PORTC and
PORTD
Lcd8_Out ( 1, 7, " TI E" ) ; / / Pr i nt t ext on LCD
Lcd8_Out ( 2, 5, " SOLARI S" ) ;
m: Del ay_ms( 2000) ;
Lcd8_Cmd( LCD_TURN_OFF) ;
Del ay_ms( 200) ;
Lcd8_Cmd( LCD_TURN_ON) ;
PORTB = 0;
bf ul l = PORTA. f 0;
Lcd8_Cmd( LCD_CLEAR) ;
i f ( bf ul l ==1)

PORTB. f 4 = 1;
PORTB. f 3 = 0;
Lcd8_Cmd( LCD_CLEAR) ;
Lcd8_Out ( 1, 7, " I NV?" ) ;
Lcd8_Out ( 2, 5, " Pr ess YES" ) ;
Lcd8_Cmd( LCD_BLI NK_CURSOR_ON) ;
-79-
b1: Del ay_ms( 1000) ;
i np = PORTA. f 5;
i f ( i np==1)
{
PORTB. f 7 = 1;
got o i nvr ;
}
el se
got o b1;

el se
{
PORTB. f 4 = 0;
PORTB. f 3 = 1;
Lcd8_Cmd( LCD_CLEAR) ;
Lcd8_Out ( 1, 7, " CHRG?" ) ;
Lcd8_Out ( 2, 5, " Pr ess YES" ) ;
Lcd8_Cmd( LCD_BLI NK_CURSOR_ON) ;
b2: Del ay_ms( 1000) ;
i np = PORTA. f 5;
i f ( i np==1)
{
PORTB. f 0 = 1;
got o chr g;
}
el se
got o b2;
}
i nvr : Lcd8_Cmd( LCD_CLEAR) ;
Lcd8_Cmd( LCD_TURN_OFF) ;
Del ay_ms( 200) ;
Lcd8_Cmd( LCD_TURN_ON) ;
Lcd8_Out ( 1, 6, " I NV- ON" ) ;
whi l e( bf ul l ==1)
bf ul l = PORTA. f 0;
Del ay_ms( 3000) ;
PORTB. f 7 = 0;
Lcd8_Out ( 1, 6, " I NV- OFF" ) ;
PORTB. f 3 = 1; / / Bat t er y Low I ndi cat i on
PORTB. f 4 = 0;
got o m;
chr g: Lcd8_Cmd( LCD_CLEAR) ;
Lcd8_Cmd( LCD_TURN_OFF) ;
Del ay_ms( 200) ;
Lcd8_Cmd( LCD_TURN_ON) ;
Lcd8_Out ( 1, 6, " CHRG- ON" ) ;
whi l e( bf ul l ==0)
bf ul l = PORTA. f 0;
Del ay_ms( 3000) ;
PORTB. f 0 = 0;
Lcd8_Out ( 1, 6, " CHRG- OFF" ) ;
PORTB. f 4 = 1; / / Bat t er y Ful l I ndi cat i on
PORTB. f 3 = 0;
got o m;
}
-86-
APPENDIX C: LIST OF TEST POINTS - TROUBLESHOOTING








Sr # TOPIC PAGE #
1. Tracker Voltage Reference Circuit 13
2. Charge Controller Board (12F675) 17
3. Programming Issues 19
4. Battery Charge Monitor 22
5. PV Regulator 26
6. AC Charger 28
7. Sine Wave Bubba Oscillator 33
8. Carrier Wave Generator 34
9. TL494 Based Half-Bridge Converter 42
10. SG3525 Based Half-Bridge Converter 44
11. Ferrite Core Transformer Testing 46
12. SG3525 Based Mod-Sine Inverter 54
13. PIC Inverter 56

-80-
APPENDIX B: TRANSFORMER DATASHEETS









-81-









-82-









-83-











-84-










-85-









-87-
APPENDIX D: SOFTWARE & INSTRUMENTS


SOFTWARES:

o PIC Simulator IDE
o MPLab IDE
o Mikro C
o Win Prog
o AutoCad
o OrCad 9.2
o Circuit Design Suite
o Target 3001
o PCB Artist

EQUIPMENTS:


TEKTRONIX 2213

SUNWA CD-800

DMM - 3302

YF-150 CAPACITANCE METER

FUNCTION GENERATOR 4415

TEKTRONIX 2445B

ALL-11 UNIVERSAL PROGRAMMER

LODESTAR FREQUENCY COUNTER

LODESTAR AVO METER

XELTEX SUPER PRO L+

TEKTRONIX TAS 465

SOLDERING STATION

-88-
APPENDIX E: REFERENCES


Books & Research Papers


[1] Home Power Magazines, 2007 Feb, J une & November +2008 August.
[2] Single Phase Grid connected PV System Mr. Chainon Chaisook, 2002.
[3] Solar Tracker EC476, Spring 2005 by Toby Peterson & J eff Valane.
[4] Introduction to Power Electronics by Denis Fewson, Chapter 2 & 4.
[5] PIC Microcontroller Datasheets from www.microchip.com.
[6] IEEE Workshop on PIC microcontroller presented by Andrew & Tim, 16 J an, 2000.
[7] Microchip Embedded control handbook updated 2000.
[8] Microchip tips & tricks 8-bit flash microcontroller, 2003.
[9] Mikro C user manual, 2006.
[10] AN106, Op-Amp Applications Analog Devices by J ames Wong.
[11] Current overload protection for inverter, USS4410935 Oct 18, 1983.
[12] MCU-based non-inverting buck-boost converter for battery chargers.AN2389 ST.

[13] Single Stage battery charger with PFC by Ningliang Mi Curtis Instruments Inc.
[14] DC-AC Isolated battery inverter. Application note AN9611 Feb, 2003.
[15] NI LM5030 Push-Pull Converter Design Notes by Michele Sclocchi.
[16] NASA Technical Notes PWM Static Inverter by Francis Gourash Feb, 1970.
[17] HF Power inductor design by Dr. Ray Ridley, Ridley Engineering March 2007.
[18] Wurth Elektronik Transformer Cookbook.
[19] Magnetics Power Design, Section 4.0. www.magnetics.com
[20] Designing Coil & transformer by M.C.Sharma Ch#14 Page:193.
[21] Losses in transformer winding by Llyod H. Dixon.

-89-


Websites

o www.precision-inc.com
o www.wa4dsy.net/filter
o www.piclist.com
o www.mikroelektronika.com
o www.irf.com
o www.semikron.com
o www.datasheetcatalog.com
o www.educypedia.be
o www.aaroncake.net
o www.scribd.com

You might also like