Supervision of a PV system with storage connected to the power line and design of a battery protection system

This work presents the supervision strategy in an Arduino card PV generator with storage connected to the low voltage grid. The studied system is composed of a photovoltaic generator, a boost converter, a buck-boost converter and a single-phase inverter. The power of the PV module depends on atmospheric conditions. Batteries are often confronted with overload problems and underload. The objective of this article is to manage the charging and discharging of the batteries, taking into account their protection against overload and under load and supervise the system. For this, supervision algorithms implemented in Arduino developed. Simulation results under Matlab show that the Arduino board has ensured the protection of the batteries and system supervision.


Introduction
Energy is the development of any country engine. It generally comes from fossil sources that are endangered and renewable (clean) whose use is becoming more and more numerous. Among the clean energy, photovoltaic (PV) technology is the most used. Today's power plants are either stand alone or be connected to the Electrical Distribution Network (EDN). The electrical characteristics (current-voltage) of GPV are sensitive to changes in atmospheric conditions. The use of the storage system (eg battery) is often essential. The battery is facing phenomena overload and underload [1]. The transfer of energy for supplying a variable load and injection to the network in case of surplus production is a problem. This is why we consider it necessary to use a battery protection system and a monitoring strategy for energy management. But in the literature, there is work to solve its problems. For example for batteries, in [2], the optimal feedback control technique for the state of charge (SOC) of the storage batteries energy (BSE) is used. The results is acceptable and method is effective. A smart charge controller is designed in [3] in order to extend the life of the battery. It has benefit functions for monitoring and control than the logic controller and conventional relays. A control strategy taking into account the load and the depth of discharge is used in [4] to avoid overload and under load batteries. The result is acceptable. The roulette redistribution mechanism is proposed in [5] with the power distribution algorithm based on the PSO (Particle Swarm Optimization). The proposed method improves the efficiency of 0.82% to 1.76% of system. The technique discussed in the monitoring system proposed in [6] uses an Arduino microcontroller. This approach clearly detect the location of the error according to information acquired and collected. To manage energy production of a multi-source system, Multi-Agent System (MAS) is proposed in [7] which are a connection of several fields such as artificial intelligence, distributed computer systems and engineering. The results showed that the SMA is very flexible due to their distributed structure and can also adapt to changes in energy systems to renewable sources. In [8], a centralized power supervisor is established to determine the reference power levels depending on the conditions of supply and demand. The simulation results obtained in Matlab / Simulink environment show the effectiveness of the proposed control scheme. The DSP microcontroller TMS320F2812 is used in [9] to construct the controller circuit for the power management system composed of photovoltaic generator and battery. The simulation and experimental results show a better performance of the proposed controller.
So with all these examples, we see that there is firstly more supervision strategies photovoltaic systems and other intelligent approaches to control charging and discharging. But we offer as part of this work simply smart approach monitoring of PV systems with BS connected to the RBT based on Arduino. The latter is a common material printed circuit on which is a microcontroller which can be programmed. The advantages of this card is that it is inexpensive, it facilitates electrical installations, it has a clear and simple programming environment and can perform a variety of tasks such as home automation (control of domestic appliances -lighting, heating ...). We call it ''magic card''. The Arduino system gives us the opportunity to combine the performance of programming to those of electronics. The Arduino board is programmable in a language similar to C that many researchers do not mastered. And in this paper we have proposed a novelty that is to use matlab language to drive the Arduino card (AC). And the latter is used for optimal power management and both ensure proper regulation of BS. And in this paper we have proposed a novelty that is to use matlab language to drive the Arduino card (AC). And the latter is used for optimal power management and both ensure proper regulation of BS. And in this paper we have proposed a novelty that is to use matlab language to drive the Arduino card (AC). And the latter is used for optimal power management and both ensure proper regulation of BS. This article will consist of three sections: Sect. 1 modelling, Sect. 2 supervisory strategy of the proposed system and Sect. 3 results and discussion.
2 Modeling of the proposed system A model is a simplified representation of a system or a physical phenomenon to reproduce its functioning, analyze, explain and predict some aspects.

Modeling of GPV
The IV characteristic of a PV cell is not linear and depends on multiple parameters [10]. Figure 1 shows the photovoltaic model where I ph represents the generated current for a given radiation, I out the current produced by the cell to the external circuit, V out is the voltage at the output terminals, a diode parallel with a current source, R s series resistance and R p shunt resistance of the cell. R s and R p are considered for precise and accurate results.
This model (see Fig. 1) is used by the authors for a good understanding of the operation of a solar cell. It establishes a relationship between the charging current (I out ) and load voltage (V out ). Equation 1 shows this relationship: When neglecting the effects of the parallel resistor and the series resistance, we find Equation 2: WithI dark ¼I 0 expo q V out þ R s :I out K:T:a À 1

! ð3Þ
A GPV consists of (N s ) cells in series and (N p ) in parallel cells. It is modelled by Equation 4: where: I 0 is the reverse saturation current, q the electron charge, a the ideality factor of the junction, T the environment temperature et k the Boltzmann constant.

Modeling the boost converter
The c-dc converters are used either to step up/down the PV voltage. They can also be used to extract maximum power through MPPT (maximum power point tracking). Figure 2 shows the circuit diagram of a dc-dc boost converter. It is connected to 30 panels of PV that provides a larger output voltage than that of the panel. It is used here for less than PV panels. Two sequences are considered conduction according to the state of the transistor (T). This converter is modeled by the equations 5, 6 et 7: The inductance and capacity (L s , C 1 , C 2 ) are storage elements. If they are carefully calculated, they could filter the current and minimize the ripple factor of both the input and output voltages (V pv and V dc ) of the converters [9]. The storage elements (L s , C 1 and C 2 ) are respectively dimensioned by the equations 8, 9 et 10: Figure 3 is a simple circuit diagram of a battery where R is the internal resistance, it is variable and depends on the temperature, capacity and current charge and discharge of the battery, V bat is battery voltage, E ba represents the emf of the battery which depends on the charge state and I bat is the battery current; it is positive during charging and negative during discharge. So the current sign of the battery depends on the operating modes. There are three main states of a battery storage system, which are discharging, standby and charging states [11]. Applying the mesh law and taking into account the two operational modes (charging and discharging), we have the equation 11:

Modeling battery
A battery is characterized by a few parameters such as its capacity (C bat ), its state of charge (SOC) and the charging voltage and the discharge voltage.

R:I bat ð12Þ
SOCð%Þ Where: The Battery Model used in this paper is a Lead-Acid Battery with a nominal voltage of 12 V. It is connected to the dc bus through a bidirectional buck-boost converter for charging or discharging, as shown in Fig. 4. According to the model developed by CIEMAT, the battery voltage varies during charge and discharge. It is modeled by: -Charging voltage: Where B ¼ I bat C 10 : 4 With C 10 is the battery capacity in Ah constant current discharge rate for 10 heures. DT ¼ T À 25 degre Celsus : It is difference between the battery temperature and 25 degre Celsus. Subsequent paragraphs, however, are indented.

Modeling the buck-boost converter
Using this DC/DC converter (see Fig. 4) is explained by the fact that the voltage at the DC bus is greater than that of the battery but also it must ensure the buck function in one direction and lift in the opposite direction. The diagram of Fig. 4 shows the electrical model of the bidirectional converter used. When charging the battery, it will operate in buck mode. In this case, control switch S2. When discharging switch S1 is controlled. It becomes lift.
So for these two modes of operation, the buck-boost chopper can be modelled by the equations 16 and 17 where u is the control signal:

Modeling and dimensioning UPS
In this paper, the single-phase inverter (Fig. 5) is connected a left by a dc bus witch is connected a dc/dc boost converter (Fig. 2) and right by a grid (electric network). Figure 5 represents the single phase inverter. It is a dc/ac and the main power converter of the system. The inverter block provides Equation 18 : Where: Hence the equation 18 becomes: Applying the mesh law (Fig. 5), we find the equation 20: v ab À L on : So the equation 20 becomes: Where V gr represents the grid voltage, inductance L on is used to filter the inverter output current and h a and h b are control signals. The Table 1 shows the parameters of the photovoltaic panels, the battery, the dc/dc converters, the dc/ac inverter and the grid.

Operation mode PV-battery system connected to RED
The objective of the PV ? Battery installation is to produce, consume and inject the surplus into the BT network. The diagram of Fig. 6 is a simplified electrical representation of the study system. It is composed of a photovoltaic generator, a boost converter, a battery bank, a buck-boost converter and a single-phase inverter. The S1, S2, S3, S4 and S5 are the commands relays for energy distribution. NB: The relay S2 and S3 cannot be on at the same as it is impossible to load and unload both a battery. As S4 and S5 cannot be closed because they both serve respectively injection and consumption via the network. We chose safety switches to isolate the component failure. The control relays are each coupled through a diode to impose a direction of travels aware.
To make it easier supervision system, two algorithms are developed: one plays the role of battery protection and one can manage the transfer of energy between the PV, batteries and electrical distribution network the supply to the load.

Proposal for a power management strategy
In this system, the panels are considered as the main source. If the deficits battery bank will come second. Otherwise the network will supply the load. The minimum discharge the battery voltage is 11 V and the maximum charging voltage to 13 V. Figure 7 shows how the system works.
The operation of the system is described in six modes: -Mode 1 The power produced by the panels is greater than the power needed to charge and the battery voltage is greater than 12 V. In this case, the firm control system closes only S1 and S4 relay and opens S2, S3 and S5. This means the load is powered by the panels and there's injection system.
-Mode 2 The power produced by the panels is greater than the power needed to charge but the battery voltage is below 12 V. In this case, the firm control system closes the relays S1 and S2 and opens S3, S4 and S5. This means the load is powered by the panels. The batteries are charging. There will be no injection of energy to the network.
-Mode 3 The power produced by the panels is less than the power needed to charge but not zero and the battery voltage is greater than 12 V. In this case, the firm control system closes S1 and S3 relay and opens S2, S4 and S5. This means that the batteries are landfilled and the load is supplied by the panels and batteries. He will not have energy injection to the network.
-Mode 4 The power produced by the panels is less than the power needed to charge but not zero and the battery  voltage is below 12 V. In this case, the firm control system closes S2 and S5 relay and opens S1, S3 and S4. This means that the batteries are charging and the load is supplied by the network. He will not have energy injection to the network because S4 is open.
-Mode 5 The power generated by the panels is zero and the battery voltage is greater than 12 V. In this case, the control system closes S3 relay and opens S1, S2, S4 and S5. This means that the battery is discharging and the load is powered by the batteries. He will not have energy injection to the network.
-Mode 6 The power generated by the panels is zero and the battery voltage is less than 12 V. In this case, the control system closes S5 relay and the remaining relays are low. This means that the load is supplied by the network. The batteries and panels are disconnected.
Among these modes, we see that the battery works is in charge mode or discharge mode. Or its voltage varies depending on its operating modes. This variation can result in overload or underload battery hence the need for protection system. Figure 8 shows the algorithm to protect the battery against overload and underload. This shows that the protection system can be described with six (6) modes of operation:

Operation of the battery protection strategy
-Mode 1 The battery voltage is increased, that is to say, the battery is charging, and it is between 11:5V\V bat \13:5V.In this case, we will continue to charge the batteries.
-Mode 2 battery is being charged, it is not between 11:5V\V bat \13:5V but higher than 13.5 V. In this case, the protection system will disconnect the battery by opening S2 and S3 relay.
-Mode 3 The battery is being charged, it is not between11:5V\V bat \13:5V but less than 13.5 V. In this case, they are allowed to charge battery mode.
-Mode 4 The battery voltage is decreasing, that is to say during use, and it is less than 11.5 V. In this case, the protection system opens the relay S2 and S3.
-Mode 5 The battery is discharging but the voltage is not less than 11.5 V. In this case, continue to use the battery.
-Mode 6The battery is either charge mode or discharge mode. She is resting.
To overcome the data acquisition, a monitoring system has been built. And in order to follow in real time the system, the algorithm show in Figs. 7, 8 were implementated by using an Arduino board. This electronic card is the interface between our design system and a PC (see Fig. 9). It is an easy to use yet powerful single board computer that has gained considerable traction in the hobby as well as professional market [12].To realize the supervision of the system, we still need the following materials: -Four (4) Breakers 32A; -Five (5) Control Relay; -Four (4) Diodes check; -resistors to achieve sensors (voltage, current) and a level detector.
These materials are a set of interface between the Arduino board and different components system (see Fig. 9). They In the absence of the real system, we made simulations with LED lamps in series with 220 resistors. We randomly selected a company. The owner of this last wishes to operate its expenses via a PV-battery system connected to BT network. Some loads operate 24/24 at constant power and other depend on the time working staff. Workers start coming at 8am and down to 19h. The GPV operates from the same time interval. The battery voltage does not depend on time. We traced the power profiles produced, load and battery between 8h and 19h (Fig. 10).
This Fig. 10 shows that: -between 8 am and 11 am the request (red curve) is greater than the power produced (blue curve) and the battery is in discharge, -between 11 am and 4 h 30 pm, the battery is disconnected and the energy produced by the PVG is higher than that required this can be explained by the fact that some devices are at rest and the solar irradiation is important, -from 4 pm 30 until 8 am the energy requirement remains over production and the battery is charging between 4 pm and 6 pm.
The Arduino board has its own software under which we can write purely Arduino program. But in this work in a spirit of curiosity and the fact that many researchers use matlab for simulations, we implemented the strategy in matlab algorithm. Arduino is always the control board and becomes an outer periphery of matlab. For that to happen, we first connected the card to the PC via a cable and then wrote 00 a ¼ Arduino; 00 on the command window matlab. They also allow you to quickly know the features of the card.

Results and discussions
As we know Arduino card is a programmable microcontroller card capable of performing a variety of tasks such as control of home appliances-lighting, heating and store the results and also to communicate with the outside world .This means creating a program for controlling appliances based on the received data. For that several programming languages are used, such as Python, Java, C??, etc. In this project we used the Matlab development environment installed in a computer. The latter sends an instruction to the microcontroller which acts on the electric device by sending a signal PWM (a digital signal) which, at a given frequency, a duty ratio which varies with the given time ''orders it receives''. Figure 11 below shows the GUI of the Matlab software that contains all the instructions of our program. Figure 12 shows that the lighting of LED by the Arduino board from matlab. Arduino turn on and off the relay by time intervals as described below: -from 8 h to 10 h 59 min: S1 and S3 turned on and S2, S4 and S5 extinguished; -from 11 h to 16 h 29 mn: S1 and S4 on and S2, S3 and S5 extinguished; -from 16 h 30 min to 18 h 29 mn: S1 and S2 turned on and S3, S4 and S5 extinguished; -18 h 30 to 7 h 59 min: single S5 is turned on.
It is found that all LEDs work normally. These results show that the Arduino board manages power between GPV, BS and RED and controls the charge and discharge of the battery. So we can conclude that this Arduino control board works well with Matlab.

Conclusion
This study involved a PV?battery connected to the BT network. The monitoring algorithm we implemented on the Arduino card properly responds to different modes of operation. This is what has allowed the card to ensure both energy management. This work is a great contribution GPV control and supervision by an Arduino board with Matlab.
In the immediate perspective, we expect to achieve the effective supervision of this type of system proposed.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creative commons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.