Maximum Power Point Tracking (MPPT) methods are frequently used in photovoltaic systems to maximize photovoltaic power generation (PVG). The principle of these technologies is making PVG reach the maximum power point (MPP), depending on environmental factors such as solar irradiance and ambient temperature, ensure the best power transfer between PVG and load. In this article, we present the implementation of a MPPT command using the Arduino nano board. The proposed MPPT command is based on Perturbation and Observation Algorithm (P&O). The PV system is simulated and studied using Proteus software. Results show that the algorithm shows good results in time response and oscillations.
Keywords: Buck Converter; MPPT; P and O; Incremental Conductance; Arduino
Received: Jun 3, 2020 · Revised: Dec 12, 2020 · Accepted: Jan 5, 2021 · Published: 2021-01-25
Corresponding author: Anas El Filali, [email protected]
This is an open access article under the CC BY 4.0 license.
How to cite: Anas El Filali, Malika Zazi, "Arduino implementation of MPPT with P and O algorithm in photovoltaic systems," International Journal of Engineering and Applied Physics, vol. 1, no. 1, pp. 9–17, 2021.
Recently, the inevitable cost of using fossil fuels to generate electricity has aroused great interest in green energy. Among these green energy sources, solar energy is probably the most important one, because it is different from wind, geothermal, ocean waves, etc., and is almost everywhere. Since the initial investment of solar power plants is high, it is necessary to increase the return on investment. Improve efficiency by maximizing efficiency. Efficiency can be improved by developing materials for photovoltaic (PV) cells and improving the energy management of the system to absorb the maximum available power of PV. Maximum power point tracking (MPPT) is usually achieved by a power electronic converter, which used as an interface between the PV array and the consumption point in the power system. Generally, the PV system can be a stand-alone system or a grid-connected system. In the first case, the output voltage of the system must be kept within the standard range and power failure must be avoided [1].
Many MPPT methods have been proposed in the literature [2-5] Use the Perturbation Observation (P&O) method for MPPT. In this method, the voltage or current is increased, and then the power is measured. If the power measured in the previous state has improved, proceed to the next step. Otherwise, the converter will start to reduce the voltage/current and perform the same process until it reaches MPP. The main disadvantage of this method is that the MPP cannot be tracked when the exposure changes too fast. The incremental conductance (Inc.Cond) proposes a faster way to track MPP, which was studied in [5-7]. This method tracks the MPP by changing the voltage and current supplied to the load and periodically measuring the instantaneous and incremental conductance to reach the minimum of the two parameters [8,9]. Moreover, the converter topology is one of the important issues that change the efficiency and speed of the system. Artificial intelligence methods for MPPT have also been studied, such as fuzzy logic and neural networks [10- 14]. However, for these methods, it is reported that these methods have fat tracking and good performance under different atmospheric conditions. The main disadvantage of this method is high complexity. This article introduces two different topologies of MPPT step by step. The traditional buck converter is one of the most popular topologies, used to control the position of the operating point together with the MPPT.
Section 2 covers theory of step-down DC-DC converters for photovoltaic systems. Section 3 discusses structure of P&O algorithm. Section 4 presents the simulation work. Finally, a conclusion will be given in Section 5.
In the wiring diagram of the Buck converter, the inductor, capacitor, and diode are readily available on the market. The inductor should be a ferrite core or an iron core for high current or power applications. The switching time of the diodes from on to off and vice versa must be fast. We opted for the use of a Schottky diode because it has low conduction losses. However, the diodes have a considerable voltage drop which reduces the efficiency of the converter. It is also possible to use another switch instead of the diode. To improve efficiency, a switch from the power electronics is used instead, this type of Buck converter is called a synchronous Buck converter in which the D-diode is replaced by an electronic switch such as the MOSFET.
Typically, the MOSFET is used in converters because of its low resistance, high switching frequency and high-power handling capability. The MOSFET can be used either as a low side MOSFET driver or as a high side MOSFET driver. Now why do we need a MOSFET driver when it can be controlled by applying a voltage to its grid? MOSFETs are voltage-controlled devices. They have a high source grid impedance. To achieve high switching speed, a MOSFET driver is needed. Another reason to use the MOSFET driver as a gate driver is that the output of the PWM ARDUINO NANO is 5 V and to control the MOSFET we need to apply a MOSFET gate voltage between 10.5 and 12 V. Thus, the gate driver is also used to translate the voltage level of the PWM square wave. MOSFET can be used at the bottom or at the top. If the load is connected to the source pin of the MOSFET, it is called the upside-down configuration, and if the load is connected to the drain pin of the MOSFET, it is called the downside-down configuration. There are many drivers available on the market, but we use the IR2104 as a MOSFET gate driver.
Simulation is a very powerful tool to understand how the device will work after implementation. Before starting a project, it is a good idea to imitate it and to virtually check how it will work. Proteus is a simulation and design software tool developed by Labcenter Electronics for the design of electrical and electronic circuits. We took advantage of its capabilities to simulate our Buck converter before proceeding to the realization. Figure 1 shows the schematic of the converter simulated in ISIS Proteus.

We often have to use MOSFETs configured as up and down side switches. As in half-bridge circuits, we have a high-side MOSFET and a low-side MOSFET. In such situations, it is necessary to use high-side control circuits at the same time as low-side control circuits. The most common way to drive MOSFETs in such situations is to use both high-side and low-side MOSFET drivers. The most popular control circuit is the IR2104.
The Integrated Circuit receives the PWM signal from the Arduino and then controls two outputs for a high and a low MOSFET. First, we need to provide the power supply to the driver through Vdc (pin 1) and its value is between 10-20 V according to the data sheet. The high frequency PWM signal of the Arduino goes to IN (pin 2). The Arduino's stop control signal is connected to SD (pin 3).
The two PWM output signals are generated from pins HI and LO. This gives the user the possibility to fine-tune the switching of the MOSFETs.
The capacitor connected between VB and VS with the diode forms the charge pump. This circuit doubles the input voltage so that the high switch can be activated. However, this bootstrap circuit only works when the MOSFETs are switching. Figure 2 shows the output signals from pins HI and LO.

The P&O method is often used in photovoltaic systems. Based on the P-V characteristic, when PV power and voltage increase, a disturbance will add a step size ΔD with the duty cycle D, to create a subsequent disturbance cycle and move the working point moving to MPP. With the chance that the PV power decreases and the PV voltage increases, the algorithm works in the opposite way until the algorithm reaches MPP. This algorithm is not suitable for high variation of solar radiation. The voltage oscillates around the maximum power point (MPP) and never reaches an exact value.
The main advantage of the P&O method is the simple implementation and easy coding of it with cheap digital devices in addition to ensuring high durability. Nevertheless, this method presents/shows oscillations around the MPP and suffers when exposed to a rapidly irradiated change. [15-19]. Figure 3 shows the flow chart of a P&O algorithm

Specifications of PV panel are presented in Table 1.

The schema is divided into seven zones as shown in the following figure:

Zone A: is the system input which is the solar panel that provides power to the system. The F1 fuse and the TVS protect the circuit against any high currents that could reach the circuit. the Arduino's analog input (A0) must not exceed the maximum voltage limit, which is 5V, so we use a voltage divider bridge (R_1 and R_2) to reduce the voltage provided by the solar panel. The output voltage of the voltage divider is equal to one sixth (1⁄6) of the input voltage. Therefore, the maximum value of the PV array voltage should not exceed 

Zone B: is the Hall-effect current sensor of the current supplied by the PV panel. The capacitor is a filter capacitor.
Zone C: is the Buck converter. The IR2104 circuit controls the pair of MOSFETs Q1 and Q2 to allow current to flow inside the coil. The output of the converter is connected to the battery.
Zone D: is one more voltage divider connected to analog pin (A2) of the Arduino. This supplies the battery voltage to the Arduino for measurement.

Zone E: The Arduino output pin (D6) controls the base of the NPN transistor Q4, which in turn controls the gate of the MOSFET Q3 transistor responsible for enabling/blocking the flow of current from the battery to the load. When D6 is low (0 V), the base of Q4 will be high, and the MOSFET Q3 will pass the current. Whenever D6 is high (5 V), the base of Q4 will be high, and MOSFET Q3 will be open circuit and current flow will be blocked.
Zone F: is a serial LCD display which communicates with the Arduino using the I2C protocol.
Zone G: gathers the visual indication LEDs used to indicate the battery voltage level. To protect LEDs from damage, we add Resistors R11, R12, R13 to limit the current and operate them with almost 2V.
The set of instructions that takes place inside the Arduino board is divided into two main parts. The setup phase: at first startup, the system initializes its input and output pins, declares all variables, constants and functions to be used during the process:
- minimum battery voltage: 11.5 V;
- maximum battery voltage: 14.4 V;
- and others.
The system then initializes the LCD display configurations, disables the output control MOSFET, disables the MOSFET driver and sets the PWM rate to 0%.
It starts reading its analog inputs:
- the voltage generated by the PV panel;
- the current consumed by the PV panel;
- the battery voltage.
Once all the inputs are read, the system calculates the current delivered by the PV panel.
Then, the charging configuration is defined according to the measurements below:
- if the PV array power supplied is very low (night, cloudy weather, dirty panels), the state of charge is set to OFF, the MOSFET driver is stopped, and the PWM rate is set to 0%;
- if the PV array power supplied is low and the battery is not fully charged, the state of charge is changed to ON, the MOSFET driver is activated and the PWM rate is set to 100%;
- if the PV array power supplied is medium to high, and the battery level is not fully charged, the state of charge is set to Bulk, the MOSFET driver is activated, and the PWM rate is set according to MPPT;
- if the PV array power supplied is medium to high, and the battery level is fully charged, the state of charge is set to Floating, the MOSFET driver is activated, and the PWM rate is set to minimum.
The next task is to set the output charge control:
- If it is dark and the battery voltage level is higher than the "low cut-off voltage" of 11.5 V, the output is activated and the battery supplies power to the load;
- If it is daylight and the battery voltage level is higher than the "low disconnection voltage" threshold of 11.5V, the output is also activated, but this time the load is powered by the battery and the excess energy supplied by the PV panel;
- if the battery voltage level is below the "low disconnection voltage" threshold, the output is also activated, but this time the load is powered by the battery and by the excess energy supplied by the PV panel, which is 11.5 V. The output is deactivated and the load is disconnected.
The next step is to adjust the battery voltage indicators by turning on the LEDs:
- if the battery voltage level is below 11.5 V, the RED LED is lit;
- if the battery voltage level is higher than 11.9 V but lower than 14.1 V, the GREEN LED is lit;
- if the battery voltage level is higher than 14.4 V, the YELLOW LED is lit.
The Arduino then updates the information displayed on the LCD screen according to the above processes and starts a new reading of the inputs to start the loop. It then repeats this loop continuously.
Initially, I used a linear voltage regulator LM7805 to lower the battery voltage to 5V for the power supply, but it produces a lot of heat during its operation, so we used an automatic Voltage Boost and Lower converter (the output can be higher or lower than the input), based on XL6009, the integrated 4A MOSFET switches allow an efficiency up to 94%, high switching frequency 400KHz, the ripple is smaller, the dimension is smaller.

First of all, we have to adjust the output voltage of the buck converter, for this we first connected the battery to the input terminal of the converter and adjusted the potentiometer to get 5V at the output. Looking at the output voltage, it seems that our ripple is 15 millivolts and this is quite acceptable.
Before the final realization of the board, we tested the correct operation of the battery charge control circuit on a double-sided prototyping board. Figure 6 shows the realized circuit.

Figure 7. And 8 summarizes the experimental responses of power Ppv, of voltage Vpv during Bulk charge of the
battery.


These responses shows that the operating point reaches the MPP with some important oscillations around the Maximum Power Point.
In this article, we have introduced the implementation of the P&O command using an Arduino nano board. The simulation results demonstrate that the P&O MPPT reach the expected value of power as shown also with experimental results. It has observed that P&O oscillates all over the MPP which causes waste of power.
The similarity of the P&O algorithm and others such as Incremental Conductance will be investigated deeply in a future work, And will be implemented in a real board using an LCD touchscreen Nextion as a Human Machine Interface (HMI) to ensure a good control of the PV system and add more options.