<?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">CS</journal-id><journal-title-group><journal-title>Circuits and Systems</journal-title></journal-title-group><issn pub-type="epub">2153-1285</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/cs.2018.92003</article-id><article-id pub-id-type="publisher-id">CS-82441</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject><subject> Engineering</subject><subject> Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Development of a Solar Controller with MLI Control
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Mamadou</surname><given-names>Wade</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>Moussa</surname><given-names>Gueye</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>Ousmane</surname><given-names>Sow</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>Daouda</surname><given-names>Sow</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>Babou</surname><given-names>Dione</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>Gregoire</surname><given-names>Sissoko</given-names></name><xref ref-type="aff" rid="aff3"><sup>3</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff2"><addr-line>University Institute of Technology, University of Thiès, Thiès, Sénégal</addr-line></aff><aff id="aff1"><addr-line>Laboratory of Sciences and Techniques of Water and Environment, Polytechnic School of Thiès, Thiès, Senegal</addr-line></aff><aff id="aff3"><addr-line>Laboratory of Semiconductors and Solar Energy, Physics Department, Faculty of Science and Technology, University Cheikh Anta Diop, Dakar, Senegal</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>gsissoko@yahoo.com(GS)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>08</day><month>02</month><year>2018</year></pub-date><volume>09</volume><issue>02</issue><fpage>22</fpage><lpage>40</lpage><history><date date-type="received"><day>10,</day>	<month>November</month>	<year>2017</year></date><date date-type="rev-recd"><day>9,</day>	<month>February</month>	<year>2018</year>	</date><date date-type="accepted"><day>12,</day>	<month>February</month>	<year>2018</year></date></history><permissions><copyright-statement>&#169; 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><p>
 
 
  This work presents the development of a solar regulator which manages the charge and discharge of a (lead) battery installed in a photovoltaic system in order to extend its lifetime. The regulator is controlled by a microcontroller (PIC16F877A) and protects the battery against overcharging, deep discharge, but also against temperature drifts. The operating principle is based on the control of a DC-DC converter by a rectangular signal MLI generated by the microcontroller. In addition to the protection function of the regulator, there is included a control and monitoring panel consisting of a visualization interface on which the system quantities can be observed. Thus, it will be given to the user to be able to act on the system. This display interface uses as a display an LCD screen and LEDs. Simulation results are presented to illustrate the operation of the proposed solar controller.
 
</p></abstract><kwd-group><kwd>Solar Controller</kwd><kwd> Three-State Charge Algorithm</kwd><kwd> Battery</kwd><kwd> DC/DC Converter</kwd><kwd> Microcontroller</kwd><kwd> Monitoring</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>In stand-alone photovoltaic systems, rechargeable batteries are widely used to store excess energy and to supply low and medium power loads. However, these batteries are so fragile in the face of overcharging, deep discharge and temperature and current drifts that particular attention must be paid to the management of the charge and discharge in order to increase the duration life of the installation. It is therefore necessary to associate them with an appropriate load regulator to ensure their protection. In practice, there are several methods for charging solar batteries. The most common is Constant voltage charge and Constant current load [<xref ref-type="bibr" rid="scirp.82441-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.82441-ref2">2</xref>] . Battery users have noticed that there is a big difference between the two charging methods: constant current and constant voltage, where each has its advantages and disadvantages [<xref ref-type="bibr" rid="scirp.82441-ref3">3</xref>] . In order to obtain better performances, it is imperative to combine these two load methods into a single algorithm called “three-state charge algorithm”. The aim of this work is to develop a PWM regulator for the regulation of the charge and discharge of solar batteries, using a three-state charge algorithm and adaptable to 12 V and 24 V batteries. A programmed digital microchip microcontroller (PIC16F877A) is used. We also include in the study a monitoring and monitoring component. To do this, we will use an LCD screen that will display useful information related to the system. Additional constraints imposed on the load controller, such as the ability to vary the parameters of the control algorithm and digitally display the useful quantities of the system, favor microcontroller-based solutions. The parameters to be displayed are, among other things, the voltage across the photovoltaic panel, the current delivered by the photovoltaic panel, the voltage across the battery, the battery charging or discharging current, the current drawn by the load and the duty cycle.</p></sec><sec id="s2"><title>2. Materials and methods</title><p>Before charging a battery, it is necessary to specify the type, discharge mode, time required for charging, nominal voltage and extreme operating temperature. In this study, we use a sealed battery which characteristics are listed in <xref ref-type="table" rid="table1">Table 1</xref>. In this study, the battery is modeled by a voltage source in series with a resistance that represents its internal resistance. The photovoltaic panel is modeled by a voltage source with its internal resistance in series and all in parallel with a diode, so as to have at the output a voltage of 5 V and a current of 5 A. The load is modeled by a resistance.</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Characteristics of the used battery</title></caption><table><tbody><thead><tr><th align="center" valign="middle"  colspan="4"  >Battery Model: 6-GFM-150</th></tr></thead><tr><td align="center" valign="middle" >Nominal voltage</td><td align="center" valign="middle" >12 V</td><td align="center" valign="middle" >Maximum discharge current (25˚C)</td><td align="center" valign="middle" >1000 A (5 s)</td></tr><tr><td align="center" valign="middle" >Number of Cells</td><td align="center" valign="middle" >6</td><td align="center" valign="middle" >Maximum load current</td><td align="center" valign="middle" >60 A</td></tr><tr><td align="center" valign="middle"  rowspan="4"  >Nominal Capacity 77 F (25˚C)</td><td align="center" valign="middle" >C<sub>20</sub> = 150 Ah</td><td align="center" valign="middle" >Short circuit current</td><td align="center" valign="middle" >3300 A</td></tr><tr><td align="center" valign="middle" >C<sub>10</sub> = 136 Ah</td><td align="center" valign="middle" >Charging temperature</td><td align="center" valign="middle" >−10˚C - 60˚C</td></tr><tr><td align="center" valign="middle" >C<sub>5</sub> = 130.5 Ah</td><td align="center" valign="middle" >Discharge temperature</td><td align="center" valign="middle" >−20˚C - 60˚C</td></tr><tr><td align="center" valign="middle" >C<sub>1</sub> = 105 Ah</td><td align="center" valign="middle" >Storage temperature</td><td align="center" valign="middle" >−20˚C - 60˚C</td></tr><tr><td align="center" valign="middle" >Self-discharge (20˚C)</td><td align="center" valign="middle" >3% per month</td><td align="center" valign="middle" >Compensation temperature</td><td align="center" valign="middle" >−30 Mv/˚C</td></tr><tr><td align="center" valign="middle" >Internal battery resistor fully charged (25˚C)</td><td align="center" valign="middle" >3.5 mΩ</td><td align="center" valign="middle" >Load at constant voltage (25˚C)</td><td align="center" valign="middle" >14.5 - 14.9 V</td></tr></tbody></table></table-wrap><sec id="s2_1"><title>2.1. Three-step Charging algorithm for lead-Acid batteries</title><p>In practice, the most common methods for charging solar batteries are constant voltage charging and constant current charging. There is a great difference between the two methods [<xref ref-type="bibr" rid="scirp.82441-ref4">4</xref>] . In order to achieve better performance, it is imperative to combine these two charging methods in a single algorithm known as a “three-step charging algorithm” which incorporates the advantages of constant current charging (equalizing and rapid charging of the battery) and the advantages of constant voltage charging (high performance overload control) [<xref ref-type="bibr" rid="scirp.82441-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.82441-ref5">5</xref>] . A first charge phase, with a constant current (Bulk load or normal load), is followed by two constant voltage charging phases: absorption charge or equalization and floating charge or retention charge [<xref ref-type="bibr" rid="scirp.82441-ref4">4</xref>] .</p><sec id="s2_1_1"><title>2.1.1. Bulk charging or normal Charging</title><p>It is a constant current charging mode that ensures a quick recovery of the battery capacity but with a difficulty to fully charge the battery. During this phase, the panel provides the maximum power to the battery. When the battery voltage reaches the threshold defined by the absorption voltage equation (1) [<xref ref-type="bibr" rid="scirp.82441-ref6">6</xref>] , the controller automatically switches to this phase.</p><p>V R = V 25 − 0.03 &#215; ( T b a t − 25 ) (1)</p><p>with: V<sub>25</sub> the battery voltage at 25˚C, V<sub>R</sub> the battery voltage at temperature T<sub>bat</sub> in ˚C.</p></sec><sec id="s2_1_2"><title>2.1.2. Absorption or Equalization Charging</title><p>This phase is switched on once the battery voltage reaches the threshold defined by the absorption voltage. During this equalization phase, the microcontroller will act, via the driver, on the MOSFET to chop the charging current and keep the battery voltage accordingly below the absorption voltage. This operation allows the regulator to supplement the battery charge but also to protect it against overload phenomena [<xref ref-type="bibr" rid="scirp.82441-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.82441-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.82441-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.82441-ref7">7</xref>] . The end of this phase takes place when the capacity of the battery approaches its totality and the charging current decreases to the value I<sub>min</sub>. This value is set at C/100, where C is the capacity of the battery [<xref ref-type="bibr" rid="scirp.82441-ref5">5</xref>] .</p></sec><sec id="s2_1_3"><title>2.1.3. Floating charging or holding Charging</title><p>When the charging current reaches the low value I<sub>min</sub>, the charging process enters the third and final phase of the charging algorithm which is the “float charge”. This is a maintenance step where the battery voltage is reduced to a just sufficient V<sub>float</sub> level to compensate for self-discharge of the cells. The load current becomes very low and almost constant; it is the state of full load [<xref ref-type="bibr" rid="scirp.82441-ref4">4</xref>] . In order to compensate for the self-discharge phenomenon, a permanent load is applied and the set point voltage is lowered to 13.6 V at 25˚C. For another value of the temperature, the float voltage is obtained from Equation (2) [<xref ref-type="bibr" rid="scirp.82441-ref6">6</xref>] :</p><p>V float = V float_25 − 0.03 &#215; ( T b a t − 25 ) (2)</p><p>with V float_25 = V float   &#224;   25 ˚ C = 13.6   V , T b a t : temperature of battery in ˚C.</p></sec></sec><sec id="s2_2"><title>2.2. Charging flowchart</title><p><xref ref-type="fig" rid="fig1">Figure 1</xref> shows the charging diagram of the lead battery, developed during this study, according to the three preceding charging phases.</p></sec></sec><sec id="s3"><title>3. Technology of the Regulator</title><p>The new PWM technology of the regulators is a very fast and efficient method which allows reaching the state of full charge of a solar battery, necessary to prolong its lifetime [<xref ref-type="bibr" rid="scirp.82441-ref4">4</xref>] . In this section, we develop the electronic scheme of the MLI regulator which allows to manage the energy produced by the photovoltaic panel and to transmit it to the battery and to the load according to the defined algorithm. This algorithm will be implemented in its digital version on a microcontroller, the PIC16F877A.</p><sec id="s3_1"><title>3.1. PWM battery regulator</title><p>The system diagram of the charging system is shown in <xref ref-type="fig" rid="fig2">Figure 2</xref>. This system consists mainly of four entities which are the photovoltaic generator, the DC-DC converter, the lead-acid battery and the control and monitoring system.</p><sec id="s3_1_1"><title>3.1.1. Power supply</title><p>Voltage regulators</p><p>For the operation of the sensors and the power supply of the microcontroller, a voltage of 5 V is required from a stabilized power supply +5 V/−5 V. We use the “integrated” regulators LM7805 and LM7905, simple to implement [<xref ref-type="bibr" rid="scirp.82441-ref8">8</xref>] .</p><p>The LM317 regulator, which can be used as a constant current source, is chosen because it is very suitable for producing voltage-stabilized and/or current-limited power supplies. It is adjustable and programmable and capable of supplying 1.5 A at an output voltage ranging from 1.25 V to 37 V, thus adaptable to the other stabilized power supply of the system, which must deliver a voltage of 1.25 V to 35 V.</p></sec><sec id="s3_1_2"><title>3.1.2. Power section</title><p>This Buck DC/DC converter block transfers and converts power and controls the battery voltage and vary the charging current.</p><p>Non-return and freewheel diodes</p><p>The Schottky type UF5406 non-return diode is chosen to protect the solar panel from the reverse current that can enter the photovoltaic module and as a freewheel diode.</p><p>MOSFET Transistors and Driver</p><p>The MOSFET, controlled by the microcontroller via the driver, is the component that will act as a chopper and will control the charging current. The MOSFET driver we use is the IR2112 which allows adapting the signal from the PIC to the MOSFET. The microcontroller delivers a PWM voltage (0 - 5 V) to the driver, which returns it as a slave control voltage (0 - 20 V) to the MOSFET. It must control two MOSFET transistors: the first (panel side) for chopping the charging current and the second (charging side) for disconnecting/reconnecting the load.</p><p>Smoothing inductance</p><p>The value of the current smoothing inductance is determined from Equation (3) [<xref ref-type="bibr" rid="scirp.82441-ref9">9</xref>] :</p><p>L s = U e 4 F Δ I s max (3)</p><p>U e : output voltage of the PV generator (V);</p><p>F : frequency (Hz);</p><p>Δ I s max : maximum current ripple (A).</p><p>We take a maximum ripple of 1% for an intensity of 5 A, corresponding to a current Δ I s max = 0.05   A . For a frequency of the transistor F = 50   kHz and a voltage U e = 2 0   V , the normalized value chosen is L s = 2700   μ H .</p><p>Filter Capacitor</p><p>The circuit requiring a very steady voltage, we intercalate at the output, capacitors of filtering which capacity is given by [<xref ref-type="bibr" rid="scirp.82441-ref9">9</xref>] :</p><p>C s = U e 32 ⋅ L s ⋅ Δ U s o _ max ⋅ F 2 (4)</p><p>U e : output voltage of the PV generator (V);</p><p>C : capacity of the capacitor (F);</p><p>Δ U s o _ max : amplitude of the variations between the maximum and the minimum of the voltage or the maximum permissible ripple (V);</p><p>F : frequency (Hz);</p><p>L s : smoothing inductance (H).</p><p>We impose a permissible ripple corresponding to Δ U s o _ max = 1   V , with U e = 20   V , L s = 2700   μ H and a frequency of 50 kHz, which gives a normalized value C s = 100   nF .</p></sec></sec><sec id="s3_2"><title>3.2. Acquisition of Parameters</title><sec id="s3_2_1"><title>3.2.1. Voltage Measurement</title><p>The PIC16F877A has a voltage of the order of 5 V on its input pins. But since the voltage and battery voltage ranges greatly exceed the capabilities of the PIC16F877A, we use a voltage divider with standard resistors to bring the measured voltages back to reduced voltages that do not destroy the microcontroller and which can be read and interpreted. The output voltage of the source varies between 0 V and 20 V while the battery can operate between the deep discharge voltage of 24 V (respectively 12 V) and the absorption voltage of 29 V (respectively 14.5 V) for a 24 V battery (respectively 12 V). These two different voltage ranges must be converted into a range from 0 V to 5 V so that the PIC can read them, hence:</p><p>maximumratiosourcevoltagedivider = 5 − 0 20 − 0 = 1 4</p><p>For the battery, the voltage of 30 V cannot be reached; we use a ratio divider of 6 to not exceed the 5 V admissible by the microcontroller PIC.</p></sec><sec id="s3_2_2"><title>3.2.2. Current Measurement</title><p>We use two ACS712 current sensors. One is used to measure the current delivered by the photovoltaic panel to the battery and/or to the load and the other is used to measure the charging and discharging current of the battery. Since the panel and battery currents are known, the current drawn by the load at any instant can be deduced.</p></sec><sec id="s3_2_3"><title>3.2.3. Temperature Measurement</title><p>It is carried out using the LM35 which is an integrated circuit calibrated for use as a precision temperature sensor. The output voltage of the LM35 sensor is given by Equation (5) which follows [<xref ref-type="bibr" rid="scirp.82441-ref10">10</xref>] :</p><p>V out ( V ) = 0.010 ( V / ˚ C ) &#215; T ( ˚ C ) (5)</p><p>V: sensor supply voltage (Volt);</p><p>T: temperature measured (˚C).</p><p>The temperature values are obtained by directly reading the analog voltage at the output of the LM35 temperature sensor. This voltage being proportional to the temperature, one deduces the value of the corresponding temperature Equation (5). The analog-digital converter (ADC) integrated into the PIC works on 10 bits (1024 quantization steps), which corresponds, for a full scale of 5 V, to a resolution of 5 mV. This is a high value compared to the 10 mV per ˚C we need. Therefore, if a temperature of 100˚C is considered, the sensor delivers only 1 V. The LM35, on the voltage scale of the microcontroller (0 V - 5 V) is therefore not well exploited. To use the full voltage range of the ADC and gain accuracy, we chose to insert a voltage amplifier with a gain close to 7. Thus, the voltage applied to the input of the ADC of the PIC is no longer 10 mV per ˚C but of 70 mV per ˚C. Under these conditions, the linear operating mode of this amplifier makes it possible to measure a temperature range between 0 and approximately 70˚C, which is largely sufficient for our study. The amplifier used is the INA122 specially dedicated to instrumentation and composed of two AOPs. Its gain G, defined by an external resistance RG to be added between pins 1 and 8, is given by the formula [<xref ref-type="bibr" rid="scirp.82441-ref11">11</xref>] :</p><p>G = 5 + 200   k Ω R G (6)</p><p>R<sub>G</sub>: external resistance to be added between pins 1 and 8 to define the gain.</p><p>Conditioning of the temperature sensor LM35 is shown in <xref ref-type="fig" rid="fig3">Figure 3</xref>.</p></sec></sec><sec id="s3_3"><title>3.3. Control and Display part</title><sec id="s3_3_1"><title>3.3.1. Microcontroller</title><p>We chose the PIC16F877A which has more I/O ports and can be reprogrammed several times thanks to its FLASH memory so that it performs one or more specific tasks [<xref ref-type="bibr" rid="scirp.82441-ref12">12</xref>] [<xref ref-type="bibr" rid="scirp.82441-ref13">13</xref>] . <xref ref-type="fig" rid="fig4">Figure 4</xref> shows the location of the pins.</p></sec><sec id="s3_3_2"><title>3.3.2. Part Display</title><p>LCD screen</p><p>Liquid crystal displays or LCDs capable of displaying all the usual alphanumeric characters and some additional symbols are chosen. They consume relatively little (from 1 mA to 5 mA) and require only 5 V to be able to power their internal driver and thus allow the display of the characters on the screen.</p><p>Communication with the LCD</p><p>We use the 4-bit mode of the LCD display, in other words the serial communication. The component proposes a transmission mode on 4 bits by passing the characters in two steps. Thus, only the 4 most significant bits (D 4 to D 7) of the display are used to transmit the data. The 4 least significant bits (D 0 to D 3) are then connected to ground, as shown in <xref ref-type="fig" rid="fig5">Figure 5</xref>.</p><p>LEDs Signal</p><p>In addition to displaying parameters on LCD, we have integrated three LEDs (red, yellow, green) on the board circuit. Their function is to indicate the charge phase but also give an idea of the charge state of the battery.</p></sec></sec></sec><sec id="s4"><title>4. Results of modeling and Simulation</title><p>The results presented here are obtained after modeling and simulation with Proteus ISIS which is a professional software used in electronics to simulate circuits and create artwork with its “Proteus ARES” add-on. The version used in this study is PROTEUS Version 7.10. <xref ref-type="fig" rid="fig6">Figure 6</xref> shows the schematic of the complete controller with all components. It is possible to charge with this system two types of batteries: 12 V or 24 V. The 12 V 24 V switch allows making the choice. <xref ref-type="fig" rid="fig7">Figure 7</xref> and <xref ref-type="fig" rid="fig8">Figure 8</xref> represent respectively the model of the stabilized variable power supply 1.25 V/24 V and the model of the symmetrical power supply +5 V/−5 V.</p><p>In <xref ref-type="fig" rid="fig9">Figure 9</xref>, we show the developed display system with LEDs and LCD. The three LEDs provide a visual indication of the charging phase of the battery. In what follows, the +++ symbol on the battery current indicates that the battery is charging. The discharge is indicated by the symbol −−−.</p><p>First charging phase: the red LED on <xref ref-type="fig" rid="fig1">Figure 1</xref>0 indicates that the first charging phase is in progress. It corresponds to the normal load, that is to say a constant current charging mode and ensures a fast recovery of the capacity of the battery. During this phase, the panel provides the maximum power to the battery. The battery charging parameters, temperature and panel voltage are displayed.</p><p>Second charging phase: the yellow LED indicates the second charging phase in progress corresponding to the first constant voltage phase <xref ref-type="fig" rid="fig1">Figure 1</xref>1. During this phase of equalization or absorption, the microcontroller acts, via the driver, on the MOSFET to chop the charging current and consequently keep the battery voltage below the absorption voltage. This operation allows the regulator to supplement the battery charge but also to protect it against overload phenomena [<xref ref-type="bibr" rid="scirp.82441-ref15">15</xref>] .</p><p>Third charging phase: the green LED indicates the current third phase corresponding to the maintenance phase <xref ref-type="fig" rid="fig1">Figure 1</xref>2. This step is a maintenance step where the battery voltage is reduced to a just sufficient V<sub>float</sub> level to compensate for self-discharge of the cells. The load current becomes very low and almost constant; it is the state of full load [<xref ref-type="bibr" rid="scirp.82441-ref16">16</xref>] . In this study, the set point voltage is set at a value of 13.6 V at 25˚C.</p><p>Once the battery enters a deep discharge phase, all three LEDs blink simultaneously <xref ref-type="fig" rid="fig1">Figure 1</xref>3 to inform that the battery is no longer allowed to discharge, the charge is then disconnected.</p><p>It should be noted that this assembly can be used with solar panels with a voltage not exceeding 20 V and a current not exceeding 5 A. To extend to other types of panels and batteries, we make some modifications in the power part and redo the calculations of the acquisition part.</p></sec><sec id="s5"><title>5. Conclusion</title><p>In this work, we developed a charge/discharge regulator for 12 V and 24 V lead-acid batteries. This controller, designed around the PIC16F877A microcontroller, is based on a three-stage charging algorithm in which a first constant current charging phase is followed by two phases at constant voltage. The proposed algorithm also incorporates protection against deep discharges and temperature drifts. In addition to the protective functions, the proposed controller incorporates a control and monitoring component. Indeed, it is equipped with a visualization interface on which the magnitudes of the system can be observed. It is also given to the user to be able to act on the system through two bistable switches for the choice of the battery (12 V or 24 V) or to dynamize the display of the LCD screen.</p></sec><sec id="s6"><title>Cite this paper</title><p>Wade, M., Gueye, M., Sow, O., Sow, D., Dione, B. and Sissoko, G. (2018) Development of a Solar Controller with MLI Control. Circuits and Systems, 9, 22-40. https://doi.org/10.4236/cs.2018.92003</p></sec><sec id="s7"><title>Appendix</title><p>In this part, we present the program executed and compiled with CCS Compiler, software specialized in the programming of PICs.</p><p>// PROGRAM UNDER CSS</p><p>#include</p><p>#include</p><p>// ConnectionsModuleLCD</p><p>#define LCD_RS_PIN PIN_D1</p><p>#define LCD_ENABLE_PIN PIN_D3</p><p>#define LCD_DATA4 PIN_D4</p><p>#define LCD_DATA5 PIN_D5</p><p>#define LCD_DATA6 PIN_D6</p><p>#define LCD_DATA7 PIN_D7</p><p>//End ConnectionsModuleLCD</p><p>#define ON_OFF PIN_C7</p><p>#define BOUTON PIN_C0</p><p>#define BOUTON_ON input_state(PIN_C0)==0</p><p>#define Choice_bat_ON input_state(PIN_C1)==0</p><p>#define LED_RED PIN_C3</p><p>#define LED_YELLOW PIN_C4</p><p>#define LED_GREEN PIN_C5</p><p>#USE PWM(OUTPUT=PIN_C2, FREQUENCY=50kHz, DUTY=100)</p><p>float Voltage_pv;</p><p>float Voltage_bat;</p><p>float Current_pv;</p><p>float Current_bat;</p><p>float Current_ch;</p><p>float Temperature;</p><p>float Voltage_absorption;</p><p>float Voltage_float;</p><p>float alpha;</p><p>int duty;</p><p>char choice_bat;</p><p>const int8 Imin = 1;</p><p>void DisplayFormat(void) {</p><p>if(BOUTON_ON){</p><p>lcd_putc('\f'); //Clear LCD Screen</p><p>printf(lcd_putc,&quot;Upv = %f V&quot;,Voltage_pv);</p><p>lcd_gotoxy(1,2);</p><p>printf(lcd_putc,&quot;Ubat = %f V&quot;,Voltage_bat);</p><p>lcd_gotoxy(1,3);</p><p>if(Current_bat&gt;=0){</p><p>printf(lcd_putc,&quot;Ibat = %f A +++&quot;,Current_bat);}</p><p>if(Current_bat&lt;0){</p><p>Current_bat = - Current_bat;</p><p>printf(lcd_putc,&quot;Ibat = %f A ---&quot;,Current_bat);}</p><p>lcd_gotoxy(1,4);</p><p>printf(lcd_putc,&quot;Temp = %f C&quot;,Temperature);</p><p>Delay_ms(2000);}</p><p>else{</p><p>lcd_putc('\f'); //Clear LCD Screen</p><p>printf(lcd_putc,&quot;Ipv = %f A&quot;,Current_pv);</p><p>lcd_gotoxy(1,2);</p><p>printf(lcd_putc,&quot;Icharge = %f A&quot;,Current_ch);</p><p>lcd_gotoxy(1,3);</p><p>printf(lcd_putc,&quot;alpha = %f%%&quot;,alpha*100);</p><p>lcd_gotoxy(1,4);</p><p>lcd_putc(&quot;Frequency = 50kHz&quot;);</p><p>Delay_ms(2000);}</p><p>}</p><p>void Mesure(void) {</p><p>set_adc_channel(2);</p><p>Delay_ms(10);</p><p>Voltage_bat = read_adc();</p><p>Delay_ms(10);</p><p>Vomtage_bat = (Voltage_bat/1023)*5*6;</p><p>set_adc_channel(0);</p><p>Delay_ms(10);</p><p>Voltage_pv = read_adc();</p><p>Delay_ms(10);</p><p>Voltage_pv = (Voltage_pv/1023)*5*4;</p><p>set_adc_channel(3);</p><p>Delay_ms(10);</p><p>Voltage_bat = read_adc();</p><p>Delay_ms(10);</p><p>Currentt_bat = (Currentt_bat/1023)*5;</p><p>Currentt_bat = 10*Currentt_bat-25;</p><p>set_adc_channel(1);</p><p>Delay_ms(10);</p><p>Current_pv = read_adc()；</p><p>Delay_ms(10);</p><p>Currentt_pv = (Currentt_pv/1023)*5;</p><p>Currentt_pv = 10*Currentt_pv-25;</p><p>set_adc_channel(4);</p><p>Delay_ms(10);</p><p>Temperature = read_adc();</p><p>Delay_ms(10);</p><p>Temperature = (Temperature/1023)*5;</p><p>Temperature = Temperature*12.5;</p><p>Voltage_absorption = (14.5-0.03*(Temperature-25))*choice_bat;</p><p>Voltage_float = (13.6-0.03*(Temperature-25))*choice_bat;</p><p>Current_ch = Current_pv - Current_bat;</p><p>}</p><p>void main()</p><p>{</p><p>setup_adc(ADC_CLOCK_INTERNAL);</p><p>setup_adc_ports(AN0_AN1_AN2_AN3_AN4);</p><p>set_tris_a(0xFF);</p><p>set_tris_c(0b00000011);</p><p>lcd_init();</p><p>Delay_ms(100);</p><p>while(TRUE)</p><p>{</p><p>if (Choice_bat_ON){</p><p>choice_bat=1;</p><p>}</p><p>else {</p><p>choice_bat=2;</p><p>}</p><p>lcd_putc('\f');</p><p>Mesure();</p><p>Delay_ms(500);</p><p>while(Voltage_bat &lt;= (Voltage_absorption) &amp;&amp;Voltage_bat&gt;= (12.6*choice_bat) ) {</p><p>lcd_putc('\f');</p><p>Mesure();</p><p>output_high(ON_OFF);</p><p>output_low(LED_YELLOW);</p><p>output_low(LED_GREEN);</p><p>output_high(LED_RED);</p><p>alpha=1;</p><p>pwm_on();</p><p>duty = 1000*alpha;</p><p>pwm_set_duty_percent(duty);</p><p>//Viewing</p><p>DisplayFormat();</p><p>}</p><p>lcd_putc('\f');</p><p>//Mesure();</p><p>while(Current_bat &gt;= Imin &amp;&amp;Voltage_bat&gt;= (12.6*choice_bat)) {</p><p>lcd_putc('\f');</p><p>Mesure();</p><p>Voltage_bat = Voltage_absorption;</p><p>alpha = Voltage_bat/Voltage_pv;</p><p>output_low(LED_RED);</p><p>output_low(LED_GREEN);</p><p>output_high(LED_YELLOW);</p><p>pwm_on();</p><p>duty = 1000*alpha;</p><p>pwm_set_duty_percent(duty)；</p><p>DisplayFormat();</p><p>Mesure();</p><p>}</p><p>Mesure();</p><p>Delay_ms(500);</p><p>lcd_putc('\f');</p><p>while(Voltage_bat &gt;= (12.6*choice_bat)) {</p><p>lcd_putc('\f');</p><p>Mesure();</p><p>Voltage_bat = Voltage_float;</p><p>alpha = Voltage_bat/Voltage_pv;</p><p>output_low(LED_YELLOW);</p><p>output_low(LED_RED);</p><p>output_high(LED_GREEN);</p><p>pwm_on();</p><p>duty = 1000*alpha;</p><p>pwm_set_duty_percent(duty);</p><p>//Viewing</p><p>DisplayFormat();</p><p>Mesure();</p><p>}</p><p>lcd_putc('\f');</p><p>if(Voltage_bat &lt; (12.6*choice_bat)) {</p><p>output_low(ON_OFF);</p><p>alpha=1;</p><p>pwm_on();</p><p>duty = 1000*alpha;</p><p>pwm_set_duty_percent(duty);</p><p>lcd_putc('\f'); //Clear LCD Screen</p><p>lcd_putc(&quot;Excessive discharge&quot;);</p><p>lcd_gotoxy(1,2);</p><p>lcd_putc(&quot;Load disconnected&quot;);</p><p>Mesure();</p><p>output_high(LED_YELLOW);</p><p>output_high(LED_GREEN);</p><p>output_high(LED_RED);</p><p>Delay_ms(250);</p><p>output_low(LED_YELLOW);</p><p>output_low(LED_GREEN);</p><p>output_low(LED_RED);</p><p>Delay_ms(250);</p><p>}</p><p>}</p><p>}</p></sec></body><back><ref-list><title>References</title><ref id="scirp.82441-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Usher, E.P. and Ross, M.M.D. (1998) Recommended Practices for Charge Controllers. Report IEA PVPS T3-05.</mixed-citation></ref><ref id="scirp.82441-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Koutroulis, E. and Kalaitzakis, K. (2004) Novel Battery Charging Regulation System for Photovoltaic Applications. Proceedings—Electric Power Applications, 151, 191-197. https://doi.org/10.1049/ip-epa:20040219</mixed-citation></ref><ref id="scirp.82441-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Belarbi, M. (2015) Contribution à l’étude d’un générateur solaire pour site autonome, Université des Sciences et de la Technologie d’oran Mohamed Boudiaf, Algérie.</mixed-citation></ref><ref id="scirp.82441-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Merrouche, W., Tebibel, H. and Malek, A. (2012) Développement sous Proteus d’un régulateur basé sur un algorithme de charge efficace et sécurisée pour batteries au plomb dans un système photovoltaique. The 2nd International Seminar on New and Renewable Energies, Ghardaia, 15-17 Octobre 2012, 175-186.</mixed-citation></ref><ref id="scirp.82441-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Gold, S. (1997) A Pspice Macromodel for Lithium-Ion Batteries. Proceedings of the 12th Battery Conference, 9-15.</mixed-citation></ref><ref id="scirp.82441-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Houée, P. (2011) Une installation photovoltaique en site isolé, forum des technologies, Technologie 175.</mixed-citation></ref><ref id="scirp.82441-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Messikh, L., Chikhi, S., Chikhi, F. and Chergui, T. (2008) Mise au point d’un régulateur de charge/décharge de batterie avec seuils adaptatifs de tension pour les applications photovoltaiques. Revue des Energies Renouvelables, 11, 281-290.</mixed-citation></ref><ref id="scirp.82441-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Dione, B., Sow, O., Wade, M., Ly, I., Mbodji, S. and Sissoko, G. (2016) Experimental Process Us for Acquisition Automatic Features of I-V Properties and Temperature of the Solar Panel by Changing the Operating Point. Circuits and Systems, 7, 3984-4000. https://doi.org/10.4236/cs.2016.711330</mixed-citation></ref><ref id="scirp.82441-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Rufer, A. (2016) Conversion DC/DC, Ecole Polytechnique Fédérale de Lausanne (EPFL).</mixed-citation></ref><ref id="scirp.82441-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Texas Instruments (2016) LM35 Precision Centigrade Temperature Sensors.</mixed-citation></ref><ref id="scirp.82441-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Burr-Brown (1997) INA122 Single Supply, MicroPower Instrumentation Amplifier. Burr-Brown Corporation.</mixed-citation></ref><ref id="scirp.82441-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Sow, O., Diarisso, D., Mbodji, N.Z.A., Diallo, M.S., Diao, A., Gaye, I., Barro, F.I. and Sissoko, G. (2013) Experimental Device for Acquisition of Properties I-V and V (T) of the Solar by Automatic Change Operating Point. International Journal of Innovative Technology and Exploring Engineering, 2, 330-334.</mixed-citation></ref><ref id="scirp.82441-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Diarisso, D., Diallo, M.S., Diao, A., Sow, O., Gaye, I., Barro, F.I. and Sissoko, G. (2013) Development of Battery Charge/Discharge Regulator for Photovoltaic Systems. International Journal of Innovative Technology and Exploring Engineering, 2, 231-234.</mixed-citation></ref><ref id="scirp.82441-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Microchip Datasheet (1999) PIC 16F87x: 28/40 pin CMOS Flash Microcontrollers. Microchip Technology Inc., DS30292B.</mixed-citation></ref><ref id="scirp.82441-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Dunlop, J.P. (1997) Batteries and Charge Control in Stand-Alone Photovoltaic Systems: Fundamentals and Application. Sandia National Laboratories and Florida Solar Energy Center.</mixed-citation></ref><ref id="scirp.82441-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Ait Cheikh, M.S., Chirk Belhadj, M., Bassaid, M., Becherif, M. and Larbes, C. (2012) Simulation et réalisation d’un controleur de batterie solaire à base de PIC16F876. Revue des Energies Renouvelables.</mixed-citation></ref></ref-list></back></article>