Microcontroller Based Solar Charge Controller Project
Microcontroller Based Solar Charge Controller Project
Microcontroller Based Solar Charge Controller Project
www.amateurworld.in
Page 1 of 5
Should have at least two analog I/O for measurement of Solar and Battery Voltage.
Otherwise we have to add extra AD converter for the job and it will increase the complexity
of the circuits and cost.
Should have at least two digital I/O, capable of switching High Current MOSFET for battery
charging and load.
AMATEUR WORLD
www.amateurworld.in
Should have at least three digital I/O capable of driving direct LEDs, otherwise we have to
add extra LED driver for the purpose.
Should have minimum circuit requirements for its self operation to cut down the cost.
Keeping in the mind all above things, we have found AVR and Microchip variants of 8-bit controllers
can do these jobs very well. So we decide to go for ATMEGA8 (which is AVR variant) microcontroller
for this project.
Schematic Diagram of hardware circuits:
Schematic Descriptions:
IC1 is ATMEGA8. For minimum circuits operation it requires only one 10K Resistor (R14) at
reset pin. It has got no crystal as we will use its internal RC Oscillator. L1, L2, L3 are three
LEDs for event indication and as ATMEGA8 can directly drive LEDs we have added only
current limiting resistors of 330 Ohm.
LM7805 (IC2) voltage regulator is there to produce 5V to supply ATMEGA8.
Q3 and Q4, these two small NPN transistors are there to drive two MOSFET, Q1 and Q2
respectively.
SB540 (D1) is a Scotty Diode, which will prevent the battery being drain at night time.
R16 and R15 forms a voltage divider to measure Solar Cell Voltage as because
microcontroller can only measure maximum +5V directly. Zener diode D4 (5V1) is to prevent
Page 2 of 5
AMATEUR WORLD
www.amateurworld.in
any accidental over voltage. Similarly there are R8, R9 and D2 for measurement of Battery
Voltage.
We have added two potentiometer R1 and R2 for easy adjustment of Battery High Voltage
(at which charging will stop) and Battery Low Voltage (at which charging will starts and Load
will be off). These two POTS are optional but it adds the flexibility of the system as with
these two POT, user can alter the battery settings at their will.
Software Basic:
As microcontroller software works as sequential basis, it will perform these steps
sequentially.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
As we have found BASIC language so easy to understand and easy to implement at AVR
microcontroller, we have use it with the help of BASCOM AVR Compiler. Bellow is the complete
code for the project in BASCOM.
Page 3 of 5
AMATEUR WORLD
www.amateurworld.in
AMATEUR WORLD
www.amateurworld.in
Page 5 of 5
AMATEUR WORLD
www.amateurworld.in