MPPT Solar Charge Controller
Introduction
The Objective of this project is to design a device to prevent batteries from over-charging and increase batterey life. A normal 12V-14V rated Solar Panels produce 16V-18V at peak sun. The Maximum Power Point Tracking Solar Charge Controller will regulate the output voltage for effective charging of batteries. It also helps prevent backflow of current from batteries to solar panels at night. MPPT solar charge controller monitors the voltage and current output of the solar panel and determines the voltage that the panel will produce at the maximum efficiency.
Project Execution Plan

Distribution of Tasks
This project is a job of Team-work. I and my project memeber have different skills. So, we'll divide tasks according to our skills. The skill in which he's master, he'll lead in those tasks and I'll lead those tasks in which I've prominenet skill. Here is the table explaining division of jobs on the basis of our skills.
Tasks | Khalid Hussain | Zaheer Khalid |
Literature Review | Yes | |
Design of Schematic | Yes | |
PCB Designing | Yes | |
Hardware Implementation | Yes | |
Software Implementation | Yes | |
Troubleshooting | Yes | Yes |
Design of Enclosure | Yes | Yes |
Report Writing | Yes |
High Level Design
Here is the Block Diagram for the my project. I've done some changes while implementing this block diagram idea. But major idea is the same.

Description of Principle of Operations
In this project, we've current and voltage sensors at input and output terminals which will constantly give input results to our Micro-Controller. On our Micro-Controller, we've programmed algorithms of Maximum Power Point Tracking Phenomenon. Micro-Controller will generate PWM (Pulse Width Modulatin) signal to control Voltage by using MOSFETs. MOSFETs will switch continuously due to PWM signal to control and regulate voltages. This operation of MOSFETs is actually the Phenomenon of D-Class Amplifiers.
Choice of Componenets/Bill of Material
-
ATMEGA 32u4 (Micro-Controller)
ATMEGA-32u4 is a powerful micro controller which have a USB interface inside it. It's the major reason that I preffered ATMega-32u4 over other micro controllers. Moreover, these are the major feature which this micro controller have.- 32K bytes of In-System Programmable Flash with Read-While-Write capabilities
- 1K bytes EEPROM
- 2.5K bytes SRAM
- 26 general purpose I/O lines (CMOS outputs and LVTTL inputs)
- 32 general purpose working registers
- four flexible Timer/Counters with compare modes and PWM
- one more high-speed Timer/Counter with compare modes and PLL adjustable source
- one USART (including CTS/RTS flow control signals)
- a byte oriented 2-wire Serial Interface
- a 12-channel 10-bit ADC with optional differential input stage with programmable gain
- an on-chip calibrated temperature sensor
- a programmable Watchdog Timer with Internal Oscillator
- an SPI serial port
- IR 2104 (Half-Bridge Driver)
A gate IR2104 driver is a power amplifier that accepts a low-power input from a controller IC and produces a high-current drive input for the gate of a high-power transistor such as a power MOSFET.

- INA 213 (Current Shunt Monitors)
INA213 is used as Current Shunt Monitors which is used to sense current through a shunt resistor in a circuit.

Design
Design of Project Electrical Scematic Design, PCB Board Design, Software Design and Enclosure Design for the Project. Following is the detail of design of Project.
Electrical Schematic Design
I designed the schematic for my project on Eagle Software. During the schematic design the major concern was the appropriate pin selection of different ICs. I'm using ATMega32u4 Micro-Controller IC. After studying its datasheet, I connected my sensors and actuators very carefully. Moreover during the schematic design, power supplies to your components is a critical matter. Some ICs need 5V and some need 12V. I provided carefully each IC its required voltage.I've explained the phenomenon of my project above. Here, you can see the image of my electrical schematic zooming by hovering cursor over it.
I'm sending sensors data to Micro-Controller through analogue pins and receiving actuators data through digital pins. Micro-Controller is sending PWM Signal to control voltage and feeding information to 16X2 LCD.
I'm using Voltage Regulator circuit to convert 12V supply into 5V output for components.
The major portion of circuit is MPPT Charge Controller Circuit. It has voltage divider circuit for voltage sensing and a current shunt monitor for current sensing at input. It has Half-Bridge Driver IC which receives PWM signal from Micro-Controller and amplifies it for Power MOSFETs. Power MOSFETs switch accordingly the duty cycle of PWM signal and regulate the voltage. And then we've current and voltage sensors at output.
Hover the cursor over the below image to see zoomed details of Electrical Scematic.

PCB Layout
Here is the PCB layout image of my circuit Board.

Challenges faced while Routing
We faced many challenges while routing of Board file. The major issue of overlapping lines. We resolved this issue by using 0Ω resistors in SMD and DIP packages. For some DIP comonents we've to increase drills diameter. The major challenge for us to sort out a maze of lines in a well-sorted way. This job gave us really a tough time. We used appropriate width of lines by keeping in mind the amount of current flowing through the lines.
Clean Printed Circuit Board

Populated Printed Circuit Board

Bootloader Burning Operation
I burnt bootloader into my Controller Board using SPI Header. I just connected it with my PC, opened Arduino IDE and uploaded a simple program to burn bootloader. After getting my board functional, I tested it for LED blinking program and it resulted successfully.

Software Development
Flow Chart of Software

Challenges faced in Coding
I was actually using source code from soldernerd.com website. This code was developed for Arduino UNO Board. I've to implement this code on Arduino Leonardo Board, so made some changes in Timers and Registeers selection and their pre-Scalar adjustment. I used Timer2 of ATMega32u4 which is a 16 bit Timer. I adjusted pre-scalar to get my required output.
Describe the structure of your software. In a pictorial format you may describe the flow of your algorithm and how you have used the functions to implement the code in an efficient way.Design of Enclosure/Casing
I designed the casing of my project on Solid Works Software. I measured proper dimensions for my Circuit Board, LCD and Connectors and then designed according to my requirements.
Results
After populating my circuit board, I attempted many times to get my board functional. On my 21st attempt, I got successful results. I troubleshooted the code for my circuit a lot to get my desired outputs.
Here you can see the image of my fully functional circuit.

Final Successful Attempt Video
Here is the video of my final successful attempt.
Business Model
This Project can be implemented on commercial level. The basic purpose of this project is to conserve battery life. We can see many equipments where we use rechargeable batteries. This Charge controller can be used in vehicles, big machines, small electronic components like laptops where we charge batteries. By varying power rating of this project, we can use it on any scale.
In Pakistan, we can implement this idea for villages where there are no electric power supply lines. People are attracted to rapidly growing Solar Panels technology for power generation, but they are afraid to invest money on Solar Panels Power Generation Project due to very low life of Lithium-Ion Batteries. By improving the power rating of my MPPT Solar Charge Controller circuit, we can give the rural areas of Pakistan a good hope to invest on Solar Panels technology and batteries to save power for night. This MPPT Solar Charge Controller will actually increase battery life to some extent.
Appendix
My project is an open source work. You can get benefit from my work and update it for your requirement. I'll be thankful for your positive feedbacks and suggestions.
Click on the logo below to download the Schematic and Board files for the circuit:
Click on the logo below to download the Source Code for the circuit:
Click on the logo below to download the CAD Design Files for the Enclosure:
References
I got help from these sources and persons. I'm providing their links so you may utilize their work.
https://soldernerd.com/mppt-solar-charger/
https://www.instructables.com/id/ARDUINO-SOLAR-CHARGE-CONTROLLER-Version-30/
Dr. Muhammad Asim Samejo (Assistant Professor at Sukkur IBA University,Pakistan)
http://www.iba-suk.edu.pk/faculty/details/INS-0011
Nadir Ali (Fab Lab Attendant at Sukkur IBA University, Pakistan)
https://www.researchgate.net/profile/Nadir_Ali8
Engr. Aizaz Ali Larik (Lab Engineer at Sukkur IBA University,Pakistan)
http://www.iba-suk.edu.pk/faculty/details/INS-0424
Sagheer Abbas Shah ( Undergraduate Electrical Engineering Student at Sukkur IBA University, Pakistan)
Contact Us
You can contact us to get any sort of help related to this project.
Zaheer Khalid (Undergraduate Electrical Engineering Student at Sukkur IBA University, Pakistan)
Email: [email protected]
Contact: +92 342 9517366
Khalid Hussain (Undergraduate Electrical Engineering Student at Sukkur IBA University, Pakistan)
Email: [email protected]