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 system’s overall success depends mainly on it. It is considered as an indispensable link between the solar panel, battery and load.
The microcontroller based solar charger controller described here has the following features:
- Automatic dusk-to-dawn operation of the load.
- Built-in digital voltmeter (0V-20V range)
- Parallel- or shunt-type regulation
- Overcharge protection
- System status display on LCD
- Deep-discharge protection
- Low battery lock
- Charging current changes to ‘pulsed’ at full charge
- Low current consumption
- Highly efficient design based on microcontroller
- Suitable for 10-40W solar panels for 10A load

The circuit of the solar charge controller is shown in Fig.1. It comprises microcontroller AT89C2051, serial analogue-to-digital converter ADC0831, optocoupler MCT2E, regulator 7805, MOSFETs BS170 and IRF540N, transistor BC547, LCD and a few discrete components. Component description is given below.
Microcontroller
Microcontroller AT89C2051 is the heart of the circuit. It is a low-voltage, high-performance, 8-bit microcontroller that features 2 kB of Flash, 128 bytes of RAM, 15 input/ output (I/O) lines, two 16-bit timers/ counters, a five-vector two-level interrupt architecture, a full-duplex serial port, a precision analogue comparator, on-chip oscillator and clock circuitry. A 12MHz crystal is used for providing the basic clock frequency. All I/O pins are reset to ‘1’ as soon as RST pin goes high. Holding RST pin high for two machine cycles, while the oscillator is running, resets the device. Power-on reset is derived from resistor R1 and capacitor C4. Switch S2 is used for manual reset.
Serial ADC
The microcontroller monitors the battery voltage with the help of an analogue-to-digital converter. The ADC0831 is an 8-bit successive approximation analogueto- digital converter with a serial I/O and very low conversion time of typically 32 μs. The differential analogue voltage input allows increase of the common-mode rejection and offsetting of the analogue zero input voltage. In addition, the voltage reference input can be adjusted to allow encoding of any smaller analogue voltage span to the full eight bits of resolution. It is available in an 8-pin PDIP package and can be interfaced to the microcontroller with only three wires.
i need to know the cost of kit for micro controller based solar charger
I make this project display show in LCD but i attached solar panel don’t show charging status on LCD any buddy help me for this issue. Thank you
Please make complete connections and then only you should attach your solar panel in the circuit. Some people faced problems because of incomplete connection or mcu is not programmed correctly.
Can we use other microcontroller of atmega????
You cannot replace directly with Atmega, you need to change the code.
is it double layer pcb which is attached ? if not so where is the D1 and relay in this circuit
Hello,
this project is interesting and thanks for it
i am doing similar project but i am using PWM to control the charging the battery
guys any one know where i can find a circuit that used PWM to charge a battery
Yes, please refer to Photovoltaic battery charger from this link: https://www.electronicsforu.com/electronics-projects/photovoltaic-battery-charge-controller
I have make the circuit in proteus and burn the hex file in the controller. But the LCD Showing garbage.. please help
Hello
Thank you for your excellent site and topics that are of great help for me and most of those who read electronic
But we have fault in the circuit schematic and pcb is part of relay, for example, are not correct in pcb and we dont have D1 in pcb
Please input the correct pcb
Thanks
Same problem need help
Where is the D1 and RL1 in this attached pcb ? how connect ?
Is it complete PCB?
hello there,
can anyone help me with the correct PCB? is the schematic is correct? then where to connect solar panel’s negative, D1 and relay? actually after connecting solar panel’s negative, D1 (one pin on PCB and other with RL1 thru a hookup wire) and relay as per PCB, Relay do get operated but there is NO ground given to negative of solar panel. The status message on the LCD (line 1) “BAT.LOW-LOAD OFF” doesn’t go and never comes on “Charging..” status rather it do show the Battery Voltage. Someone please help me on this issue. Thank you.
We have not received any complaints on the PCB as well as schematic so far. Diode D1 is not shown on the PCB because it has to be connected externally. The negative terminal of solar panel should be connected to any ground rail on the PCB. Make sure transistors T1 and T2 and ADC chip are working properly. Check the battery level is above 10V. If all these things are working well and as per explained in the text, you will not get the message “BAT.LOW-LOAD-OFF” on the LCD. Sometimes the data in the MCU may get corrupted, so you may try it by re loading the program.
Hello Admin
i m facing same issue like kanu.You can tell me this issue for mcu is not programmed correctly . plz send me correct hex file for this project.i m checked all connection its perfect connected. My email [email protected]. ThnQ
The complete source code including the hex code is available here.
does this project is correctly connected because i did it twice but didnt show any display on lcd?
can this program work for 24v
Hi..is this the correct schematic for the project. While.I was going through a lot of comments on the project I have seen that there were some.problems with the Lcd, relay and Diode D1. Because i need a charge controller for my street lighting project and this fits all my requirements.
@efylab I dont know where the problem lies but the lcd is displaying garbage values….do u have the .c file of the code.
First, check the correct connections to LCD, download the hex code again from our website, burn the code into the MCU and see if you are still getting garbage values. This project was designed in Assembly language and not C language, so .c file is not available.
This is awsame ! can we use this circuit as a common lead acid battery charger ?What modification to be need for that ?
Regards
Ajitkumar
hello EFYLAB,its not generating PWM signals and Same above mentioned problem LCD displaying garbage value..please be clarify and replace it with working code please..
Can we use this project for automatic turn-off mobile Battery [email protected]