MPPT charge controller on Arduino

Reading time: 3 min.

When recharging batteries, it is necessary to ensure the correct current characteristics in order to prevent overcharging. This increases the life of the battery within the solar panel – battery system. When the critical voltage is exceeded, the regulator disconnects the energy source, and the same happens when the battery is fully charged. This paper presents an example prototype of an Arduino-based solar battery charger that operates on the principle of maximum power point tracking (MPPT).

Functions and purpose of the MPPT controller

The MPPT controller is responsible for charging the battery in different modes, protects the battery from damage due to overcharging and also protects the solar panel from overcurrent. Other functions of the MPPT controller are battery overload protection (undervoltage lockout) and charge level tracking. Today’s modern batteries, such as lead-gel batteries, require a 3-stage charge.

When the battery is deeply discharged, bulk charging is initiated, i.e. with a current corresponding to the battery capacity. In this mode, the battery is charged with a constant current up to about 80% of its total capacity. When a certain voltage threshold is reached, the controller switches the charging process to absorption mode. In this mode, the battery is charged with a constant voltage, but with an increasingly lower current. When the absorption phase is complete, the charge controller switches to voltage hold mode and charges the battery with a current that is 1% of the battery capacity divided by one hour, e.g. for a 2Ah battery this would be 2mA.

In our prototype, we will use a battery with a nominal voltage of 12V and a capacity of 2Ah, which can be charged with a maximum voltage of 14.4V and a current of 2A.

Building a prototype MPPT charge controller based on Arduino and its principle of functioning

Our MPPT charge controller must be able to read the output and input voltages and currents, and perform the necessary calculations to enable the necessary optimisation of the charging process. For this purpose, we will use the dedicated ACS712 module as a current sensor. The voltage boost converter, on the other hand, will be controlled using a PWM signal source from the Arduino and a MOSFET transistor or electromagnetic relay, which will switch the load on and off. To read the charging parameters, we will use a 4×20 LCD display (four lines of twenty characters each). You will also need an inverter to step down the voltage to 5V to power the Arduino board.

 loading=

CHECK AT STORE

MPPT charge controller – program code for measuring and stabilising the charge current at a constant level

The following program code is intended to control the limitation of the charging current to 1A. Therefore, if too high a charging voltage is connected, the MPPT controller is designed to limit the charging current to a software-set value. This is done by appropriately decreasing and increasing the fill factor of the PWM waveform controlling the gate of the MOSFET transistor to relatively stabilise the charging current to 1A.

Program code:


					
				

MPPT charge controller – program code for measuring and stabilising the charge voltage at a constant level

The next part of the program code is responsible for maintaining a voltage with a constant charging value. In the case of our project, this will be a value of 12V. The code considers all three phases of the battery charging process.

Program code:


					
				

MPPT charge controller – program code for measuring and stabilising the maximum power point

The last part of the program code for the MPPT controller, is responsible for calculating and stabilising the maximum power point at which the most optimal conditions for charging the battery occur. The program performs comparative measurements of currents and voltages and switches between charging modes when certain conditions are met.

Program code:


					
				

Arduino as MPPT controller – summary

 loading=

The MPPT charge controller concept presented here illustrates a simple prototype that, while performing sufficiently, still has some limitations due to the low efficiency of the photovoltaic panels, among other things. However, as solar panel technology improves, the efficiency of the panels will increase and, combined with the use of the MPPT algorithm, photovoltaics will become even more economically advantageous. Over time, such technology will perform even better in powering loads with increased electricity consumption.

How useful was this post?

Click on a star to rate it!

Average rating 4.4 / 5. Vote count: 5

No votes so far! Be the first to rate this post.

Share:

Picture of Maciej Figiel

Maciej Figiel

Versatile, he is eager to take on challenges because he thinks it is the fastest way to progress. He values contact with nature and an active rest. Automotive and new technologies enthusiast.

See more:

Leave a Reply

Your email address will not be published. Required fields are marked *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.