Professional Documents
Culture Documents
Microcontroller Based Solar Charger: in Partial Fulfillment of The Requirements For The Award of The Degree of
Microcontroller Based Solar Charger: in Partial Fulfillment of The Requirements For The Award of The Degree of
- 11021431
- 11021430
- 11021429
- 11021432
SNGIST
CERTIFICATE
Guide
HOD
Internal Examiner
External Examiner
Date:
Date:
SNGIST
iii
Microcontroller Based Solar Charger
ACKNOWLEDGEMENT
SNGIST
iv
Microcontroller Based Solar Charger
ABSTRACT
As the sources of conventional energy deplete day by day, resorting to alternative sources of
energy like solar and wind energy has become need of the hour.
Solar-powered lighting systems are already available in rural as well as urban areas. These
include solar lanterns, solar home lighting systems, solar streetlights, solar garden lights and
solar power packs. All of them consist of four components: solar photovoltaic module,
rechargeable battery, solar charge controller and load.
In the solar-powered lighting system, the solar charge controller plays an important role as
the systems overall success depends mainly on it. It is considered as an indispensable link
between the solar panel, battery and load.
The microcontroller-based solar charge controller described here has the following features:
SNGIST
v
Microcontroller Based Solar Charger
CONTENTS
SL NO.
TOPIC NAME
PAGE NO.
INTRODUCTION
BLOCK DIAGRAM
11
12
MICRO CONTROLLER
13
3.1
14
3.2
16
3.3
17
LCD DISPLAY
25
PIN DESCRIPTION
25
2.1
4
4.1
27
SOLAR PANELS
30
RECHARGEABLE BATTERY
34
CHARGING&DISCHARGING
34
CIRCUIT DIAGRAM
36
37
7.1
8
8.1
PROGRAM CODING
38
10
41
11
SOFTWARES USED
47
12
APPENDICES
50
13
ADVANTAGES
72
14
CONCLUSION
73
15
REFERENCE
74
SNGIST
vi
Microcontroller Based Solar Charger
LIST OF TABLES
TABLE
NO:
TABLE NAME
PAGE
NO:
18
19
21
22
26
SNGIST
vii
Microcontroller Based Solar Charger
LIST OF FIGURES
FIGURE NAME
FIG
NO:
PAGE
NO:
BLOCK DIAGRAM
11
BLOCKDIAGRAMOF PICMICROCONTROLLER
16
17
26
28
29
33
SOLAR PANEL
33
34
10
35
11
CIRCUIT DIAGRAM
36
12
PCB LAYOUT
46
13
48
SNGIST
viii
Microcontroller Based Solar Charger
LIST OF ABBREVIATIONS
SNGIST
CHAPTER: 1
INTRODUCTION
As the sources of conventional energy deplete day by day, resorting to alternative sources of energy like
solar and wind energy has become need of the hour.
Solar-powered lighting systems are already available in rural as well as urban areas. These include solar
lanterns, solar home lighting systems, solar streetlights, solar garden lights and solar power packs. All of
them consist of four components: solar photovoltaic module, rechargeable battery, solar charge controller
and load.
In the solar-powered lighting system, the solar charge controller plays an important role as the systems
overall success depends mainly on it. It is considered as an indispensable link between the solar panel,
battery and load.
The microcontroller-based solar charge controller described here has the following features:
SNGIST
10
Solar panel: The solar panel used here is meant to charge a 12V battery and the wattage can range from 3 to
40 watts. The peak unloaded voltage output of the solar panel will be around 19 volts. Higher-wattage
panels can be used with some modifications to the controller unit.
Rechargeable battery: The solar energy is converted into electrical energy and stored in a 12V lead-acid
battery. The ampere-hour capacity ranges from 5 Ah to 100 Ah.
Charge control: Relay RL1 connects the solar panel to the battery through diode D1. Under normal
conditions, it allows the charging current from the panel to flow into the battery. When the battery is at full
charge (12.0V), the charging current becomes pulsed. To keep the overall current consumption of the solar
controller low, normally-closed (N/C) contacts of the relay are used and the relay is normally in deenergised state.
Load control: One terminal of the load is connected to the battery through a relay. This relay will control
the load providing. That is if the resistance of load is below 3ohms(high current) then the relay get energised
and cut off the load.
SNGIST
11
CHAPTER : 2
BLOCK DIAGRAM
Figure1:block diagram.
SNGIST
12
SNGIST
13
CHAPTER : 3
MICRO CONTROLLER
A microcontroller is a computer-on-a-chip, or, preferably, a single-chip computer. Micro
suggests that the device is small, and controller tells you that the device might be used to control
objects, processes, or events. Another term to describe a microcontroller is embedded controller,
because the microcontroller and its support circuits are often built into, or embedded in, the devices
they control.
Microcontrollers are found in all kinds of things these days. Any device that measures, stores,
controls, calculates, or displays information is a candidate for putting a microcontroller inside. The
largest single use for microcontrollers is in automobilesjust about every car manufactured today
includes at least one microcontroller for engine control, and often more to control additional systems in
the car. In desktop computers, you can find microcontrollers inside keyboards, modems, printers, and
other peripherals. In test equipment, microcontrollers make it easy to add features such as the ability to
store measurements, to create and store user routines, and to display messages and waveforms.
Consumer products that use microcontrollers include cameras, video recorders, compact-disk players,
and ovens. And these are just a few examples.
SNGIST
14
PIC micro controllers are low-cost computers-in-a-chip; they allow electronics designers
and hobbyists add intelligence and functions that mimic big computers for almost any electronic
product or project.
The programming of the system is done using a PIC micro controller 16F877. This powerful (200
nanosecond instruction execution) yet easy-to-program (only 35 single word instructions) CMOS
FLASH-based 8-bit micro controller packs Microchip's powerful PIC architecture into a 40-pin
package and is upwards compatible with the PIC16C5X, PIC12CXXX and PIC16C7X devices. It is
has five ports. I.e. port A, port B, port C, port D, port E. The PIC 16F877 has flash memory of 8K and
Data memory of 368 bytes Data EEPROM of 256 bytes.The micro-controller used for our project
isMicrochips PIC16F877A.
SNGIST
15
Oscillator Start-up Timer (OST)
Watchdog Timer (WDT) with its own on-chip RC
oscillator for reliable operation
Programmable code protection
Power saving SLEEP mode
Selectable oscillator options
Peripheral Features:
Timer0: 8-bit timer/counter with 8-bit prescaler
Timer1: 16-bit timer/counter with prescaler,
can be incremented during SLEEP via external
crystal/clock
Timer2: 8-bit timer/counter with 8-bit period
register, prescaler and postscaler
Two Capture, Compare, PWM modules
- Capture is 16-bit, max. resolution is 12.5 ns
- Compare is 16-bit, max. resolution is 200 ns
- PWM max. resolution is 10-bit
SNGIST
16
Speed
Interrupt Control
Inbuilt Modules
3.2)BlockDiagramof PICMicroController
SNGIST
17
SNGIST
18
PIN NAME
DIP
PIN #
PLCCP
IN #
I/O/O
BUFFER
TYPE
DESCRIPTION
Q
FP
St/cmos
Osc.crystal
i/p. osc.crystal
o/p
Master clear
i/p or program
o/p.
Port A is bi
directional i/p
.
30
Osc/clkin
13
14
TYPE
1
Osc/clkout
14
15
MCLR/Vpp
i/p
St
RA0/AN0
I/O
TTL
RA1/AN1
I/O
TTL
RA2/AN2/VREF-
I/O
TTL
21
RA3/AN3/VREF+
I/O
TTL
22
RA4/TOCK1
I/O
SL
23
RA5/SS/AN4
RB0/INT
7
33
8
36
I/O
I/O
TTL
TTL/ST1
24
8
RB1
34
37
I/O
TTL
RB2
35
38
I/O
TTL
RB3/PGM
36
39
I/O
TTL
RB4
37
41
I/O
TTL
14
RB5
38
42
I/O
TTL
15
RB6/PGC
39
43
I/O
TTL/ST2
16
RB7/PGD
40
44
I/O
TTL/ST2
17
Port B is a bi
directional i/o
port. Port b
can be s/w
pgmed for
pull up on
31
18
19
20
9
10
11
SNGIST
19
Input/output ports
PIC16F877 has 5 basic input/output ports. They are usually denoted by PORT A (R A), PORT B (RB), PORT C
(RC), PORT D (RD), and PORT E (RE). These ports are used for input/ output interfacing. In this controller,
PORT A is only 6 bits wide (RA-0 to RA-7), PORT B , PORT C,PORT D are only 8 bits wide (RB-0 to
RB-7,RC-0 to RC-7,RD-0 to RD-7), PORT E has only 3 bit wide (RE-0 to RE-7).
PORT-A
RA-0 to RA-5
6 bit wide
PORT-B
RB-0 to RB-7
8 bit wide
PORT-C
RC-0 to RC-7
8 bit wide
PORT-D
RD-0 to RD-7
8 bit wide
PORT-E
RE-0 to RE-2
3 bit wid
All these ports are bi-directional. The direction of the port is controlled by using TRIS(X) registers (TRIS A used
to set the direction of PORT-A, TRIS B used to set the direction for PORT-B, etc.). Setting a TRIS(X) bit 1
will set the corresponding PORT(X) bit as input. Clearing a TRIS(X) bit 0 will set the corresponding PORT(X)
bit as output.
(If we want to set PORT A as an input, just set TRIS(A) bit to logical 1 and want to set PORT B as an output,
just set the PORT B bits to logical 0.)
Other Pins:
o Analog input port (AN0 TO AN7) : these ports are used for interfacing analog inputs.
o TX and RX: These are the USART transmission and reception ports.
o SCK: these pins are used for giving synchronous serial clock input.
o SCL: these pins act as an output for both SPI and I2C modes.
o DT: these are synchronous data terminals.
o CK: synchronous clock input.
o SD0: SPI data output (SPI Mode).
o SD1: SPI Data input (SPI mode).
Electronics and Communication Engineering Department
SNGIST
20
o SDA: data input/output in I2C Mode.
o CCP1 and CCP2: these are capture/compare/PWM modules.
o OSC1: oscillator input/external clock.
o OSC2: oscillator output/clock out.
o MCLR: master clear pin (Active low reset).
o Vpp: programming voltage input.
o THV: High voltage test mode controlling.
o Vref (+/-): reference voltage.
o SS: Slave select for the synchronous serial port.
o T0CK1: clock input to TIMER 0.
o T1OSO: Timer 1 oscillator output.
o T1OS1: Timer 1 oscillator input.
o T1CK1: clock input to Timer 1.
o PGD: Serial programming data.
o PGC: serial programming clock.
o PGM: Low Voltage Programming input.
o INT: external interrupt.
o RD: Read control for parallel slave port.
o CS: Select control for parallel slave.
o PSP0 to PSP7: Parallel slave port.
o VDD: positive supply for logic and input pins.
VSS: Ground reference for logic and input/output pins.
SNGIST
21
Tbl 4:specifications of the PIC 16F87X Series
SNGIST
22
BANK
RP1:RP0
00
01
10
11
0
1
2
3
Each bank extends up to 7Fh (128bits). The lower location of each banks are
Reserved for the special function registers. About the special function registers are
general purpose registers, implemented as the static RAM. All implemented banks
contain special function registers .Some frequently used special function register from 1
bank may be mirrored in another bank for code reduction and quicker access.
SNGIST
23
ADCS ADCS
1
0
CHS
2
CHS
1
CHS
0
R/W-0
GO/DONE
U-0
------
R/W-0
ADCON
ADCON1 REGISTER
U-0
U-0
R/W-0 U-0
R/W-0
ADF
M
R/W-0
R/W-0
R/W-0
PCF
PCF
PCF
PCF
G3
G2
G1
G0
SNGIST
24
USART
This mode is usually used to communicate in 8-bit ASCII code. It has two pins
for transmittion and reception.Transmittion begins whenever data is written to SBUF.
USART is an acronym for universal synchronous asynchronous receiver and
transmitter.
Control Register Of Transmittion (Txsta)
CS
RC
TX
9
TxEN
SYNC
BRGH
TRMT
Tx9D
Rx
9
SRE
N
CRE
N
ADDE
N
FER
R
OER
R
SNGIST
Rx9
D
25
CHAPTER: 4
LCD DISPLAY
A liquid-crystal display (LCD) is a flat panel display, electronic visual display, or
video display that uses the light modulating properties of liquid crystals. Liquid crystals
do not emit light directly. LCDs are available to display arbitrary images (as in a
general-purpose computer display) or fixed images which can be displayed or hidden,
such as preset words, digits, and 7-segment displays as in a digital clock. They use the
same basic technology, except that arbitrary images are made up of a large number of
small pixels, while other displays have larger elements.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In
this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers,
namely, Command and Data.The command register stores the command instructions
given to the LCD. A command is an instruction given to LCD to do a predefined task
like initializing it, clearing its screen, setting the cursor position, controlling display etc.
The data register stores the data to be displayed on the LCD. The data is the ASCII
value of the character to be displayed on the LCD.
4.1)PINDESCRIPTION
The most commonly used LCDs found in the market today are 1Line,2Line or4 Line LCDs which
have only1 controller and support at most of 80 characters, where as LCD s supporting more than 80
characters make use of 2HD44780 controllers.
Most LCD swith 1 controller has 14 Pins and LCDs with 2 controller has16 Pins (two pinsare
extrainbothforback-lightLEDconnections).Pindescriptionis showninthe tablebelow.
SNGIST
26
Function
Name
Ground (0V)
Ground
Vcc
VEE
Selects command register when low; and data register when high
Register Select
Read/write
Enable
DB0
DB1
DB2
10
DB3
8-bit data pins
11
DB4
12
DB5
13
DB6
14
DB7
15
Led+
16
Led-
SNGIST
27
CHAPTER: 5
When the controlling current flows through the coil, the soft iron core is magnetized and
attracts the L-shaped soft iron armature. This rocks on its pivot and opens, closes or changes over, the
electrical contacts in the circuit being controlled it closes the contacts.
The current needed to operate a relay is called the pull-in current and the dropout current in
the coil when the relay just stops working. If the coil resistance R of a relay is 185 and its
operating voltage V is 12V, the pull-in current I is given by:
I = V/R = 12/185 = 65 mA
Relays are electromagnetic switches, which provides contact between two mechanical elements.
Relays have a coil which works on 12V dc power supply and provides DPDT action as an output.
In general relays provide potential free contacts which can be used for universal function like
DC, AC voltage switching and to control bigger electrical switch gears.
The electromechanical relays are
SNGIST
28
Protective relaying is necessary for almost every electrical plant and no part of the power system
is left unprotected.
The choice of protection depends upon several aspects such as
its importance.
There are several electrical equipments and machines of various ratings. Each needs
certain adequate protection .The protective relaying senses the abnormal conditions in a part of the
power system and isolates that part from the healthy part of system.The relays used in this project are
compact, self-contained devices which respond to abnormal conditions (relays can distinguish normal
and abnormal conditions).The Relay driver Circuit Works as follows.
A Relay is connected as
SNGIST
29
the Ground is connected to the appropriate terminals of the relay coil. We control the relay by
controlling the ground signal given to the relay using a transistor. The operation is as follows.
When the output of the controller is High, then the transistor conducts, allowing the low potential to
reach one end of the relay, which results in switching of the relay form NC to NO.
When the output is Low, the transistor will not conduct. So ground is not applied to the relay Coil. So
the relay remain in NC position.
Using this Normally open (NO) and Normally Closed (NC) contacts we can switch any supply AC
or DC. The supply to the operated device should be given to the Common of the relay and the
output from the NO is given to the Device. So that
when the relay is switched on the device gets supply and works.
SNGIST
30
CHAPTER: 6
SOLAR PANEL
6.1 )PHOTO VOLTAIC CELLS (PV CELLS)
There are two basic types of solid silicon, amorphous (having no long range order) and crystalline
(where the atoms are arranged in an ordered three dimensional array). There are various other terms
for the crystalline structure of silicon; poly-crystalline, micro-crystalline, nano-crystalline etc, and
these refer to the size of the crystal "grains" which make up the solid. Solar cells can be, and are
made from each of these types of silicon, the most common being poly-crystalline.
Silicon is a semiconductor. This means that in solid silicon, there are certain bands of energies which
the electrons are allowed to have, and other energies between these bands which are forbidden. These
forbidden energies are called the "band gap". The allowed and orbidden bands of energy are
explained by the theory of quantum mechanics.
At room temperature, pure silicon is a poor electrical conductor. In quantum mechanics, this is
explained by the fact that the Fermi level lies in the forbidden band- gap. To make silicon a better
conductor, it is "doped" with very small amounts of atoms from either group 13 (III) or group 15 (V)
of the periodic table. These "dopant" atoms take the place of the silicon atoms in the crystal lattice, and
bond with their neighboring Si atoms in almost the same way as other Si atoms do. However, because
group 13 atoms have only 3 valence electrons, and group 15 atoms have 5 valence electrons, there is
either one too few, or one too many electrons to satisfy the four covalent bonds around each atom.
Since these extra electrons, or lack of electrons (known as "holes") are not involved in the covalent
bonds of the crystal lattice, they are free to move around within the solid. Silicon which is doped with
group 13 atoms (aluminum, gallium) is known as p-type silicon because the majority charge carriers
(holes) carry a positive charge, whilst silicon doped with group 15 atoms (phosphorus, arsenic) is
known as n-type silicon because the majority charge carriers (electrons) are negative. It should be
noted that both n-type and p-type silicon are electrically neutral,
i.e. they have the same numbers of positive and negative charges, it is just that in n-type silicon,
some of the negative charges are free to move around, while the converse is true for p-type silicon.
SNGIST
31
A solar cell is a large-area semiconductor p-n junction. To understand the workings of a p-n junction it
is convenient to imagine what happens when a piece of n-type silicon is brought into contact with a
piece of p-type silicon. In practice, however, the p-n junctions of solar cells are not made in this way,
but rather, usually, by diffusing an n- type dopant into one side of a p-type wafer.
If we imagine what happens when a piece of p-type silicon is placed in intimate contact with a
piece of n-type silicon, then what occurs is a diffusion of electrons from the region of high
electron concentration - the n-type side of the junction, into the region of low electron concentration
- p-type side of the junction. When the electrons diffuse across the p-n junction, they recombine
with holes on the p-type side. This diffusion of carriers does not happen indefinitely however,
because of the electric field which is created by the imbalance of charge immediately either side of
the junction which this diffusion creates. Electrons from donor atoms on the n-type side of the junction
are crossing into the p-type side, leaving behind the (extra) positively charged nuclei of the group 15
donor atoms, leaving an excess of positive charge on the n-type side of the junction. At the same
time, these electrons are filling in holes on the p-type side of the junction, becoming involved in
covalent bonds around the group 13 acceptor atoms, making an excess of negative charge on the ptype side of the junction. This imbalance of charge across the p-n junction sets up an electric field
which opposes further diffusion of charge carriers across the junction.
This region where electrons have diffused across the junction is called the depletion region because it
no longer contains any mobile charge carriers. It is also known as the "space charge region". The
electric field which is set up across the p-n junction creates a diode, allowing current to flow in only
one direction across the junction. Electrons may pass from the n-type side into the p-type side, and
holes may pass from the p-type side to the n-type side. But since the sign of the charge on
electrons and holes is opposite, conventional current may only flow in one direction.
Because solar cells are semiconductor devices, they share many of the same processing and
manufacturing techniques as other semiconductor devices such as computer and memory chips.
However, the stringent requirements for cleanliness and quality control of semiconductor fabrication
are a little more relaxed for solar cells. Most large-scale commercial solar cell factories today make
screen printed poly- crystalline silicon solar cells. Single crystalline wafers which are used in the
semiconductor industry can be made in to excellent high efficiency solar cells, but they are
generally considered to be too expensive for large-scale mass production. Poly-crystalline silicon
Electronics and Communication Engineering Department
SNGIST
32
wafers are made by wire-sawing block-cast silicon ingots into very thin (250 to 350 micrometer) slices
or wafers
The wafers are usually lightly p-type doped. To make a solar cell from the wafer, an n-type diffusion
is performed on the front side of the wafer, forming a p-n junction a few hundred nanometres below
the surface. Antireflection coatings, which increase the amount of light coupled into the solar cell,
are typically applied next. Over the past
decade,
silicon
nitride
has
gradually
replaced
titanium dioxide as the antireflection coating of choice because of its excellent surface passivation
qualities (i.e., it prevents carrier recombination at the surface of the solar cell). It is typically applied in
a layer several hundred nanometers thick using plasma-enhanced chemical vapor deposition
(PECVD). The wafer is then metallised, whereby a full area metal contact is made on the back
surface, and a grid-like metal contact made up of fine "fingers" and larger "busbars" is screen-printed
onto the front surface using a silver paste. The rear contact is also formed by screen-printing a metal
paste, typically aluminum. Usually this contact covers the entire rear side of the cell, though in some
cell designs it is printed in a grid pattern. The metal electrodes will then require some kind of heat
treatment or "sintering" to make Ohmic contact with the silicon. After the metal contacts are
made, the solar cells are interconnected in series (and/or parallel) by flat wires or metal ribbons, and
assembled into modules or "solar panels".
Solar panels have a sheet of tempered glass on the front, and a polymer encapsulation on the back.
Some solar cells have textured front surfaces that, like antireflection coatings, serve to increase the
amount of light coupled into the cell. Such surfaces can usually only be formed on single-crystal
silicon, though in recent years methods of forming them on multicrystalline silicon have been
developed
These are also known as solar cells and their assembly is termed as solar panel, let us see the
individual discrete component of solar cell which is shown in below Fig
SNGIST
33
Figure 7: STRUTURE
OF SOLAR CELL
PV cells were invented in 1953 by Charles Fariett. A PV cell is used for converting photon into
electron and with sun light incident, electrical energy is generated. The solar-based battery may be
used to directly feed electricity to electronic equipment or for domestic heating. Solar batteries can
also be used for satellites, communication equipment and domestic appliances.
A selenium-or silicon-based solar cell exhibits open-circuit voltage of only 0.5V and short-circuit cell
current of the order of 1milliampere for 6.4cm area of the cell at6458 meter candles. Therefore a
large number of such silicon or selenium solar cells need to be connected in series and parallel to
provide any significant power. A telemetry system required to operate 24 hours a day requires a
solar panel providing 5 watts at 12 volts used for recharging corresponding storage batteries during
daylight hours.
SNGIST
34
CHAPTER: 7
RECHARGEABLE BATTERY
A rechargeable battery, storage battery, or accumulator is a type of electrical battery. It comprises one or
more electrochemical cells, and is a type of energy accumulator. It is known as a secondary cell because
its electrochemical reactions are electrically reversible. Rechargeable batteries come in many different
shapes and sizes, ranging from button cells to megawatt systems connected to stabilize an electrical
distribution network. Several different combinations of chemicals are commonly used, including: lead
acid, nickel cadmium (NiCd),nickel metal hydride (NiMH), lithium ion (Li-ion), and lithium ion
polymer (Li-ion polymer).
Rechargeable batteries have lower total cost of use and environmental impact than disposable batteries.
Some rechargeable battery types are available in the same sizes as disposable types. Rechargeable batteries
have higher initial cost but can be recharged very cheaply and used many times
SNGIST
35
The energy used to charge rechargeable batteries usually comes from a battery charger using AC mains
electricity, although some are equipped to use a vehicle's 12-volt DC power outlet. Regardless, to store
energy in a secondary cell, it has to be connected to a DC voltage source. The negative terminal of the cell
has to be connected to the negative terminal of the voltage source and the positive terminal of the voltage
source with the positive terminal of the battery. Further, the voltage output of the source must be higher than
that of the battery, but not much higher: the greater the difference between the power source and the battery's
voltage capacity, the faster the charging process, but also the greater the risk of overcharging and damaging
the battery.
Chargers take from a few minutes to several hours to charge a battery. Slow "dumb" chargers without
voltage- or temperature-sensing capabilities will charge at a low rate, typically taking 14 hours or more to
reach a full charge. Rapid chargers can typically charge cells in two to five hours, depending on the model,
with the fastest taking as little as fifteen minutes. Fast chargers must have multiple ways of detecting when a
cell reaches full charge (change in terminal voltage, temperature, etc.) to stop charging before harmful
overcharging or overheating occurs. The fastest chargers often incorporate cooling fans to keep the cells
from overheating.
Battery charging and discharging rates are often discussed by referencing a "C" rate of current. The C rate is
that which would theoretically fully charge or discharge the battery in one hour. For example, trickle
charging might be performed at C/20 (or a "20 hour" rate), while typical charging and discharging may
occur at C/2 (two hours for full capacity). The available capacity of electrochemical cells varies depending
on the discharge rate.
SNGIST
36
CHAPTER : 8
CIRCUIT DIAGRAM
Figure:CIRCUIT DIAGRAM
SNGIST
37
The relay will be de-energised when the overload reset switch is pressed. The voltage at the battery is
continuously displayed on the LCD using the built-in ADC module in the PIC 16F877A. The voltage is
divided by 3 by using 3 equal value resistors and 1/3 voltage is send to ADC input. The analogue voltage is
converted into digital and it is displayed on LCD after multiplying with 3. The reference voltage for the
ADC conversion is taken from the VDD supply.
The rated current of the power supply is chosen as 3A. At full load, the load voltage will be 9.6V
(full load resistance = V/I = 12V/3A = 4Ohm. Therefore Load voltage = 12 x 4/5 = 9.6V using voltage
divider rule) it is divided by 3 using resistive network and given to ADC channel 2(AN2). The voltage is
continuously measured by the pic. If over load occurs, the voltage at load reduces. It is detected by the pic
and energises relay switch 2 and disconnects load from over current.
SNGIST
38
CHAPTER: 9
PROGRAM CODING
SNGIST
39
trisc=0xff;
trisd=0x00;
Lcd_Init();
Lcd_Cmd(_LCD_CURSOR_OFF);
delay_ms(200);
ADC_Init();
delay_ms(200);
while(1)
{
a=.00488*ADC_Read(0)*3;
FloatToStr(a, txt);
strcat(txt,"V");
Lcd_Out(1,2,"SOLAR CHARGER");
Lcd_Out(2,4,txt);
//Lcd_Out(2,6,"v");
delay_ms(300);
if(a>12)
portd.f7=0;
else
portd.f7=1;
b=.0048*ADC_Read(1);
/*Lcd_Out(1,1,"load");
FloatToStr(b, txt);
Electronics and Communication Engineering Department
SNGIST
40
Lcd_Out(2,1,txt);
delay_ms(1000);*/
if(b<3)
{
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,4,"OVER LOAD");
portd.f6=1;
while(portc.f0==1);
portd.f6=0;
}
else
portd.f6=0;}}
SNGIST
41
CHAPTER : 10
Drawing the layout of the PCB in the paper. The track layout of the electronic circuit
should be made in such manner that the paths are in easy routes. It is then transferred to a Mylar
sheet. The sheet is then touched with black ink.
2.
The solder side of the Mylar sheet is placed on the shiny side of the five-star sheet and
is placed in a frame. Then it is exposed to sunlight with Mylar sheet facing the sunlight.
3.
The exposed five-star sheet is put in hydrogen peroxide solution. Then it is put in hot
This is put in cold water and then the rough side is stuck onto the silk screen. This is
The plastic sheet of the five-star sheet is removed leaving the pattern on the screen.
6.
A copper clad sheet is cut to the size and cleaned. This is placed under screen.
7.
As it resistant ink if spread on the screen so that a pattern of tracks and a pad is
(32Baume) till all the unwanted copper is etched away. Swish the board to keep the each
fluid moving. Lift the PCB and check whether all the unwanted copper is removed. Etching is
done by immersing the marked copper clad in ferric chloride solution. After that the etched
Electronics and Communication Engineering Department
SNGIST
42
sheet is dried.The unwanted resist ink is removed using sodium hydroxide solution Holes are
then dried.
PCB PARAMETERS
Copper thickness- 72mil (1mm=39.37mils)
Track width- 60 mil
Clearance - 60 mil
Pad width- 86mil
Pad height - 86 mil
Pad shape- oval
Pad hole size- 25mil
On board- Through
Hole size- .9mm(36mil)
Base - paper phenolic, hylam
PCB Quality- FRC
SOLDERING
Soldering is the process of joining metals by using lower melting point to weld or alloy with
joining surface.
SOLDER:
Solder is the joining material that melts below 427 degree connections between
components.The popularly used solders are alloys of tin(Sn) and lead(Pb) that melts below the
melting point if tin.
Types:
1.
Rosin core: - 60/40 Sn/Pb solders are the most common types used for electronics
assembly. These solders are available in various diameters and are most appropriate for small
electronics work(0.02-0.05|| dia is recommended)
SNGIST
43
2.
Lead free :- Lead free solders are used as more environmental-friendly substitutes for
leaded solder, but they are typically not as easy to use mainly because of their higher melting
point and poorer wetting properties.
3.
Silver:- Silver solders are typically used for low resistance connections but they have
Acid-core:- acid-core solders should not be used for electronics.They are intended for
plumbing of non-electronics assembly work. The acid-core flux will cause corrosion of circuitry
and can damage components.
5.Other special solders:- various melting point eutectics: these
6.special solders are typically used for non-electronic assembly of difficult to construct
mechanical items that must be assembled in a particular sequence .
FLUX
In order to make the surface accept the solder readily ,the components terminals should be free
oxides and other obstructing films .the lead should be cleaned chemically or by abrasion using
blades or knives. Small amount of lead coating can be done on the portion of the leads using
soldering iron .this process is called thinning. Zinc chloride or ammonium chloride separately or
in combination is mostly used as fluxes. These are available in petroleum jelly as paste flux. The
desirable properties of flux are:It should provide a liquid cover over the materials and exclude air gap up to the soldering
temperature. It should dissolve any oxide on the metal surface. It should be easily replaced from
the metal by the molten soldering operation.Residue should be removable after completing
soldering operation.The most common flux used in hand soldering of electronic components is
rosin, a combination of mild organic acids extracted from pine tree.
SNGIST
44
SOLDERING IRON
It is a tool used to melt the solder and apply it at the joints in the circuit. it
operates in 230V supply. The iron at the tip gets heated while few minutes. 50W and 25W
soldering irons are commonly used for soldering of electronics circuit.
SOLDERING STEPS
1.
Make the layout of the component in the circuit. Plug in the chord of the soldering
3.
Mount the components on the PCB by bending the leads of the components. Use nose
pliers.
4.
Apply flux on the joints and solder the joints. Solder must be in minimum time to
Dull or crystallized surface: This is an indicator of a cold solder joint. Cold solder joint
result from moving the component after soldering has been removed, but before the solder has
hardened. Cold solder joints may work at first, but will eventually fail.
2.
Air Pocket: Air pocket (voids) result from incomplete wetting of surface, allowing air
to be in contact with the connecting metals. This will cause oxidation of the joints & eventual
Electronics and Communication Engineering Department
SNGIST
45
failure. Blow holes can occur due to vaporization of moisture on the surface of the board &
existing through the molten solder. Boards should be clean & dry, prior to soldering. Ethanol
(100%) can be used as a moisture chaser if boards are wet prior to soldering.
3. Dimples: Dimples in the surface do not always indicate a serious problem, but they should be
avoided since they are precursors to voids.
4. Floaters: Black spots-Floating in the soldering fillet should be avoided, because they indicate
contamination & potential for failure as in the case of voids. These black spots usually results
from overheated (burnt) Rosin or other contaminants such as burnt wire insulation. Maintaining
a clean tip will help to avoid these problems.
5.Balls:A solder balls instead of a fillet can occur if the trace was heated but the leads were
not(vice versa).This prevents proper wetting of both surfaces & result in solder being attached to
only one surface(component of trace).
6. Excess solder: Excess solder usage can cover up other potential problems & should be
avoided. It can lead to solder bridges. In addition, spherical solder joints can result from the
application of too much solder
SNGIST
46
PCB LAYOUT
SNGIST
47
CHAPTER : 11
SOFTWARES USED
PROTHEUS
Proteus is a software for microprocessor simulation, schematic capture, and printed circuit board (PCB)
design. It is developed by Labcenter Electronics.The XGameStation Micro Edition was designed using
Labcenter's Proteus schematic entry and PCB layout tools
Proteus PCB design combines the ISIS schematic capture and ARES PCB layout programs to provide a
powerful, integrated and easy to use suite of tools for professional PCB Design.All Proteus PCB design
products include an integrated shape based autorouter and a basic SPICE simulation capability as standard.
More advanced routing modes are included in Proteus PCB Design Level 2 and higher whilst simulation
capabilities can be enhanced by purchasing the Advanced Simulation option and/or micro-controller
simulation capabilities.
System components
PROSPICE Mixed mode SPICE simulation - industry standard SPICE3F5 simulator combined with a
digital simulator.
ARES PCB Layout - PCB design system with automatic component placer, rip-up and retry auto-router
and interactive design rule checking.
VSM - Virtual System Modelling lets cosimulate embedded software for popular micro-controllers
alongside hardware design.
System Benefits Integrated package with common user interface and fully context sensitive help.
SNGIST
48
MIKRO C
MikroC is a full-featured ANSI C compiler that is available for six different microcontroller architectures (in
this case, for PIC 12/16/18). It features an intuitive IDE, a powerful compiler with advanced SSA
optimizations, lots of hardware and software libraries, and additional tools that will help you in your work.
The compiler comes with a comprehensive Help file (700 pages) and lots of ready-to-use examples designed
to get you started in no time.
Each compiler license includes free upgrades and tech support for the lifetime of the product. The software
features a Live Update service so you can get new features and improvements instantly.
The mikroC PRO for PIC compiler supports 504 PIC microcontrollers. Newly released PIC microcontrollers
will be supported by new versions of the compiler software that is updated regularly.
SNGIST
49
The compiler is designed to be smart and efficient, so you can rely on it to do the hard work. It features four
levels of optimizations that can reduce your code size up to 20 percent. Standard header files are included
that make it easy to port your code from other C compilers.
SNGIST
50
APPENDICES
1)
PIC16F87XA
Data Sheet
28/40/44-Pin Enhanced Flash
Microcontrollers
www.nitropdf.com
51
PIC16F87XA
28/40/44-Pin Enhanced Flash Microcontrollers
Devices Included in this Data Sheet:
PIC16F873A
PIC16F874A
Analog Features:
10-bit, up to 8-channel Analog-to-Digital
Converter (A/D)
Brown-out Reset (BOR)
Analog Comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference
(VREF) module
- Programmable input multiplexing from device
inputs and internal voltage reference
- Comparator outputs are externally accessible
PIC16F876A
PIC16F877A
Peripheral Features:
Timer0: 8-bit timer/counter with 8-bit prescaler
Timer1: 16-bit timer/counter with prescaler,
can be incremented during Sleep via external
crystal/clock
Timer2: 8-bit timer/counter with 8-bit period
register, prescaler and postscaler
Two Capture, Compare, PWM modules
- Capture is 16-bit, max. resolution is 12.5 ns
- Compare is 16-bit, max. resolution is 200 ns
- PWM max. resolution is 10-bit
Synchronous Serial Port (SSP) with SPI
(Master mode) and I2C (Master/Slave)
Universal Synchronous Asynchronous Receiver
Transmitter (USART/SCI) with 9-bit address
detection
Parallel Slave Port (PSP) 8 bits wide with
external RD, WR and CS controls (40/44-pin only)
Brown-out detection circuitry for
Brown-out Reset (BOR)
CMOS Technology:
Low-power, high-speed Flash/EEPROM
technology
Fully static design
Wide operating voltage range (2.0V to 5.5V)
Commercial and Industrial temperature ranges
Low-power consumption
Program Memory
Device
MSSP
Data
EEPROM
10-bit
CCP
Timers
# Single Word SRAM (Bytes) I/O A/D (ch) (PWM)
Master USART 8/16-bit Comparators
Bytes
SPI
Instructions (Bytes)
I 2C
PIC16F873A 7.2K
4096
192
128
22
Yes
Yes
Yes
2/1
PIC16F874A 7.2K
4096
192
128
33
Yes
Yes
Yes
2/1
PIC16F876A 14.3K
8192
368
256
22
Yes
Yes
Yes
2/1
PIC16F877A 14.3K
8192
368
256
33
Yes
Yes
Yes
2/1
www.nitropdf.com
52
PIC16F87XA
Pin Diagrams
28-Pin PDIP, SOIC, SSOP
28
27
26
25
24
23
22
21
20
19
18
17
16
15
RA1/AN1
RA0/AN0
MCLR/VPP
RB7/PGD
RB6/PGC
RB5
RB4
RB7/PGD
RB6/PGC
RB5
RB4
RB3/PGM
RB2
RB1
RB0/INT
VDD
VSS
RC7/RX/DT
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
.......
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
RD3/PSP3
RD2/PSP2
RD1/PSP1
RD0/PSP0
RC3/SCK/SCL
RC2/CCP1
RC1/T1OSI/CCP2
RC0/T1OSO/T1CKI
44-Pin QFN
---p
PIC16F874A
PIC16F877A
33
32
31
30
29
28
27
26
25
24
23
12
13
14
15
16
17
18
19
20
21
22
1
2
3
4
5
6
7
8
9
10
11
----~
~
OSC2/CLKO
OSC1/CLKI
VSS
VSS
VDD
VDD
RE2/CS/AN7
RE1/WR/AN6
RE0/RD/AN5
RA5/AN4/SS/C2OUT
RA4/T0CKI/C1OUT
.......
.....
11I1111ll~
RB3/PGM
NC
RB4
RB5
RB6/PGC
RB7/PGD
MCLR/VPP
RA0/AN0
RA1/AN1
RA2/AN2/VREF-/CVREF
RA3/AN3/VREF+
.....
....
44
43
42
41
40
39
38
37
36
35
34
lUllIllll1
RC7/RX/DT
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
VSS
VDD
VDD
RB0/INT
RB1
RB2
.......
.......
.......
1
2
3
4
5
6
7
PIC16F873A
PIC16F876A
21
20
19
18
17
16
15
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
RC4/SDI/SDA
RC5/SDO
RC6/TX/CK
RA2/AN2/VREF-/CVREF
RA3/AN3/VREF+
RA4/T0CKI/C1OUT
RA5/AN4/SS/C2OUT
VSS
OSC1/CLKI
OSC2/CLKO
28
27
26
25
24
23
22
28-Pin QFN
8
9
10
11
12
13
14
PIC16F873A/876A
1
2
3
4
5
6
7
8
9
10
11
12
13
14
MCLR/VPP
RA0/AN0
RA1/AN1
RA2/AN2/VREF-/CVREF
RA3/AN3/VREF+
RA4/T0CKI/C1OUT
RA5/AN4/SS/C2OUT
VSS
OSC1/CLKI
OSC2/CLKO
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
www.nitropdf.com
._-......
....
~
RB3/PGM
RB2
RB1
RB0/INT
VDD
VSS
RC7/RX/DT
53
PIC16F87XA
Pin Diagrams (Continued)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
RA5/AN4/SS/C2OUT
RE0/RD/AN5
RE1/WR/AN6
RE2/CS/AN7
VDD
VSS
OSC1/CLKI
OSC2/CLKO
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
RD0/PSP0
RD1/PSP1
RB7/PGD
RB6/PGC
RB5
RB4
RB3/PGM
RB2
RB1
RB0/INT
VDD
VSS
RD7/PSP7
RD6/PSP6
RD5/PSP5
RD4/PSP4
RC7/RX/DT
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
RD3/PSP3
RD2/PSP2
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
RA3/AN3/VREF+
RA2/AN2/VREF-/CVREF
RA1/AN1
RA0/AN0
MCLR/VPP
NC
RB7/PGD
RB6/PGC
RB5
RB4
NC
MCLR/VPP
RA0/AN0
RA1/AN1
RA2/AN2/VREF-/CVREF
RA3/AN3/VREF+
RA4/T0CKI/C1OUT
PIC16F874A/877A
40-Pin PDIP
PIC16F874A
PIC16F877A
33
32
31
30
29
28
27
26
25
24
23
12
13
14
15
16
17
18
19
20
21
22
1
2
3
4
5
6
7
8
9
10
11
NC
RC0/T1OSO/T1CKI
OSC2/CLKO
OSC1/CLKI
VSS
VDD
RE2/CS/AN7
RE1/WR/AN6
RE0/RD/AN5
RA5/AN4/SS/C2OUT
RA4/T0CKI/C1OUT
,_'.
-
NC
NC
RB4
RB5
RB6/PGC
RB7/PGD
MCLR/VPP
RA0/AN0
RA1/AN1
RA2/AN2/VREF-/CVREF
RA3/AN3/VREF+
44
43
42
41
40
39
38
37
36
35
34
44-Pin TQFP
RC7/RX/DT
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
VSS
VDD
RB0/INT
RB1
RB2
RB3/PGM
PIC16F874A
PIC16F877A
39
38
37
36
35
34
33
32
31
30
29
18
19
20
21
22
23
24
25
26
27
28
7
8
9
10
11
12
13
14
15
16
17
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
RD0/PSP0
RD1/PSP1
RD2/PSP2
RD3/PSP3
RC4/SDI/SDA
RC5/SDO
RC6/TX/CK
NC
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
RD3/PSP3
RD2/PSP2
RD1/PSP1
RD0/PSP0
RC3/SCK/SCL
RC2/CCP1
RC1/T1OSI/CCP2
NC
RA4/T0CKI/C1OUT
RA5/AN4/SS/C2OUT
RE0/RD/AN5
RE1/WR/AN6
RE2/CS/AN7
VDD
VSS
OSC1/CLKI
OSC2/CLKO
RC0/T1OSO/T1CK1
NC
6
5
4
3
2
1
44
43
42
41
40
44-Pin PLCC
www.nitropdf.com
RB3/PGM
RB2
RB1
RB0/INT
VDD
VSS
RD7/PSP7
RD6/PSP6
RD5/PSP5
RD4/PSP4
RC7/RX/DT
54
PIC16F87XA
FIGURE 1-2:
Program
Bus
PORTA
RA0/AN0
RA1/AN1
RA2/AN2/VREF-/CVREF
RA3/AN3/VREF+
RA4/T0CK I/C1OUT
RA5/AN4/SS/C2OUT
RAM
File
Registers
8 Level Stack
(13-bit)
14
Data Bus
Program Counter
RAM Addr(1)
PORTB
Addr MUX
Instruction reg
Direct Addr
Indirec t
Addr
-x
-x
FSR reg
-x
-x
Status reg
8
RB0/INT
RB1
RB2
RB3/PGM
RB4
RB5
RB6/PGC
RB7/PGD
PORTC
3
Power-up
Timer
Instruction
Decode &
Control
Timing
Generation
OSC1/CLKI
OSC2/CLKO
Oscillator
Start-up Timer
Power-on
Reset
Watchdog
Timer
Brown-out
Reset
RC0/T1OSO/T1CKI
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
RC4/SDI/SDA
RC5/SDO
RC6/TX/CK
RC7/RX/DT
MUX
ALU
8
W reg
PORTD
RD0/PSP0
RD1/PSP1
RD2/PSP2
RD3/PSP3
RD4/PSP4
RD5/PSP5
RD6/PSP6
RD7/PSP7
In-Circuit
Debugger
Low-Voltage
Programming
PORTE
MCLR
RE0/RD/AN5
VDD, VSS
RE1/WR/AN6
RE2/CS/AN7
Timer0
Timer1
Timer2
10-bit A/D
Data EEPROM
CCP1,2
Synchronous
Serial Port
USART
Parallel
Slave Port
Comparator
Voltage
Reference
Device
Program Flash
Data Memory
Data EEPROM
PIC16F874A
4K words
192 Bytes
128 Bytes
PIC16F877A
8K words
368 Bytes
256 Bytes
www.nitropdf.com
55
PIC16F87XA
TABLE 1-3:
Pin Name
OSC1/CLKI
OSC1
PDIP
Pin#
13
PLCC TQFP
Pin# Pin#
14
30
QFN
Pin#
I/O/P
Type
32
I
CLKI
OSC2/CLKO
OSC2
14
15
31
33
Buffer
Type
ST
CLKO
MCLR/VPP
MCLR
18
18
I
VPP
Description
RA1/AN1
RA1
AN1
RA2/AN2/VREF-/CVREF
RA2
AN2
VREFCVREF
RA3/AN3/VREF+
RA3
AN3
VREF+
RA4/T0CKI/C1OUT
RA4
19
19
I/O
I
20
20
TTL
21
21
Digital I/O.
Analog input 1.
TTL
Digital I/O.
Analog input 2.
A/D reference voltage (Low) input.
Comparator VREF output.
I/O
I
I
O
6
22
22
TTL
Digital I/O.
Analog input 3.
A/D reference voltage (High) input.
I/O
I
I
7
23
23
ST
I/O
I
O
RA5/AN4/SS/C2OUT
RA5
AN4
SS
C2OUT
Note 1:
2:
3:
Digital I/O.
Analog input 0.
I/O
I
T0CKI
C1OUT
Legend:
TTL
24
24
TTL
I/O
I
I
O
Digital I/O.
Analog input 4.
SPI slave select input.
Comparator 2 output.
I = input
O = output
I/O = input/output
P = power
= Not used
TTL = TTL input
ST = Schmitt Trigger input
This buffer is a Schmitt Trigger input when configured as the external interrupt.
This buffer is a Schmitt Trigger input when used in Serial Programming mode.
This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
www.nitropdf.com
56
PIC16F87XA
TABLE 1-3:
Pin Name
PLCC TQFP
Pin# Pin#
QFN
Pin#
I/O/P
Type
Buffer
Type
Description
PORTB is a bidirectional I/O port. PORTB can be
software programmed for internal weak pull-up on all
inputs.
RB1
34
37
RB2
35
38
RB3/PGM
RB3
PGM
36
39
RB4
37
41
14
14
I/O
TTL TTL
Digital I/O.
RB5
38
42
15
15
I/O
TTL/ST(2)
Digital I/O.
RB6/PGC
RB6
PGC
39
43
16
16
I/O
I
TTL/ST(2)
Digital I/O.
In-circuit debugger and ICSP programming clock.
RB7/PGD
RB7
PGD
40
Note 1:
2:
3:
TTL/ST(1)
33
Legend:
36
RB0/INT
RB0
INT
I/O
I
Digital I/O.
External interrupt.
10
I/O
TTL
Digital I/O.
10
11
I/O
TTL
Digital I/O.
11
12
TTL
I/O
I
44
17
Digital I/O.
Low-voltage ICSP programming enable pin.
17
I/O
I/O
Digital I/O.
In-circuit debugger and ICSP programming data.
I = input
O = output
I/O = input/output
P = power
= Not used
TTL = TTL input
ST = Schmitt Trigger input
This buffer is a Schmitt Trigger input when configured as the external interrupt.
This buffer is a Schmitt Trigger input when used in Serial Programming mode.
This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
www.nitropdf.com
57
PIC16F87XA
TABLE 1-3:
Pin Name
PLCC TQFP
Pin# Pin#
QFN
Pin#
I/O/P
Type
Buffer
Type
Description
PORTC is a bidirectional I/O port.
RC0/T1OSO/T1CKI
RC0
T1OSO
T1CKI
15
RC1/T1OSI/CCP2
RC1
T1OSI
CCP2
16
RC2/CCP1
RC2
CCP1
17
RC3/SCK/SCL
RC3
SCK
18
16
32
34
I/O
O
I
18
35
35
ST
19
36
36
Digital I/O.
Timer1 oscillator input.
Capture2 input, Compare2 output, PWM2 output.
ST
I/O
I/O
20
37
37
Digital I/O.
Capture1 input, Compare1 output, PWM1 output.
ST
I/O
I/O
Digital I/O.
Synchronous serial clock input/output for SPI
mode.
Synchronous serial clock input/output for I2C
mode.
I/O
RC4/SDI/SDA
RC4
SDI
SDA
23
RC5/SDO
RC5
SDO
24
RC6/TX/CK
RC6
TX
CK
25
RC7/RX/DT
RC7
RX
DT
26
Note 1:
2:
3:
Digital I/O.
Timer1 oscillator output.
Timer1 external clock input.
I/O
I
I/O
SCL
Legend:
ST
25
42
42
ST
I/O
I
I/O
26
43
43
Digital I/O.
SPI data in.
I2C data I/O.
ST
I/O
O
27
44
44
Digital I/O.
SPI data out.
ST
I/O
O
I/O
29
Digital I/O.
USART asynchronous transmit.
USART1 synchronous clock.
ST
I/O
I
I/O
Digital I/O.
USART asynchronous receive.
USART synchronous data.
I = input
O = output
I/O = input/output
P = power
= Not used
TTL = TTL input
ST = Schmitt Trigger input
This buffer is a Schmitt Trigger input when configured as the external interrupt.
This buffer is a Schmitt Trigger input when used in Serial Programming mode.
This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
www.nitropdf.com
58
PIC16F87XA
TABLE 1-3:
Pin Name
PLCC TQFP
Pin# Pin#
QFN
Pin#
I/O/P
Type
Buffer
Type
Description
PORTD is a bidirectional I/O port or Parallel Slave
Port when interfacing to a microprocessor bus.
RD0/PSP0
RD0
PSP0
19
RD1/PSP1
RD1
PSP1
20
RD2/PSP2
RD2
PSP2
21
RD3/PSP3
RD3
PSP3
22
RD4/PSP4
RD4
PSP4
27
RD5/PSP5
RD5
PSP5
28
RD6/PSP6
RD6
PSP6
29
RD7/PSP7
RD7
PSP7
30
RE0/RD/AN5
RE0
RD
AN5
RE1/WR/AN6
RE1
WR
AN6
RE2/CS/AN7
RE2
CS
AN7
10
21
38
ST/TTL(3)
38
Digital I/O.
Parallel Slave Port data.
I/O
I/O
22
39
ST/TTL(3)
39
Digital I/O.
Parallel Slave Port data.
I/O
I/O
23
40
ST/TTL(3)
40
Digital I/O.
Parallel Slave Port data.
I/O
I/O
24
41
ST/TTL(3)
41
Digital I/O.
Parallel Slave Port data.
I/O
I/O
30
ST/TTL(3)
Digital I/O.
Parallel Slave Port data.
I/O
I/O
31
ST/TTL(3)
Digital I/O.
Parallel Slave Port data.
I/O
I/O
32
ST/TTL(3)
Digital I/O.
Parallel Slave Port data.
I/O
I/O
33
ST/TTL(3)
Digital I/O.
Parallel Slave Port data.
I/O
I/O
25
ST/TTL(3)
25
I/O
I
I
10
26
ST/TTL(3)
26
I/O
I
I
11
27
Digital I/O.
Read control for Parallel Slave Port.
Analog input 5.
27
ST/TTL(3)
I/O
I
I
Digital I/O.
Write control for Parallel Slave Port.
Analog input 6.
Digital I/O.
Chip select control for Parallel Slave Port.
Analog input 7.
VSS
12, 31 13, 34
6, 29
6, 30,
31
VDD
11, 32 12, 35
7, 28
7, 8,
28, 29
13
NC
Legend:
Note 1:
2:
3:
1, 17, 12,13,
28, 40 33, 34
I = input
O = output
I/O = input/output
P = power
= Not used
TTL = TTL input
ST = Schmitt Trigger input
This buffer is a Schmitt Trigger input when configured as the external interrupt.
This buffer is a Schmitt Trigger input when used in Serial Programming mode.
This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
www.nitropdf.com
59
PIC16F87XA
2.0
MEMORY ORGANIZATION
FIGURE 2-1:
PIC16F876A/877A
PROGRAM MEMORY MAP
AND STACK
2.1
FIGURE 2-2:
PIC16F873A/874A
PROGRAM MEMORY MAP
AND STACK
PC<12:0>
PC<12:0>
13
CALL, RETURN
RETFIE, RETLW
13
CALL, RETURN
RETFIE, RETLW
Stack Level 1
Stack Level 1
Stack Level 2
Stack Level 2
Stack Level 8
Stack Level 8
Reset Vector
0000h
Interrupt Vector
0004h
Reset Vector
0000h
Interrupt Vector
0004h
0005h
0005h
Page 0
07FFh
0800h
On-Chip
Program
Memory
Page 1
On-Chip
Program
Memory
Page 0
07FFh
0800h
Page 1
0FFFh
0FFFh
1000h
1000h
Page 2
17FFh
1800h
Page 3
1FFFh
www.nitropdf.com
1FFFh
60
PIC16F87XA
2.2
Bank
00
01
10
11
2.2.1
www.nitropdf.com
61
PIC16F87XA
FIGURE 2-3:
Indirect addr.(*)
TMR0
PCL
STATUS
FSR
PORTA
PORTB
PORTC
PORTD(1)
PORTE(1)
PCLATH
INTCON
PIR1
PIR2
TMR1L
TMR1H
T1CON
TMR2
T2CON
SSPBUF
SSPCON
CCPR1L
CCPR1H
CCP1CON
RCSTA
TXREG
RCREG
CCPR2L
CCPR2H
CCP2CON
ADRESH
ADCON0
00h
01h
02h
03h
04h
05h
06h
07h
08h
09h
0Ah
0Bh
0Ch
0Dh
0Eh
0Fh
10h
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh
File
Address
Indirect addr.(*)
OPTION_REG
PCL
STATUS
FSR
TRISA
TRISB
TRISC
TRISD(1)
TRISE(1)
PCLATH
INTCON
PIE1
PIE2
PCON
SSPCON2
PR2
SSPADD
SSPSTAT
TXSTA
SPBRG
CMCON
CVRCON
ADRESL
ADCON1
20h
General
Purpose
Register
*
Note 1:
2:
TMR0
PCL
STATUS
FSR
PORTB
PCLATH
INTCON
EEDATA
EEADR
EEDATH
EEADRH
General
Purpose
Register
16 Bytes
100h
101h
102h
103h
104h
105h
106h
107h
108h
109h
10Ah
10Bh
10Ch
10Dh
10Eh
10Fh
110h
111h
112h
113h
114h
115h
116h
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
11Fh
Indirect addr.(*)
OPTION_REG
PCL
STATUS
FSR
TRISB
PCLATH
INTCON
EECON1
EECON2
Reserved(2)
Reserved(2)
General
Purpose
Register
16 Bytes
120h
General
Purpose
Register
General
Purpose
Register
80 Bytes
80 Bytes
80 Bytes
Bank 1
EFh
F0h
accesses
70h-7Fh
16Fh
170h
accesses
70h - 7Fh
17Fh
FFh
Bank 2
www.nitropdf.com
180h
181h
182h
183h
184h
185h
186h
187h
188h
189h
18Ah
18Bh
18Ch
18Dh
18Eh
18Fh
190h
191h
192h
193h
194h
195h
196h
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
19Fh
1A0h
General
Purpose
Register
accesses
70h-7Fh
7Fh
Indirect addr.(*)
A0h
96 Bytes
Bank 0
80h
81h
82h
83h
84h
85h
86h
87h
88h
89h
8Ah
8Bh
8Ch
8Dh
8Eh
8Fh
90h
91h
92h
93h
94h
95h
96h
97h
98h
99h
9Ah
9Bh
9Ch
9Dh
9Eh
9Fh
File
Address
File
Address
1EFh
1F0h
1FFh
Bank 3
62
2)
www.fairchildsemi.com
MC78XX/LM78XX/MC78XXA
Description
Output Current up to 1A
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
Thermal Overload Protection
Short Circuit Protection
Output Transistor Safe Operating Area Protection
TO-220
1
D-PAK
1
1. Input 2. GND 3. Output
IN PUT
OUT
SERIES
1
CURRENT
GENERATOR
PASS
ELEMENT
SOA
PROTECTION
PUT
.3
..
:-
I
STARTING
CIRCUIT
t---
REFERENCE
VOLTAGE
t-P-
ERROR
AMPLIFIER
THERMAL
PROTECTION
f----
:
GND
-...
2
Rev. 1.0.1
2001 Fairchild Semiconductor Corporation
www.nitropdf.com
63
MC78XX/LM78XX/MC78XXA
Symbol
Value
Unit
VI
VI
35
40
V
V
RJC
C/W
oC/W
RJA
65
TOPR
0 ~ +125
-65 ~ +150
TSTG
C
C
Output Voltage
Symbol
VO
Conditions
MC7805/LM7805
Min.
Typ.
Max.
TJ =+25 oC
4.8
5.0
5.2
4.75
5.0
5.25
VO = 7V to 25V
4.0
100
VI = 8V to 12V
1.6
50
IO = 5.0mA to1.5A
100
IO =250mA to
750mA
50
Unit
Regline
TJ=+25 oC
Regload
TJ=+25 oC
IQ
TJ =+25 oC
5.0
8.0
IO = 5mA to 1.0A
0.03
0.5
VI= 7V to 25V
0.3
1.3
IO= 5mA
-0.8
mV/ oC
42
V/Vo
62
73
dB
IO = 1A, TJ =+25 oC
f = 1KHz
15
230
mA
2.2
Quiescent Current
Quiescent Current Change
Output Voltage Drift
IQ
VO/T
VN
Ripple Rejection
RR
f = 120Hz
VO = 8V to 18V
Dropout Voltage
VDrop
Output Resistance
Short Circuit Current
Peak Current
rO
ISC
VI = 35V, TA =+25
IPK
oC
TJ =+25 C
mV
mV
mA
mA
Note:
1. Load and line regulation are specified at constant junction temperature. Changes in Vo due to heating effects must be taken
into account separately. Pulse testing with low duty is used.
www.nitropdf.com
64
MC78XX/LM78XX/MC78XXA
Typical Applications
V,
Input
MC78XX/LM78XX
KA78XX
Output
::=CI
Co :~
O.l~F
O.33~F
(,7
Figure 5. DC Parameters
V,
MC78XX/LM78XX
KA78XX
~~~----------~Vo
Output
o---~---t
Input
V,
5.10
,...
......
Input
MC78XX/LM78XX
KA78XX
-r-O.33~F
Vo
Output
i~ RL
"
470~F
120Hz
+.
Input
Output
KA78XX
V,O-----r----1MC78XX/LM78XX
C,
Co
21
www.nitropdf.com
65
MC78XX/LM78XX/MC78XXA
KA78XX
MC78XX/LM78XX
Input
Output
v;
V,
Al
CI
10 2
Vxx
Co
ll'o
10
VXX +
R1
10
Output
Input
MC78XX/LM78XX
KA78XX
V,
VO
2
CI
R1
1!Q
Co
R2
I RI 5IQ
VO = VXX(1+R2/R1)+IQR2
Figure 10. Circuit for Increasing Output Voltage
Input
V,
CI
Output
MC7805
LM7805
LM741
Co
IRI 5 IQ
VO = VXX(1+R2/R1)+IQR2
Figure 11. Adjustable Output Regulator (7 to 30V)
22
www.nitropdf.com
66
MC78XX/LM78XX/MC78XXA
Mechanical Dimensions
Package
TO-220
4.50 0.20
2.80 0.10
(3.00)
+0.10
1.30 0.05
18.95MAX.
(3.70)
3.60 0.10
15.90 0.20
1.30 0.10
(8.70)
(1.46)
9.20 0.20
(1.70)
9.90 0.20
(45
1.52 0.10
0.80 0.10
2.54TYP
[2.54 0.20]
10.08 0.30
(1.00)
13.08 0.20
1.27 0.10
+0.10
0.50 0.05
2.40 0.20
2.54TYP
[2.54 0.20]
10.00 0.20
25
www.nitropdf.com
67
MC78XX/LM78XX/MC78XXA
D-PAK
MIN0.55
0.91 0.10
0.89 0.10
0.76 0.10
0.50 0.10
1.02 0.20
2.30TYP
[2.300.20]
(3.05)
(2XR0.25)
(0.10)
0.76 0.10
www.nitropdf.com
(1.00)
6.60 0.20
(5.34)
(5.04)
(1.50)
(0.70)
2.30 0.20
(0.90)
6.10 0.20
2.70 0.20
0.50 0.10
2.70 0.20
2.30TYP
[2.300.20]
(0.50)
6.10 0.20
MAX0.96
(4.34)
9.50 0.30
0.80 0.20
0.60 0.20
(0.50)
2.30 0.10
9.50 0.30
5.34 0.30
0.70 0.20
6.60 0.20
68
3)
BC107
BC108
BC109
MECHANICAL DATA
Dimensions in mm (inches)
GENERAL PURPOSE
SMALL SIGNAL
NPN BIPOLAR TRANSISTOR
5.84 (0.230)
5.31 (0.209)
12.7 (0.500)
min.
5.33 (0.210)
4.32 (0.170)
4.95 (0.195)
4.52 (0.178)
0.48 (0.019)
0.41 (0.016)
dia.
FEATURES
SILICON NPN
HERMETICALLY SEALED TO18
2.54 (0.100)
Nom.
1
2
PIN 2 Base
PIN 3 Collector
BC017
50V
BC108, BC109
30V
45V
BC108, BC109
VCES
VEBO
20V
BC107
50V
BC108, BC109
30V
BC107
6V
BC108, BC109
5V
IC
100mA
ICM
200mA
Ptot
300mW
Tamb
-65 to +175C
Tstg
-65 to +175C
Semelab plc.
3/99
69
BC107
BC108
BC109
ELECTRICAL CHARACTERISTICS (TA = 25C unless otherwise stated)
Parameter
Typ.
Max. Unit
BC107
15
VCB = 25V
BC108, BC109
15
VCB = 45V
BC107
@Tamb =125C
VCB = 25V
BC108, BC109
VEB = 4V
IC = 0
VCE = 5V
IC = 2mA
Group A
BC107, BC108
110
220
Group B
All Types
180
460
Group C
BC108, BC109
380
800
BC107
110
460
BC108
110
800
BC109
180
800
ICBO(1)
h21E
Min.
VCB = 45V
ICBO(1)
IEBO
Test Conditions
nA
A
A
VBE
VCE = 5V
IC = 2mA
0.7
VBE(sat)(1)
IB = 0.5mA
IC = 10mA
0.83
VCE(sat)(1)
IB = 0.5mA
IC = 10mA
0.25
fT
Transition Frequency
VCE = 5V
IC = 10mA
f = 100MHz
VCE = 5V
Noise Factor
MHz
150
IC = 0.2mA
R = 2k f =1kHz F=200Hz
BC109
BC107, BC108
10
dB
125
260
All Types
240
500
Ratio
BC108, BC109
450
900
BC107
125
500
BC108
125
900
BC109
240
900
Group A
h21e
Group C
Group A
BC107, BC108
1.6
4.5
Group B
All Types
3.2
8.5
Group C
BC108, BC109
6.0
15
C22b
Rth(j-amb)
Group A
BC107, BC108
30
Group B
All Types
60
Group C
BC108, BC109
110
VCB = 10V
f = 1MHz
Ambient
Semelab plc.
pF
500
C/W
3/99
4)
ft
RAT
70
1N4001 - 1N4007
1.0A RECTIFIER
Please click here to visit our online spice models database.
Features
Diffused Junction
High Current Capability and Low Forward Voltage Drop
Surge Overload Rating to 30A Peak
Low Reverse Leakage Current
Lead Free Finish, RoHS Compliant (Note 3)
Mechanical Data
Case: DO-41
Case Material: Molded Plastic. UL Flammability Classification
Rating 94V-0
Moisture Sensitivity: Level 1 per J-STD-020D
Terminals: Finish - Bright Tin. Plated Leads Solderable per
MIL-STD-202, Method 208
Polarity: Cathode Band
Mounting Position: Any
Ordering Information: See Page 2
Marking: Type Number
Weight: 0.30 grams (approximate)
DO-41 Plastic
Min
Max
A
25.40
B
4.06
5.21
C
0.71
0.864
D
2.00
2.72
All Dimensions in mm
Dim
Maximum Ratings and Electrical Characteristics @TA = 25C unless otherwise specified
Single phase, half wave, 60Hz, resistive or inductive load.
For capacitive load, derate current by 20%.
Characteristic
Symbol
VRRM
Peak Repetitive Reverse Voltage
Working Peak Reverse Voltage
VRWM
DC Blocking Voltage
VR
RMS Reverse Voltage
VR(RMS)
Average Rectified Output Current (Note 1) @ TA = 75C
IO
Non-Repetitive Peak Forward Surge Current 8.3ms
IFSM
single half sine-wave superimposed on rated load
Forward Voltage @ IF = 1.0A
VFM
Peak Reverse Current @TA = 25C
IRM
at Rated DC Blocking Voltage @ TA = 100C
Typical Junction Capacitance (Note 2)
Cj
Typical Thermal Resistance Junction to Ambient
RJA
Maximum DC Blocking Voltage Temperature
TA
Operating and Storage Temperature Range
TJ, TSTG
Notes:
Unit
50
100
200
400
600
800
1000
35
70
140
280
1.0
420
560
700
V
A
30
1.0
5.0
50
15
A
8
100
+150
-65 to +150
pF
K/W
C
C
DS28002 Rev. 8 - 2
1 of 3
www.nitropdf.com
www.diodes.com
1N4001-1N4007
Diodes Incorporated
ft
RAT
71
1.0
0.8
0.6
0.4
0.2
0
40
60
80
100
120
140
160
10
1.0
0.1
Tj, = 25oC
Pulse Width = 300 s
2% Duty Cycle
0.01
0.6
180
0.8
1.0
1.2
1.4
1.6
50
100
f = 1MHz
40
Cj, CAPACITANCE (pF)
Tj = 25C
30
20
1N4001 - 1N4004
10
1N4005 - 1N4007
10
1.0
1.0
10
1.0
100
10
100
NUMBER OF CYCLES AT 60 Hz
Fig. 3 Max Non-Repetitive Peak Fwd Surge Current
Packaging
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
DO-41 Plastic
Shipping
1K/Bulk
5K/Tape & Reel, 13-inch
1K/Bulk
5K/Tape & Reel, 13-inch
1K/Bulk
5K/Tape & Reel, 13-inch
1K/Bulk
5K/Tape & Reel, 13-inch
1K/Bulk
5K/Tape & Reel, 13-inch
1K/Bulk
5K/Tape & Reel, 13-inch
1K/Bulk
5K/Tape & Reel, 13-inch
DS28002 Rev. 8 - 2
2 of 3
www.nitropdf.com
www.diodes.com
1N4001-1N4007
Diodes Incorporated
72
Microcontroller Based Solar Charger
ADVANTAGES
No noise
Easy to install
Simple to operate
Pollution free working
Low maintenance cost
Generating panel has a long life
SNGIST
73
Microcontroller Based Solar Charger
CONCLUSION
In future, India will have to depend on renewable energy. The only source available around
us is sunlight, and we can easily convert sunlight energy into electrical energy by using PV
cells to meet our requirement.
However to extend use of solar power energy to industrial and commercial areas, the price
of PV cells need to be brought down through low-cost manufacturing techniques.
By using the solar energy power generation technology the usage of non-conventional
resources can be minimized which not only reduces the resource extinction but helps widely
in reducing the environmental pollution.
By Generating Power Through Solar Energy The Cost Of Electricity Can Be
Minimized And Occasionally Can Be Provided With Free Of Cost.
Electricity Can Be Supplied Even To Remote Areas With Out The usage Of
Transmission Lines.
SNGIST
74
Microcontroller Based Solar Charger
REFERENCE
SNGIST