<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article">
 <front>
  <journal-meta>
   <journal-id journal-id-type="publisher-id">
    jpee
   </journal-id>
   <journal-title-group>
    <journal-title>
     Journal of Power and Energy Engineering
    </journal-title>
   </journal-title-group>
   <issn pub-type="epub">
    2327-588X
   </issn>
   <issn publication-format="print">
    2327-5901
   </issn>
   <publisher>
    <publisher-name>
     Scientific Research Publishing
    </publisher-name>
   </publisher>
  </journal-meta>
  <article-meta>
   <article-id pub-id-type="doi">
    10.4236/jpee.2025.136007
   </article-id>
   <article-id pub-id-type="publisher-id">
    jpee-143654
   </article-id>
   <article-categories>
    <subj-group subj-group-type="heading">
     <subject>
      Articles
     </subject>
    </subj-group>
    <subj-group subj-group-type="Discipline-v2">
     <subject>
      Engineering
     </subject>
    </subj-group>
   </article-categories>
   <title-group>
    Development of an Algorithm Based on a Mechanism for Managing the Charge and Discharge of Lead Acid Batteries to Optimize the Solar Energy Produced in Burundi
   </title-group>
   <contrib-group>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Icoyitungiye
      </surname>
      <given-names>
       Olivier
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff1"> 
      <sup>1</sup>
     </xref>
    </contrib>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Bukuru
      </surname>
      <given-names>
       Denis
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff2"> 
      <sup>2</sup>
     </xref>
    </contrib>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Pritpal
      </surname>
      <given-names>
       Singh
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff3"> 
      <sup>3</sup>
     </xref>
    </contrib>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Niyonzima Jean
      </surname>
      <given-names>
       Bosco
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff1"> 
      <sup>1</sup>
     </xref>
    </contrib>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Ntawuhorakomeye
      </surname>
      <given-names>
       Noel
      </given-names>
     </name> 
     <xref ref-type="aff" rid="aff2"> 
      <sup>2</sup>
     </xref>
    </contrib>
   </contrib-group> 
   <aff id="aff1">
    <addr-line>
     aReseach Center in Infrastructure, Environment and Technologies (CRIET), University of Burundi, Bujumbura, Burundi
    </addr-line> 
   </aff> 
   <aff id="aff2">
    <addr-line>
     aReseach Center in Applied Sciences, Higher Institute of Education (ENS), Bujumbura, Burundi
    </addr-line> 
   </aff> 
   <aff id="aff3">
    <addr-line>
     aDepartment of Electrical and Computer Engineering, Villanova University, Villanova, USA
    </addr-line> 
   </aff> 
   <pub-date pub-type="epub">
    <day>
     13
    </day> 
    <month>
     06
    </month>
    <year>
     2025
    </year>
   </pub-date> 
   <volume>
    13
   </volume> 
   <issue>
    06
   </issue>
   <fpage>
    107
   </fpage>
   <lpage>
    126
   </lpage>
   <history>
    <date date-type="received">
     <day>
      5,
     </day>
     <month>
      May
     </month>
     <year>
      2025
     </year>
    </date>
    <date date-type="published">
     <day>
      27,
     </day>
     <month>
      May
     </month>
     <year>
      2025
     </year> 
    </date> 
    <date date-type="accepted">
     <day>
      27,
     </day>
     <month>
      June
     </month>
     <year>
      2025
     </year> 
    </date>
   </history>
   <permissions>
    <copyright-statement>
     © Copyright 2014 by authors and Scientific Research Publishing Inc. 
    </copyright-statement>
    <copyright-year>
     2014
    </copyright-year>
    <license>
     <license-p>
      This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/
     </license-p>
    </license>
   </permissions>
   <abstract>
    After the era of fossil fuel exploitation, researchers have begun to exploit solar energy, which is stored using rechargeable batteries. In Burundi, lead-acid batteries are often used for storage. During charging and discharging cycles, a certain amount of energy is generated inside the battery, gradually causing it to age. We see a loss of energy when batteries are charged while there is still sunshine when the battery is charged quickly as a result of aging. It is difficult to fill all the batteries when it is raining. This project was carried out to develop an algorithm for managing the charging and discharging of batteries by switching to optimize the solar energy produced. The method consists of designing a program using Arduino IDE software based on the control algorithm developed, with an Arduino UNO microcontroller as the command-and-control element. The algorithm developed includes temperature control using a DHT11 temperature sensor. The control circuit was designed using Proteus software. We have produced a program of algorithms developed using MATLAB 2020a software. The results of the design and simulation with Proteus and MATLAB verified and validated the experimental results on the effectiveness of the energy recovery algorithm developed.
   </abstract>
   <kwd-group> 
    <kwd>
     Battery Management System
    </kwd> 
    <kwd>
      Energy Management
    </kwd> 
    <kwd>
      Algorithm
    </kwd> 
    <kwd>
      Photovoltaic System
    </kwd>
   </kwd-group>
  </article-meta>
 </front>
 <body>
  <sec id="s1">
   <title>1. Introduction</title>
   <p>In the context of sustainable development, in response to the dual global challenge posed by the depletion and future of fossil energy resources, solar energy is considered to be the source of the majority of energy. To harness solar energy, batteries are needed to store the energy. Since the first development of a rechargeable lead-acid battery by Gaston Planté in 1859, batteries have revolutionised the way energy is stored <xref ref-type="bibr" rid="scirp.143654-1">
     [1]
    </xref>. Several authors have carried out different studies on battery charging and discharging systems. <xref ref-type="bibr" rid="scirp.143654-2">
     [2]
    </xref> USA shows a fuzzy logical-based state-of-charge meter for li-ion batteries used in portable defibrillators and <xref ref-type="bibr" rid="scirp.143654-3">
     [3]
    </xref> describe the fuzzy logic-enhanced electrochemical impedance spectroscopy to determine battery state of charge. They develop a fuzzy logic based smart battery controller for automotive batteries. <xref ref-type="bibr" rid="scirp.143654-4">
     [4]
    </xref>, in his study, presents an overview of next-generation BMSS. <xref ref-type="bibr" rid="scirp.143654-1">
     [1]
    </xref> and <xref ref-type="bibr" rid="scirp.143654-5">
     [5]
    </xref> of Quebec City find that estimating a battery’s state of charge helps keep a battery in good condition to avoid any deterioration problems due to too high a temperature or too high or too low a charge/charge voltage. According to <xref ref-type="bibr" rid="scirp.143654-6">
     [6]
    </xref> and <xref ref-type="bibr" rid="scirp.143654-7">
     [7]
    </xref> Saudi Arabia, BMS varies from application to application. It is a management system that monitors, controls and optimises the performance of an individual or multiple battery modules in an energy storage system. According to <xref ref-type="bibr" rid="scirp.143654-8">
     [8]
    </xref> during the charge/discharge cycle of a battery, heat is generated inside the battery. This phenomenon causes an increase in the temperature at the surface of the battery and consequently accelerates its aging in France. <xref ref-type="bibr" rid="scirp.143654-9">
     [9]
    </xref> detailed the challenges of developing a new battery operating system suitable for future applications and described the details of some of the solutions he has developed. <xref ref-type="bibr" rid="scirp.143654-10">
     [10]
    </xref> Show the comparison of life prediction models for lead-acid and Li-Ion batteries in stand-alone photovoltaic systems in Spain.</p>
   <p>
    <xref ref-type="bibr" rid="scirp.143654-11">
     [11]
    </xref>-<xref ref-type="bibr" rid="scirp.143654-13">
     [13]
    </xref> describe the state of the art of lead acid solar batteries and their regeneration. The best lead-acid solar batteries can achieve a service life of between 7 and 15 years, and lead-acid batteries can be recycled. <xref ref-type="bibr" rid="scirp.143654-14">
     [14]
    </xref> describe how impedance measurements, combined with fuzzy logic data analysis have been used to estimate the SOH of lead acid batteries used in portable defibrillators. <xref ref-type="bibr" rid="scirp.143654-15">
     [15]
    </xref> has carried out research into optimising the life of lead acid batteries. For him, the State of Charge (SOC) is an indication of the level of charge of a battery in percentage. It is important to understand that the State of Charge of the battery is the opposite of the Depth of Discharge. Depth of Discharge (DoD) indicates the stage of discharge of the battery. <xref ref-type="bibr" rid="scirp.143654-16">
     [16]
    </xref> study fuzzy logic based determination of Lead Acid battery state of charge by impedance interrogation methods. Burundi has already started using solar energy. For the photovoltaic (PV) fields already installed, only two are grid-connected photovoltaic systems without batteries. The others are photovoltaic systems with lead-acid battery storage. We note that battery ageing and temperature have an influence on battery charge. We also found that for different periods of the year, depending on the season, the sized batteries could be fully charged as long as the sun is shining. On the other hand, during the rainy season, it is difficult to charge all the batteries. <xref ref-type="fig" rid="fig1">
     Figure 1
    </xref> shows how batteries are stored in a closed room.</p>
   <fig id="fig1" position="float">
    <label>Figure 1</label>
    <caption>
     <title>Figure 1. Photo of the battery storage site for the PV system installed at Bugendana Parish.</title>
    </caption>
    <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId13.jpeg?20250630085215" />
   </fig>
   <p>In this case, the temperature in the room may exceed the threshold temperature of the batteries. This leads to a considerable loss of energy, which could be recovered by an automatic system.</p>
   <p>The aim of this project is to develop an algorithm based on a battery charge and discharge management mechanism for the optimization of photovoltaic energy using a microcontroller. We will develop an algorithm based on a cascade battery charge and discharge management mechanism using a microcontroller, develop a temperature control algorithm, design a cascade battery charge and discharge control circuit, design a temperature control circuit and finally carry out an experiment using a prototype.</p>
  </sec><sec id="s2">
   <title>2. Method and Materials</title>
   <p>In this section, we will develop the methodology to be used and the components required. Taking into account the problem raised, the methodology consists of developing an algorithm for managing the state of charge/discharge of two groups of batteries in cascade with temperature control. The technique involves dividing all the batteries obtained using the photovoltaic system sizing method into two groups. The first group of batteries is called battery 1 (Bat1) and the second group is called battery 2 (Bat2). We will use the DHT11 temperature sensor to monitor the temperature and a fan for air conditioning.</p>
   <p>The technique involves cooling the battery to an operating temperature of 25˚C to ensure a battery life of 15 years because if the temperature reaches 25˚C, it is a high temperature <xref ref-type="bibr" rid="scirp.143654-14">
     [14]
    </xref> <xref ref-type="bibr" rid="scirp.143654-15">
     [15]
    </xref>. We will design a program with Arduino IDE (Integrated Development Environment) software whose control and command element are Arduino UNO. The control and command circuit will be designed using Proteus Professional v8.10 SP3 software. The method also involves designing the algorithm developed using MATLAB2020a software and comparing the results with those obtained using the Arduino IDE and Proteus software <xref ref-type="bibr" rid="scirp.143654-17">
     [17]
    </xref>. <xref ref-type="fig" rid="fig2">
     Figure 2
    </xref> illustrates the block diagram of the system under study.</p>
   <fig id="fig2" position="float">
    <label>Figure 2</label>
    <caption>
     <title>Figure 2. System block diagram.</title>
    </caption>
    <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId14.jpeg?20250630085216" />
   </fig>
   <p>
    <xref ref-type="fig" rid="fig3">
     Figure 3
    </xref> shows algorithm for the battery charge and discharge management system with temperature control.</p>
   <fig id="fig3" position="float">
    <label>Figure 3</label>
    <caption>
     <title>Figure 3. Algorithms of battery charge and discharge management system with temperature control.</title>
    </caption>
    <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId15.jpeg?20250630085216" />
   </fig>
   <p>where, VBAT1 MIN: Minimum battery voltage 1, VBAT1: Battery voltage 1, VBAT12 MAX: Maximum battery voltage 2, VBAT1: Battery voltage 2, VBAT2 MIN: Minimum battery voltage 2, VBAT1 MAX: Maximum battery voltage 1.</p>
   <sec id="s2_1">
    <title>2.1. Photovoltaic Generator</title>
    <p>In another way, when a semiconductor is illuminated by sunlight, a free electron-hole bond circulates in the material. Under the effect of the electric field, the electron goes to the N side and the hole to the P side. The holes behave in different ways, like particles with a positive charge equal to that of the electron. The potential difference can be measured between the positive and negative terminals of the cell. The maximum cell voltage is approximately 0.6 V at zero current. This voltage is known as the open circuit voltage (VCO). The maximum current produced is called the short-circuit current (ICC) <xref ref-type="bibr" rid="scirp.143654-18">
      [18]
     </xref>.</p>
   </sec>
   <sec id="s2_2">
    <title>2.2. Charge Controller MPPT</title>
    <p>Charge Controller MPPT prevents overcharging and excessive discharging of the battery. In the case of lead-acid batteries, overcharging is prevented by charging the batteries in three stages (bulk, absorption, or boost and float).</p>
   </sec>
   <sec id="s2_3">
    <title>2.3. The Microcontroller Arduino UNO</title>
    <p>The microcontroller is a microprocessor-type information processing unit to which internal peripherals have been added to facilitate interfacing with the outside world without requiring the addition of external components. With the Arduino board, we can write programs, create interface circuits and develop algorithms to control switches, sensors, etc.</p>
   </sec>
   <sec id="s2_4">
    <title>2.4. The Switch</title>
    <p>In this study, we will use relay. A relay is a pre-actuator consisting of at least an electromagnet, a moving leg supporting the moving contact, a fixed contact and a moving contact return spring. By energizing the coil from an electrical source, the moving contact is moved, thus closing the electrical contact.</p>
   </sec>
   <sec id="s2_5">
    <title>2.5. DHT11 Temperature Sensor</title>
    <p>The DHT11 sensor is a module for detecting the temperature and a microcontroller can process the humidity of an object that sends an analogue voltage output. Compared with other types of sensors, it is more responsive, quickly detects the temperature and humidity of objects, and does not easily disturb the data read.</p>
   </sec>
   <sec id="s2_6">
    <title>2.6. Battery</title>
    <p>A solar battery is a device designed to store the electrical energy produced by photovoltaic solar panels. The current entering or leaving the battery is necessarily direct current (DC) and not alternating current (AC) as in the domestic electricity network.</p>
    <p>Lead-acid batteries are the most widely used storage element in photovoltaic systems. The main function of lead-acid batteries is to store and supply energy in a PV system. The stored chemical energy can be converted into electrical energy and vice versa. Electrochemical reactions are described by the following reactions <xref ref-type="bibr" rid="scirp.143654-19">
      [19]
     </xref>.</p>
    <p>
     <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mrow> 
         <mtext>
           PbO 
         </mtext> 
        </mrow> 
        <mn>
          2 
        </mn> 
       </msub> 
       <mo>
         + 
       </mo> 
       <mn>
         2 
       </mn> 
       <msub> 
        <mtext>
          H 
        </mtext> 
        <mtext>
          2 
        </mtext> 
       </msub> 
       <msub> 
        <mrow> 
         <mtext>
           SO 
         </mtext> 
        </mrow> 
        <mn>
          4 
        </mn> 
       </msub> 
       <mo>
         + 
       </mo> 
       <mtext>
         Pb 
       </mtext> 
       <munderover> 
        <mo>
          ⇄ 
        </mo> 
        <mrow> 
         <mtext>
           charge 
         </mtext> 
        </mrow> 
        <mrow> 
         <mtext>
           discharge 
         </mtext> 
        </mrow> 
       </munderover> 
       <mn>
         2 
       </mn> 
       <msub> 
        <mrow> 
         <mtext>
           PbSO 
         </mtext> 
        </mrow> 
        <mn>
          4 
        </mn> 
       </msub> 
       <mo>
         + 
       </mo> 
       <mn>
         2 
       </mn> 
       <msub> 
        <mtext>
          H 
        </mtext> 
        <mtext>
          2 
        </mtext> 
       </msub> 
       <mtext>
         O 
       </mtext> 
      </mrow> 
     </math> (1)</p>
    <p>The expression that describes the behavior of battery voltage is:</p>
    <p>
     <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mi>
         V 
       </mi> 
       <mo>
         = 
       </mo> 
       <msub> 
        <mi>
          V 
        </mi> 
        <mrow> 
         <mi>
           o 
         </mi> 
         <mi>
           c 
         </mi> 
        </mrow> 
       </msub> 
       <mo>
         ± 
       </mo> 
       <mi>
         I 
       </mi> 
       <mi>
         R 
       </mi> 
      </mrow> 
     </math> <xref ref-type="bibr" rid="scirp.143654-19">
      [19]
     </xref> (2)</p>
    <p>where, V<sub>oc</sub> is the open circuit voltage, I is the battery current and R is the internal resistance of the battery.</p>
    <p>The charge/discharge models of Lead-Acid battery are given by Equation (3) and Equation (4).</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          V 
        </mi> 
        <mrow> 
         <mi>
           b 
         </mi> 
         <mi>
           a 
         </mi> 
         <mi>
           t 
         </mi> 
        </mrow> 
       </msub> 
       <mo>
         = 
       </mo> 
       <msub> 
        <mi>
          V 
        </mi> 
        <mn>
          0 
        </mn> 
       </msub> 
       <mo>
         − 
       </mo> 
       <mi>
         R 
       </mi> 
       <mi>
         i 
       </mi> 
       <mo>
         − 
       </mo> 
       <mi>
         R 
       </mi> 
       <mi>
         p 
       </mi> 
       <mi>
         o 
       </mi> 
       <msub> 
        <mi>
          l 
        </mi> 
        <mn>
          1 
        </mn> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mi>
           i 
         </mi> 
         <mo>
           + 
         </mo> 
         <msup> 
          <mi>
            i 
          </mi> 
          <mo>
            * 
          </mo> 
         </msup> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         + 
       </mo> 
       <mi>
         E 
       </mi> 
       <mi>
         x 
       </mi> 
       <mi>
         p 
       </mi> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mi>
          t 
        </mi> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> <xref ref-type="bibr" rid="scirp.143654-20">
      [20]
     </xref> (3)</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          V 
        </mi> 
        <mrow> 
         <mi>
           b 
         </mi> 
         <mi>
           a 
         </mi> 
         <mi>
           t 
         </mi> 
        </mrow> 
       </msub> 
       <mo>
         = 
       </mo> 
       <msub> 
        <mi>
          V 
        </mi> 
        <mn>
          0 
        </mn> 
       </msub> 
       <mo>
         − 
       </mo> 
       <mi>
         R 
       </mi> 
       <mi>
         i 
       </mi> 
       <mo>
         − 
       </mo> 
       <mi>
         R 
       </mi> 
       <mi>
         p 
       </mi> 
       <mi>
         o 
       </mi> 
       <msub> 
        <mi>
          l 
        </mi> 
        <mn>
          2 
        </mn> 
       </msub> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <msup> 
          <mi>
            i 
          </mi> 
          <mo>
            * 
          </mo> 
         </msup> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         − 
       </mo> 
       <mi>
         R 
       </mi> 
       <mi>
         p 
       </mi> 
       <mi>
         o 
       </mi> 
       <msub> 
        <mi>
          l 
        </mi> 
        <mn>
          1 
        </mn> 
       </msub> 
       <mo>
         ⋅ 
       </mo> 
       <mi>
         i 
       </mi> 
       <mo>
         + 
       </mo> 
       <mi>
         E 
       </mi> 
       <mi>
         x 
       </mi> 
       <mi>
         p 
       </mi> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mi>
          t 
        </mi> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> <xref ref-type="bibr" rid="scirp.143654-20">
      [20]
     </xref> (4)</p>
    <p>Where: V<sub>bat</sub> is battery voltage (V), V<sub>0</sub> is battery constant voltage (V), K is polarisation constant (V/Ah), C = battery capacity (Ah), it is actual battery charge (Ah), A is exponential zone amplitude (V), b is Exponential zone time constant inverse (Ah<sup>−</sup><sup>1</sup>), R is internal resistance (Ω), Rpol<sub>1</sub> is polarisation resistance when i &gt; 0, Rpol<sub>2</sub> is polarisation resistance when i &lt; 0, i is battery current and i* filtered current. The battery current i and the filtered current i* are equal <xref ref-type="bibr" rid="scirp.143654-20">
      [20]
     </xref>.</p>
    <p>The polarisation resistance in discharge mode is given by Equation (5)</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mi>
         R 
       </mi> 
       <mi>
         p 
       </mi> 
       <mi>
         o 
       </mi> 
       <mi>
         l 
       </mi> 
       <mo>
         = 
       </mo> 
       <mi>
         K 
       </mi> 
       <mfrac> 
        <mi>
          C 
        </mi> 
        <mrow> 
         <mi>
           C 
         </mi> 
         <mo>
           − 
         </mo> 
         <mi>
           i 
         </mi> 
         <mi>
           t 
         </mi> 
        </mrow> 
       </mfrac> 
      </mrow> 
     </math> <xref ref-type="bibr" rid="scirp.143654-20">
      [20]
     </xref> (5)</p>
    <p>The polarisation resistance in charge mode is given by Equation (6):</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mi>
         R 
       </mi> 
       <mi>
         p 
       </mi> 
       <mi>
         o 
       </mi> 
       <mi>
         l 
       </mi> 
       <mo>
         = 
       </mo> 
       <mi>
         K 
       </mi> 
       <mfrac> 
        <mi>
          C 
        </mi> 
        <mrow> 
         <mi>
           i 
         </mi> 
         <mi>
           t 
         </mi> 
         <mo>
           − 
         </mo> 
         <mn>
           0.1 
         </mn> 
         <mi>
           C 
         </mi> 
        </mrow> 
       </mfrac> 
      </mrow> 
     </math> <xref ref-type="bibr" rid="scirp.143654-20">
      [20]
     </xref> (6)</p>
    <p>The exponential voltage of the Lead-Acid battery is given by Equation (7):</p>
    <p>
     <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mi>
         E 
       </mi> 
       <mi>
         x 
       </mi> 
       <mi>
         p 
       </mi> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mi>
          t 
        </mi> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         = 
       </mo> 
       <mi>
         B 
       </mi> 
       <mo>
         ⋅ 
       </mo> 
       <mrow> 
        <mo>
          | 
        </mo> 
        <mrow> 
         <mi>
           i 
         </mi> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mi>
            t 
          </mi> 
          <mo>
            ) 
          </mo> 
         </mrow> 
         <mo>
           − 
         </mo> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <mo>
             − 
           </mo> 
           <mi>
             E 
           </mi> 
           <mi>
             x 
           </mi> 
           <mi>
             p 
           </mi> 
           <mrow> 
            <mo>
              ( 
            </mo> 
            <mi>
              t 
            </mi> 
            <mo>
              ) 
            </mo> 
           </mrow> 
          </mrow> 
         </mrow> 
         <mo>
           + 
         </mo> 
         <mi>
           A 
         </mi> 
         <mo>
           ⋅ 
         </mo> 
         <mi>
           u 
         </mi> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mi>
            t 
          </mi> 
          <mo>
            ) 
          </mo> 
         </mrow> 
        </mrow> 
        <mo>
          | 
        </mo> 
       </mrow> 
      </mrow> 
     </math> <xref ref-type="bibr" rid="scirp.143654-20">
      [20]
     </xref> (7)</p>
    <p>where, Exp(t) is the exponential zone voltage (V), is the battery current (A), u(t) is the charge or discharge mode. The exponential voltage depends on the initial value of Exp(t<sub>0</sub>) a u(t) = 1 in charge mode or u(t) = 0 in discharge mode. When the battery is fully charged, the battery’s real charge is equal to zero (it = 0). In this case, the battery voltage begins to drop. The charge continues to overcharge the battery (it &lt; 0). The decrease in voltage is due to the decrease in polarisation resistance. When it = 0 (battery fully charged), the polarisation resistance is infinite <xref ref-type="bibr" rid="scirp.143654-20">
      [20]
     </xref>.</p>
    <p>The discharge voltage equation is given by the following expression:</p>
    <p>
     <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mi>
         V 
       </mi> 
       <mo>
         = 
       </mo> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mn>
           2.085 
         </mn> 
         <mo>
           − 
         </mo> 
         <mn>
           0.12 
         </mn> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <mn>
             1 
           </mn> 
           <mo>
             − 
           </mo> 
           <mi>
             s 
           </mi> 
           <mi>
             o 
           </mi> 
           <mi>
             c 
           </mi> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         − 
       </mo> 
       <mfrac> 
        <mn>
          1 
        </mn> 
        <mrow> 
         <msub> 
          <mi>
            C 
          </mi> 
          <mrow> 
           <mn>
             10 
           </mn> 
          </mrow> 
         </msub> 
        </mrow> 
       </mfrac> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mfrac> 
          <mn>
            4 
          </mn> 
          <mrow> 
           <mn>
             1 
           </mn> 
           <mo>
             + 
           </mo> 
           <msup> 
            <mi>
              I 
            </mi> 
            <mrow> 
             <mn>
               13 
             </mn> 
            </mrow> 
           </msup> 
          </mrow> 
         </mfrac> 
         <mo>
           + 
         </mo> 
         <mfrac> 
          <mrow> 
           <mn>
             0.27 
           </mn> 
          </mrow> 
          <mrow> 
           <mi>
             s 
           </mi> 
           <mi>
             o 
           </mi> 
           <msup> 
            <mi>
              c 
            </mi> 
            <mrow> 
             <mn>
               15 
             </mn> 
            </mrow> 
           </msup> 
          </mrow> 
         </mfrac> 
         <mo>
           + 
         </mo> 
         <mn>
           0.02 
         </mn> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         ⋅ 
       </mo> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mn>
           1 
         </mn> 
         <mo>
           − 
         </mo> 
         <mn>
           0.007 
         </mn> 
         <mi>
           Δ 
         </mi> 
         <mi>
           T 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> <xref ref-type="bibr" rid="scirp.143654-19">
      [19]
     </xref> (8)</p>
    <p>The charge voltage equation is given by the following expression:</p>
    <p>
     <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mi>
         V 
       </mi> 
       <mo>
         = 
       </mo> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mn>
           2 
         </mn> 
         <mo>
           − 
         </mo> 
         <mn>
           0.16 
         </mn> 
         <mi>
           s 
         </mi> 
         <mi>
           o 
         </mi> 
         <mi>
           c 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         + 
       </mo> 
       <mfrac> 
        <mn>
          1 
        </mn> 
        <mrow> 
         <msub> 
          <mi>
            C 
          </mi> 
          <mrow> 
           <mn>
             10 
           </mn> 
          </mrow> 
         </msub> 
        </mrow> 
       </mfrac> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mfrac> 
          <mn>
            6 
          </mn> 
          <mrow> 
           <mn>
             1 
           </mn> 
           <mo>
             + 
           </mo> 
           <msup> 
            <mi>
              I 
            </mi> 
            <mrow> 
             <mn>
               0.86 
             </mn> 
            </mrow> 
           </msup> 
          </mrow> 
         </mfrac> 
         <mo>
           + 
         </mo> 
         <mfrac> 
          <mrow> 
           <mn>
             0.48 
           </mn> 
          </mrow> 
          <mrow> 
           <msup> 
            <mrow> 
             <mrow> 
              <mo>
                ( 
              </mo> 
              <mrow> 
               <mn>
                 1 
               </mn> 
               <mo>
                 − 
               </mo> 
               <mi>
                 s 
               </mi> 
               <mi>
                 o 
               </mi> 
               <mi>
                 c 
               </mi> 
              </mrow> 
              <mo>
                ) 
              </mo> 
             </mrow> 
            </mrow> 
            <mrow> 
             <mn>
               12 
             </mn> 
            </mrow> 
           </msup> 
          </mrow> 
         </mfrac> 
         <mo>
           + 
         </mo> 
         <mn>
           0.036 
         </mn> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         ⋅ 
       </mo> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mn>
           1 
         </mn> 
         <mo>
           − 
         </mo> 
         <mn>
           0.025 
         </mn> 
         <mi>
           Δ 
         </mi> 
         <mi>
           T 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> <xref ref-type="bibr" rid="scirp.143654-19">
      [19]
     </xref> (9)</p>
    <p>The temperature variation is given by:</p>
    <p>
     <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mi>
         Δ 
       </mi> 
       <mi>
         T 
       </mi> 
       <mo>
         = 
       </mo> 
       <mi>
         T 
       </mi> 
       <mo>
         − 
       </mo> 
       <mn>
         25 
       </mn> 
      </mrow> 
     </math> <xref ref-type="bibr" rid="scirp.143654-19">
      [19]
     </xref> (10)</p>
    <p>We know that the expression that describes the thermal effect on resistance is:</p>
    <p>
     <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          R 
        </mi> 
        <mi>
          t 
        </mi> 
       </msub> 
       <mo>
         = 
       </mo> 
       <msub> 
        <mi>
          R 
        </mi> 
        <mn>
          0 
        </mn> 
       </msub> 
       <mo>
         ∗ 
       </mo> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mn>
           1 
         </mn> 
         <mo>
           + 
         </mo> 
         <mn>
           0.004 
         </mn> 
         <mo>
           ∗ 
         </mo> 
         <mrow> 
          <mo>
            ( 
          </mo> 
          <mrow> 
           <mi>
             T 
           </mi> 
           <mo>
             − 
           </mo> 
           <mn>
             25 
           </mn> 
          </mrow> 
          <mo>
            ) 
          </mo> 
         </mrow> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> (11)</p>
    <p>The state of charge (SOC) is an indication of a battery’s charge level, expressed in percentage. Several techniques are used to estimate the state of charge of the battery (SOC). The techniques are <xref ref-type="bibr" rid="scirp.143654-14">
      [14]
     </xref> <xref ref-type="bibr" rid="scirp.143654-21">
      [21]
     </xref>:</p>
    <p>Various mathematical methods of estimation are classified according to methodology in the various literature:</p>
    <p>In this project, using the Coulomb-counting method, the state of charge is given by Equation (7) <xref ref-type="bibr" rid="scirp.143654-9">
      [9]
     </xref>:</p>
    <p>
     <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mtext>
         SOC 
       </mtext> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mi>
          t 
        </mi> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         = 
       </mo> 
       <mtext>
         SOC 
       </mtext> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mi>
           t 
         </mi> 
         <mo>
           − 
         </mo> 
         <mi>
           Δ 
         </mi> 
         <mi>
           t 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
       <mo>
         + 
       </mo> 
       <mstyle displaystyle="true"> 
        <mrow> 
         <msubsup> 
          <mo>
            ∫ 
          </mo> 
          <mrow> 
           <mi>
             t 
           </mi> 
           <mo>
             − 
           </mo> 
           <mi>
             Δ 
           </mi> 
           <mi>
             t 
           </mi> 
          </mrow> 
          <mi>
            t 
          </mi> 
         </msubsup> 
         <mrow> 
          <mfrac> 
           <mi>
             i 
           </mi> 
           <mi>
             C 
           </mi> 
          </mfrac> 
          <mtext>
            d 
          </mtext> 
          <mi>
            t 
          </mi> 
         </mrow> 
        </mrow> 
       </mstyle> 
      </mrow> 
     </math> (12)</p>
    <p>i &gt; 0 in charge, i &lt; 0 in discharge</p>
    <p>where, 
     <math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <mtext>
         SOC 
       </mtext> 
       <mrow> 
        <mo>
          ( 
        </mo> 
        <mrow> 
         <mi>
           t 
         </mi> 
         <mo>
           − 
         </mo> 
         <mi>
           Δ 
         </mi> 
         <mi>
           t 
         </mi> 
        </mrow> 
        <mo>
          ) 
        </mo> 
       </mrow> 
      </mrow> 
     </math> is the previous state of charge and i is the battery current.</p>
    <fig id="fig4" position="float">
     <label>Figure 4</label>
     <caption>
      <title>Figure 4. Voltage divider bridge.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId42.jpeg?20250630085225" />
    </fig>
    <p>The voltage applicable to the microcontroller is approximately 5 V. In this case, a voltage rectifier bridge must be added to adapt the voltage of the battery bank to the input of the Arduino microcontroller. <xref ref-type="fig" rid="fig4">
      Figure 4
     </xref> illustrates the voltage divider bridge.</p>
    <p>We apply the voltage divider law, and the expression is:</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          V 
        </mi> 
        <mrow> 
         <mi>
           o 
         </mi> 
         <mi>
           u 
         </mi> 
         <mi>
           t 
         </mi> 
        </mrow> 
       </msub> 
       <mo>
         = 
       </mo> 
       <mfrac> 
        <mrow> 
         <msub> 
          <mi>
            R 
          </mi> 
          <mn>
            1 
          </mn> 
         </msub> 
        </mrow> 
        <mrow> 
         <msub> 
          <mi>
            R 
          </mi> 
          <mn>
            1 
          </mn> 
         </msub> 
         <mo>
           + 
         </mo> 
         <msub> 
          <mi>
            R 
          </mi> 
          <mn>
            2 
          </mn> 
         </msub> 
        </mrow> 
       </mfrac> 
       <mo>
         ⋅ 
       </mo> 
       <msub> 
        <mi>
          V 
        </mi> 
        <mrow> 
         <mi>
           B 
         </mi> 
         <mi>
           A 
         </mi> 
         <mi>
           T 
         </mi> 
        </mrow> 
       </msub> 
      </mrow> 
     </math> (13)</p>
    <p>In our case, V<sub>BAT</sub> = 14 V, R<sub>1</sub> = 33 KΩ and R<sub>2</sub> = 57 KΩ.</p>
    <p>
     <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> 
       <msub> 
        <mi>
          V 
        </mi> 
        <mrow> 
         <mi>
           o 
         </mi> 
         <mi>
           u 
         </mi> 
         <mi>
           t 
         </mi> 
        </mrow> 
       </msub> 
       <mo>
         = 
       </mo> 
       <mfrac> 
        <mrow> 
         <mn>
           33 
         </mn> 
        </mrow> 
        <mrow> 
         <mn>
           33 
         </mn> 
         <mo>
           + 
         </mo> 
         <mn>
           57 
         </mn> 
        </mrow> 
       </mfrac> 
       <mo>
         ⋅ 
       </mo> 
       <mn>
         14 
       </mn> 
       <mo>
         = 
       </mo> 
       <mn>
         5 
       </mn> 
       <mtext>
           
       </mtext> 
       <mtext>
         V 
       </mtext> 
      </mrow> 
     </math> (14)</p>
    <p>When the battery is discharged to a SOC of 80% of its rated capacity, we have V<sub>MIN</sub> = 11.2 V. Converting V<sub>MIN</sub> into binary corresponds to 818.4.</p>
    <p>The aging of a battery is directly linked to the conditions in which it is used. It depends essentially on the number of charge-discharge cycles. To achieve a service life of 10 to 15 years, the battery must be kept in a state of charge of more than 50%. In this research, the algorithm developed maintains the state of charge of the battery at a SOC of 80% to reduce the aging of the battery. The aging of lead-acid batteries is determined by the following three factors <xref ref-type="bibr" rid="scirp.143654-22">
      [22]
     </xref>:</p>
    <p>High overloads cause corrosion, deformation, erosion of the plates, and overheating, and they can lead to the coalescence of the Pb particles with a consequent loss of porosity.</p>
   </sec>
   <sec id="s2_7">
    <title>2.7. Centrally Managed Multi-Inverters</title>
    <p>This type of architecture will allow great flexibility in the maintenance and management of the installation’s uptime by using only the number of inverters required. This management also ensures that the inverters are used at their optimum power depending on the amount of sunlight. <xref ref-type="fig" rid="fig5">
      Figure 5
     </xref> illustrates the architecture of centrally managed multi-inverters.</p>
    <fig id="fig5" position="float">
     <label>Figure 5</label>
     <caption>
      <title>Figure 5. Multi-inverter architecture with centralised management.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId47.jpeg?20250630085227" />
    </fig>
   </sec>
   <sec id="s2_8">
    <title>2.8. Model Assumptions</title>
   </sec>
  </sec><sec id="s3">
   <title>3. Results and Discussions</title>
   <sec id="s3_1">
    <title>3.1. Simulation Results</title>
    <p>In this section, we describe the design of the system studied and the results obtained by simulation using MATLAB software, Arduino IDE software and Proteus. Based on Equations (3)-(8), the block diagram for modelling the lead acid battery using MATLAB software is shown in <xref ref-type="fig" rid="fig6">
      Figure 6
     </xref>. The SOC is calculated using the Coulomb counting method.</p>
    <fig id="fig6" position="float">
     <label>Figure 6</label>
     <caption>
      <title>Figure 6. block diagram for modelling the lead acid battery using MATLAB.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId48.jpeg?20250630085229" />
    </fig>
    <fig id="fig7" position="float">
     <label>Figure 7</label>
     <caption>
      <title>Figure 7. Battery discharge.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId49.jpeg?20250630085229" />
    </fig>
    <p>For K = 0.0058935; A = 1.0154; V<sub>0</sub> = 12; V = 2.0354; C = 30; R = 0.073 and SOC<sub>0</sub> = 100. Simulation results in discharge mode are shown in <xref ref-type="fig" rid="fig7">
      Figure 7
     </xref>.</p>
    <p>From the SOC and Vbat variation curves, we can see that the battery is discharged to a SOC of 90.32%, corresponding to a battery discharge voltage of 12.65 V. The discharge current is also negative, which shows that the battery is in discharge mode (ut = 0). For K = 0.0058935; A = 1.0154; V<sub>0</sub> = 12; V = 2.0354; C = 30; R = 0.073 and SOC<sub>0</sub> = 90.32. Simulation results in charge mode are shown in <xref ref-type="fig" rid="fig8">
      Figure 8
     </xref>.</p>
    <fig id="fig8" position="float">
     <label>Figure 8</label>
     <caption>
      <title>Figure 8. Battery fully charged.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId50.jpeg?20250630085230" />
    </fig>
    <fig id="fig9" position="float">
     <label>Figure 9</label>
     <caption>
      <title>Figure 9. Influence of the thermal effect on resistance.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId51.jpeg?20250630085230" />
    </fig>
    <p>The simulation results show that the battery is in charge mode (ut = 1). We can see that the battery is fully charged (V<sub>AB</sub> = 14 V) with a state of charge of 100% and that it = 0. The polarisation resistance is infinite, as the theory states. <xref ref-type="fig" rid="fig9">
      Figure 9
     </xref> illustrates the Effect of temperature on resistance.</p>
    <p>From the variation curve, we can see that when the temperature increases, internal resistance also increases. We also know that heating metal increases its electrical resistance. <xref ref-type="fig" rid="fig10">
      Figure 10
     </xref> illustrates the Effect of temperature on battery voltage.</p>
    <fig id="fig10" position="float">
     <label>Figure 10</label>
     <caption>
      <title>Figure 10. Effect of temperature on battery voltage.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId52.jpeg?20250630085229" />
    </fig>
    <p>We found that the voltage decreased when the temperature fell below 25˚C. At temperatures above 25˚C, the voltage increases. So, if the voltage drops, this also affects the battery’s SOC. <xref ref-type="fig" rid="fig11">
      Figure 11
     </xref> shows the influence of temperature on the battery’s capacity.</p>
    <fig id="fig11" position="float">
     <label>Figure 11</label>
     <caption>
      <title>Figure 11. Influence of temperature on the battery capacity.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId53.jpeg?20250630085229" />
    </fig>
    <p>We note an increase in discharge capacity as the SOC decreases. If the discharge capacity increases, this indicates that the battery capacity is decreasing. When the battery is at a temperature below 0˚C, the resistance of the sulphuric acid solution will continue to increase, the polarization effect, reducing the capacity of the battery. Consequently, when the state of charge decreases, the depth of the battery increases, causing the battery to age. For K = 0.00004308; A = 1.889; V<sub>0</sub> = 12.16; B = 0.3053; C = 30; R = 0.0006, <xref ref-type="fig" rid="fig12">
      Figure 12
     </xref> illustrates the influence of battery discharge current on the battery voltage.</p>
    <fig id="fig12" position="float">
     <label>Figure 12</label>
     <caption>
      <title>Figure 12. Influence of battery discharge current on the battery voltage.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId54.jpeg?20250630085229" />
    </fig>
    <p>Simulation results show that the voltage decreases rapidly as the current increases.</p>
    <p>
     <xref ref-type="fig" rid="fig13">
      Figure 13
     </xref> illustrates the design of the battery charging and discharging system algorithm with temperature control using MATLAB software.</p>
    <fig id="fig13" position="float">
     <label>Figure 13</label>
     <caption>
      <title>Figure 13. Design diagram of the battery charging and discharging system algorithm with temperature control in MATLAB software.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId55.jpeg?20250630085229" />
    </fig>
    <p>We began to design the algorithm developed using MATLAB Simulink for a State of Charge (SOC) of 80% corresponding to a minimum voltage of discharge of 11.2 V. <xref ref-type="fig" rid="fig14">
      Figure 14
     </xref> shows the simulation results of the algorithm developed using MATLAB software.</p>
    <p>In the range [0, 3], SOC_BAT1 = SOC_BAT2 = 70%, Battery 1 is prioritized at the HIGH level indicating charging mode and Battery 2 at LOW level, indicating the discharging mode. Interval [3, 6] SOC_BAT1 = 100% and SOC_BAT2 = 70%, battery 1 is at LOW level indicating discharge mode and battery 2 is at HIGH level indicating charge mode. From interval [6, 8.5], SOC_BAT1 = SOC_BAT2 = 100%, batteries 1 and 2 are at the LOW level for discharging and the DC loads are at the HIGH level for charging mode. At the interval [8.5, 10], SOCBAT1 decreases below 80%, and SOC_BAT2 = 100%, so battery 1 is activated for charging mode. On the temperature control side, in interval [3, 6], the temperature is above 25˚C, a HIGH level is detected indicating a high temperature while for the interval [6, 10] the temperature is below 20˚C, and a low frequency is detected. <xref ref-type="fig" rid="fig15">
      Figure 15
     </xref> illustrates the designed and simulated algorithm of the battery charging and discharging system with temperature control using Arduino IDE software and Proteus software. We have fitted LEDs to indicate the operating status of the battery charge or discharge system for each switch.</p>
    <fig id="fig14" position="float">
     <label>Figure 14</label>
     <caption>
      <title>Figure 14. Variation curves for the state of charge and discharge of batteries with temperature control.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId56.jpeg?20250630085230" />
    </fig>
    <fig-group id="fig15" position="float">
     <fig id="fig15" position="float">
      <label>Figure 15</label>
      <caption>
       <title>(a)--(b)--Figure 15. Designed and simulated diagram of the battery charge and discharge management system with temperature control: (a) Battery 1 in charge, Battery 2 full charge. (b) Battery 1 full charge, Battery 2 full charge, DC LOAD in charging and FAN_CONTROL1 activated for temperatures above 40˚C.</title>
      </caption>
      <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId57.jpeg?20250630085230" />
     </fig>
     <fig id="fig15" position="float">
      <label>Figure 15</label>
      <caption>
       <title>(a)--(b)--Figure 15. Designed and simulated diagram of the battery charge and discharge management system with temperature control: (a) Battery 1 in charge, Battery 2 full charge. (b) Battery 1 full charge, Battery 2 full charge, DC LOAD in charging and FAN_CONTROL1 activated for temperatures above 40˚C.</title>
      </caption>
      <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId58.jpeg?20250630085229" />
     </fig>
    </fig-group>
    <p>The simulation results show that if battery 2 is fully charged, the Arduino microcontroller receives an analogue signal at the voltage divider bridge from the first grouping of batteries. This analogue signal is converted into a digital signal by the Arduino microcontroller, which sends a command to switch relay 1 across pin 8 to charge the first battery (<xref ref-type="fig" rid="fig15(a)">
      Figure 15(a)
     </xref>). Once the first group of batteries has been charged, the microcontroller opens the contact of relay 2 and sends a command to close relay 2 via pin 10 to charge the second group of batteries. Once all the batteries are charged and the sun is still shining, the Arduino microcontroller sends a command via pin 12 to close relay 3 to charge other DC electrical loads (<xref ref-type="fig" rid="fig15(b)">
      Figure 15(b)
     </xref>). Also, if the local temperature exceeds the battery’s operating range, the microcontroller sends a signal to close relay 4 or relay 5 for air conditioning. We can see that the simulation results obtained using Proteus and MATLAB Simulink software match.</p>
   </sec>
   <sec id="s3_2">
    <title>3.2. Experimental Results</title>
    <p>This part is devoted to the practical implementation of the battery charge/discharge management system combined with a temperature control system for the algorithm developed. We used an experimental set-up consisting of two batteries (6FM-7AH (12V7AH/20HR)), Rechargeable Sealed Lead-acid battery, Cycle; use: 14.5 - 14.9 V (25˚C); Initial current: less than 2.1 A; Standby use: 13.6 - 13.8 V (25˚C), an Arduino board, two potentiometers, four resistors, two voltage divider bridges, connection cables, four relays, four LEDs, a DHT11 temperature sensor and a test plate. In this study, the LEDs will be powered if the relay is activated for each test of the algorithm developed. <xref ref-type="fig" rid="fig16">
      Figure 16
     </xref> and <xref ref-type="fig" rid="fig17">
      Figure 17
     </xref> show the assembly of the developed algorithm using arduino IDE software.</p>
    <fig id="fig16" position="float">
     <label>Figure 16</label>
     <caption>
      <title>Figure 16. Battery 1 charging indicator.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId59.jpeg?20250630085231" />
    </fig>
    <fig id="fig17" position="float">
     <label>Figure 17</label>
     <caption>
      <title>Figure 17. Battery 2 charging indicator.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId60.jpeg?20250630085231" />
    </fig>
    <p>From the experimental results, we can see that for a discharge of 80% of the rated capacity, relay 1 is activated to charge battery 1 (VBAT1) first. If the first group of batteries is charged, relay 2 is activated by the Arduino UNO microcontroller to charge battery 2. In addition, if all the batteries are 100% charged, relay 3 is activated by the Arduino UNO microcontroller to charge other DC electrical loads. For temperature control, if the temperature exceeds 25˚C, relay 4 is activated for fan conditioning.</p>
    <p>
     <xref ref-type="fig" rid="fig18">
      Figure 18
     </xref>shows the display of the experimental results of the algorithm studied using the serial monitor.</p>
    <p>We transferred the experimental results to Excel using the Plx_DAQ application. <xref ref-type="fig" rid="fig19">
      Figure 19
     </xref> shows the variation in temperature and humidity as a result of temperature and humidity saved in Excel.</p>
    <fig id="fig18" position="float">
     <label>Figure 18</label>
     <caption>
      <title>Figure 18. Displaying results using the serial monitor.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId61.jpeg?20250630085231" />
    </fig>
    <fig id="fig19" position="float">
     <label>Figure 19</label>
     <caption>
      <title>Figure 19. Temperature and humidity variation curves obtained by Plx_DAQ on date 7/11/2024.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/1771216-rId62.jpeg?20250630085231" />
    </fig>
    <p>From the temperature and humidity variation curve, we can see that if the temperature increases, the humidity decreases and vice versa. The measured values of temperature using DHT11 are between 23˚C to 27˚C. Based on the measured values on 7/11/2024, we can see that the temperature was high. According to the operating range of the lead-acid battery, we note that the battery requires air conditioning, because we see that the minimum temperature obtained by experimentation is over 25˚C.</p>
   </sec>
  </sec><sec id="s4">
   <title>4. Discussions</title>
   <p>
    <xref ref-type="bibr" rid="scirp.143654-3">
     [3]
    </xref> <xref ref-type="bibr" rid="scirp.143654-5">
     [5]
    </xref> <xref ref-type="bibr" rid="scirp.143654-6">
     [6]
    </xref> <xref ref-type="bibr" rid="scirp.143654-11">
     [11]
    </xref> and <xref ref-type="bibr" rid="scirp.143654-12">
     [12]
    </xref> have developed algorithms for managing the charge and discharge of a single battery, showing the importance of each method used and its performance. Our novelty focuses on the development of an algorithm for managing the charging and discharging of batteries in a solar system in order to optimize the energy produced, using an Arduino microcontroller. The algorithm developed also performs well on the state of charge and discharge of the battery and contributes to good optimal management of the solar energy produced using the algorithm developed compared to the existing solar installation kit. The algorithm developed enables the life of a battery to be maximized by managing the state of charge at a minimum value of 80%, corresponding to a battery depth of discharge of 20%. The algorithm developed also manages temperature, which has a negative effect on battery capacity and internal resistors. At high temperatures, increasing the service current accelerates the build-up of overcharge; at the same time, it also accelerates the rate of corrosion of the grid and the generation and precipitation of gases, thus shortening the aging of the battery. <xref ref-type="bibr" rid="scirp.143654-15">
     [15]
    </xref> reveals that a battery depth of discharge of 20% corresponds to a maximum number of battery cycles of 8500. This author indicates that as the depth of discharge increases, the number of battery cycles decreases, which has an impact on reducing the life of a battery. <xref ref-type="bibr" rid="scirp.143654-14">
     [14]
    </xref> describes how impedance measurements combined with fuzzy logic data analysis have been used to estimate the state-of-health (SOH) of lead-acid batteries.</p>
   <p>The algorithm of the mechanism developed disconnects the battery from the load when the voltage exceeds the minimum value. With the algorithm we have developed, it is possible to recover the energy lost as a result of the problem of charging and discharging the batteries that are lacking in the various solar fields in Burundi. We designed and simulated the algorithm we developed using MATLAB software and then the Arduino IDE and Proteus software for comparative study. We found that the simulation results obtained with Proteus and MATLAB Simulink were the same. The battery charge and discharge management system algorithm that was developed can be used to manage the charge and discharge of a single battery bank with a direct power supply to the other DC loads. In this case, the DC loads will have to be connected directly to the space to charge the second battery bank. We note that the simulation results using Proteus and MATLAB Simulink software and the experimental results are matched, which shows the effectiveness of the algorithm developed.</p>
  </sec><sec id="s5">
   <title>5. Conclusion</title>
   <p>The exploitation of renewable energies as part of sustainable development began with research into fossil and nuclear energies. Batteries (accumulators) have now become a solution for storing energy, which can be recovered in the form of energy produced by discharging or by regeneration through a charging phase. In this project, we showed the different research works on the management of charge and discharge of batteries studied by different authors with different methods. It was noted that it is important to know the state of charge and discharge of a battery in different applications. We have shown the different cases that cause energy losses from batteries in a photovoltaic system. We have modelled and simulated the lead acid battery. We have shown the simulation results for the charging and discharging of the battery. We found that if the voltage decreases, the battery’s state of charge also decreases. Based on the simulation results, we showed the effect of temperature on the voltage and internal resistance of the battery, as well as its effect on the aging of the lead acid battery when the DoD Exceeds 20%. We presented the factors that influence the lifetime of a lead-acid battery in a solar system.</p>
   <p>We have developed an algorithm based on a mechanism for managing the charge and discharge of two groups of batteries for optimum management of the solar energy produced using an Arduino UNO microcontroller. We designed and simulated the algorithm developed using MATLAB2020a software, then Proteus software and the Arduino IDE software. We ended with an experimental study using a prototype. We note that the battery requires air conditioning, because we see that the minimum temperature obtained by experimentation is over 25˚C. The simulation results using Proteus, Arduino IDE, MATLAB Simulink and the experimental results are matched, demonstrating the validity and effectiveness of the algorithm developed.</p>
   <p>In relation to novelty, this project contributes to the implementation of an automatic mechanism for optimally managing the solar energy produced, based on a system for managing the charging and discharging of batteries using an Arduino microcontroller.</p>
   <p>Given that the current solar kit is not equipped with this mechanism, the importance of the system studied is that it allows the recovery of lost energy and the optimal management of the solar energy produced with the Internet of Things (IOT). The system developed is applicable to other applications requiring energy storage in batteries for optimum management of electrical energy.</p>
   <p>The results of this project will be a good reference for the study of the gain of the solar tracker compared to the fixed solar panel for the future project of integration of solar tracker with battery management in Burundi supported by an Erasmus+ grant and the doctoral school of Burundi.</p>
  </sec><sec id="s6">
   <title>Acknowledgements</title>
   <p>Erasmus+ and Doctoral School of Burundi supported this project.</p>
  </sec><sec id="s7">
   <title>Authors’ Contributions</title>
   <p>Bukuru Denis: Conceptualization, Methodology, Supervision, Project administration, Validation, Writing—review and editing;</p>
   <p>Pritpal (“Pali”) Singh: Conceptualization, Methodology, Supervision, Project administration, Validation, Writing—review and editing;</p>
   <p>Niyonzima Jean Bosco: Supervision, Project administration, Writing—review and editing, Validation;</p>
   <p>Ntawuhorakomeye Noel: Supervision, Project administration, Writing—review and editing, Validation.</p>
  </sec>
 </body><back>
  <ref-list>
   <title>References</title>
   <ref id="scirp.143654-ref1">
    <label>1</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Benhamida, M.T. and Sahraoui, T. (2022) Estimation de l’état de charge d’une batterie Li-Ion utilisé dans un véhicule électrique. Universite kasdi merbah ouargla. &gt;https://dspace.univ-ouargla.dz/jspui/handle/123456789/30197 
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref2">
    <label>2</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Singh, P., Vinjamuri, R., Wang, X. and Reisner, D. (2006) Design and Implementation of a Fuzzy Logic-Based State-Of-Charge Meter for Li-Ion Batteries Used in Portable Defibrillators. Journal of Power Sources, 162, 829-836. &gt;https://doi.org/10.1016/j.jpowsour.2005.04.039
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref3">
    <label>3</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Singh, P., Fennie, C. and Reisner, D.E. (1999) Fuzzy Logic Enhanced Electrochemical Impedance Spectroscopy (FLEEIS) to Determine Battery State-of-Charge. Proceedings 15th Annual Battery Conference on Applications and Advances, 1-5 Aug 1999, Vancouver, page.
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref4">
    <label>4</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Han, W., Wik, T., Kersten, A., Dong, G. and Zou, C. (2023) Reconfiguration Next-Generation Battery Management Systems: Dynamic Reconfiguration. IEEE Industrial Electronics Magazine, 14, 20-31.
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref5">
    <label>5</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Belazi, N. (2012) Estimation de l’état de charge (SOC) et de l’état de santé (SOH) d’une batterie Lithium-Ion utilisée pour les voitures électriques. Mémoire de maîtrise électronique, Montréal, École de technologie supérieure. &gt;https://espace.etsmtl.ca/id/eprint/967 
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref6">
    <label>6</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Qudah, A. and Mokheimer, E.M.A. (2024) Optimizing Photovoltaic and Battery Integration for RO Desalination Using Differential Evolution Algorithm. Energy Proceedings, 43, 1-7.
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref7">
    <label>7</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Ziat, K., Louahlia, H., Gualous, H. and Schaetzel, P. (2020) Effet du courant de charge et décharge sur l’augmentation de la température d’une batterie [Charge and Discharge Current Effect on Lithium Ion Battery Temperature Elevation]. Energy Storage. 28è conférence Française de thermique, 1-8. &gt;https://www.energyproceedings.org/wpcontent/uploads/icae2023/1704027976.pdf 
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref8">
    <label>8</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Balasingam, B., Ahmed, M. and Pattipati, K. (2020) Battery Management Systems—Challenges and Some Solutions. Energies, 13, Article 2825. &gt;https://doi.org/10.3390/en13112825
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref9">
    <label>9</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Dufo-López, R., Cortés-Arcos, T., Artal-Sevil, J.S. and Bernal-Agustín, J.L. (2021) Comparison of Lead-Acid and Li-Ion Batteries Lifetime Prediction Models in Stand-Alone Photovoltaic Systems. Applied Sciences, 11, Article 1099. &gt;https://doi.org/10.3390/app11031099
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref10">
    <label>10</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Imadan, A.I., Semassou, G.C. and Tossa, A.K. (2024) Étude de faisabilité technicoéconomique d’installation d’une filière de régénération de batteries stationnaires solaires au plomb acide au Bénin. Afrique SCIENCE, 24, 122-131. &gt;http://www.afriquescience.net
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref11">
    <label>11</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Abdelhamid, B. (2023) Conception et implémentation d’un système de stockage à base batteries dans une chaîne de conversion photovoltaïque. Université de Ghardaïa, Algérie, 1-101. 
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref12">
    <label>12</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Draia, U.A. (2021) Contribution à la réalisation d’un système de suivi et de gestion des batteries d’accumulateurs. 
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref13">
    <label>13</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Aymen, B.M. and Islam, S. (2023) Étude et Réalisation d’un Chargeur Batterie Ni-MH. Université de Mohamed El-Bachir El-Ibrahimi—Bordj Bou Arreridj. 
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref14">
    <label>14</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Singh, P. and Reisner, D. (2002) Fuzzy Logic-Based State-Of-Health Determination of Lead Acid Batteries. 24th Annual International Telecommunications Energy Conference, Montreal, 29 September-3 October 2002, 583-590 &gt;https://doi.org/10.1109/intlec.2002.1048716
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref15">
    <label>15</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Chang, W. (2013) The State of Charge Estimating Methods for Battery: A Review. ISRN Applied Mathematics, 2013, Article ID: 953792. &gt;https://doi.org/10.1155/2013/953792
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref16">
    <label>16</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     https://www.victronenergy.fr/upload/documents/Optimiser-la-vie-des-batteries-plomb-Leçon-V02-Bis.pdf 
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref17">
    <label>17</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Singh, P., Damodar, Y.S., Fennie, C. and Reisner, D.E. (2002) Fuzzy Logic-Based Determination of Lead Acid Battery State-of-Charge by Impedance Interrogation Methods. Proceedings. EVS-17, Montreal, 15-18 October 2000, 1-19.
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref18">
    <label>18</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Saleh, M. (199) Introduction to Matlab for Engineers. Industrial Robot: An International Journal, 25, 1-74. &gt;https://doi.org/10.1108/ir.1998.04925dae.002 
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref19">
    <label>19</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Achaibou, N., Haddadi, M. and Malek, A. (2012) Modeling of Lead Acid Batteries in PV Systems. Energy Procedia, 18, 538-544. &gt;https://doi.org/10.1016/j.egypro.2012.05.065 
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref20">
    <label>20</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Achaibou, N., Haddadi, M. and Malek, A. (2012) Modeling of Lead Acid Batteries in PV Systems. Energy Procedia, 18, 538-544. &gt;https://doi.org/10.1016/j.egypro.2012.05.065
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref21">
    <label>21</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Chang, W. (2013) The State of Charge Estimating Methods for Battery: A Review. ISRN Applied Mathematics, 2013, Article ID: 953792. &gt;https://doi.org/10.1155/2013/953792
    </mixed-citation>
   </ref>
   <ref id="scirp.143654-ref22">
    <label>22</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Achaibou, N., Malek, A., Bacha, N., et al. (2015) Modèle de Vieillissement Des Batteries Plomb-Acide Dans Les Systèmes PV. 61-66.&gt;https://www.researchgate.net/profile/Nadia-Achaibou/publication/242132515_Modele_de_Vieillissement_des_Batteries_Plomb-Acide_dans_les_Sys-temes_PV/links/55e46c9e08ae2fac4722e0a2/Modele-de-Vieillissement-des-Batteries-Plomb-Acide-dans-les-Systemes-PV.pdf
    </mixed-citation>
   </ref>
  </ref-list>
 </back>
</article>