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.
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 [
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
Battery Model: 6-GFM-150 | |||
---|---|---|---|
Nominal voltage | 12 V | Maximum discharge current (25˚C) | 1000 A (5 s) |
Number of Cells | 6 | Maximum load current | 60 A |
Nominal Capacity 77 F (25˚C) | C20 = 150 Ah | Short circuit current | 3300 A |
C10 = 136 Ah | Charging temperature | −10˚C - 60˚C | |
C5 = 130.5 Ah | Discharge temperature | −20˚C - 60˚C | |
C1 = 105 Ah | Storage temperature | −20˚C - 60˚C | |
Self-discharge (20˚C) | 3% per month | Compensation temperature | −30 Mv/˚C |
Internal battery resistor fully charged (25˚C) | 3.5 mΩ | Load at constant voltage (25˚C) | 14.5 - 14.9 V |
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 [
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) [
V R = V 25 − 0.03 × ( T b a t − 25 ) (1)
with: V25 the battery voltage at 25˚C, VR the battery voltage at temperature Tbat in ˚C.
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 [
When the charging current reaches the low value Imin, 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 Vfloat 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 [
V float = V float_25 − 0.03 × ( T b a t − 25 ) (2)
with V float_25 = V float à 25 ˚ C = 13.6 V , T b a t : temperature of battery in ˚C.
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 [
The system diagram of the charging system is shown in
Voltage regulators
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 [
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.
This Buck DC/DC converter block transfers and converts power and controls the battery voltage and vary the charging current.
Non-return and freewheel diodes
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.
MOSFET Transistors and Driver
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.
Smoothing inductance
The value of the current smoothing inductance is determined from Equation (3) [
L s = U e 4 F Δ I s max (3)
U e : output voltage of the PV generator (V);
F : frequency (Hz);
Δ I s max : maximum current ripple (A).
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 .
Filter Capacitor
The circuit requiring a very steady voltage, we intercalate at the output, capacitors of filtering which capacity is given by [
C s = U e 32 ⋅ L s ⋅ Δ U s o _ max ⋅ F 2 (4)
U e : output voltage of the PV generator (V);
C : capacity of the capacitor (F);
Δ U s o _ max : amplitude of the variations between the maximum and the minimum of the voltage or the maximum permissible ripple (V);
F : frequency (Hz);
L s : smoothing inductance (H).
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 .
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:
maximumratiosourcevoltagedivider = 5 − 0 20 − 0 = 1 4
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.
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.
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 [
V out ( V ) = 0.010 ( V / ˚ C ) × T ( ˚ C ) (5)
V: sensor supply voltage (Volt);
T: temperature measured (˚C).
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 [
G = 5 + 200 k Ω R G (6)
RG: external resistance to be added between pins 1 and 8 to define the gain.
Conditioning of the temperature sensor LM35 is shown in
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 [
LCD screen
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.
Communication with the LCD
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
LEDs Signal
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.
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.
In
First charging phase: the red LED on
Second charging phase: the yellow LED indicates the second charging phase in progress corresponding to the first constant voltage phase
Third charging phase: the green LED indicates the current third phase corresponding to the maintenance phase
Once the battery enters a deep discharge phase, all three LEDs blink simultaneously
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.
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.
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
In this part, we present the program executed and compiled with CCS Compiler, software specialized in the programming of PICs.
// PROGRAM UNDER CSS
#include
#include
// ConnectionsModuleLCD
#define LCD_RS_PIN PIN_D1
#define LCD_ENABLE_PIN PIN_D3
#define LCD_DATA4 PIN_D4
#define LCD_DATA5 PIN_D5
#define LCD_DATA6 PIN_D6
#define LCD_DATA7 PIN_D7
//End ConnectionsModuleLCD
#define ON_OFF PIN_C7
#define BOUTON PIN_C0
#define BOUTON_ON input_state(PIN_C0)==0
#define Choice_bat_ON input_state(PIN_C1)==0
#define LED_RED PIN_C3
#define LED_YELLOW PIN_C4
#define LED_GREEN PIN_C5
#USE PWM(OUTPUT=PIN_C2, FREQUENCY=50kHz, DUTY=100)
float Voltage_pv;
float Voltage_bat;
float Current_pv;
float Current_bat;
float Current_ch;
float Temperature;
float Voltage_absorption;
float Voltage_float;
float alpha;
int duty;
char choice_bat;
const int8 Imin = 1;
void DisplayFormat(void) {
if(BOUTON_ON){
lcd_putc('\f'); //Clear LCD Screen
printf(lcd_putc,"Upv = %f V",Voltage_pv);
lcd_gotoxy(1,2);
printf(lcd_putc,"Ubat = %f V",Voltage_bat);
lcd_gotoxy(1,3);
if(Current_bat>=0){
printf(lcd_putc,"Ibat = %f A +++",Current_bat);}
if(Current_bat<0){
Current_bat = - Current_bat;
printf(lcd_putc,"Ibat = %f A ---",Current_bat);}
lcd_gotoxy(1,4);
printf(lcd_putc,"Temp = %f C",Temperature);
Delay_ms(2000);}
else{
lcd_putc('\f'); //Clear LCD Screen
printf(lcd_putc,"Ipv = %f A",Current_pv);
lcd_gotoxy(1,2);
printf(lcd_putc,"Icharge = %f A",Current_ch);
lcd_gotoxy(1,3);
printf(lcd_putc,"alpha = %f%%",alpha*100);
lcd_gotoxy(1,4);
lcd_putc("Frequency = 50kHz");
Delay_ms(2000);}
}
void Mesure(void) {
set_adc_channel(2);
Delay_ms(10);
Voltage_bat = read_adc();
Delay_ms(10);
Vomtage_bat = (Voltage_bat/1023)*5*6;
set_adc_channel(0);
Delay_ms(10);
Voltage_pv = read_adc();
Delay_ms(10);
Voltage_pv = (Voltage_pv/1023)*5*4;
set_adc_channel(3);
Delay_ms(10);
Voltage_bat = read_adc();
Delay_ms(10);
Currentt_bat = (Currentt_bat/1023)*5;
Currentt_bat = 10*Currentt_bat-25;
set_adc_channel(1);
Delay_ms(10);
Current_pv = read_adc();
Delay_ms(10);
Currentt_pv = (Currentt_pv/1023)*5;
Currentt_pv = 10*Currentt_pv-25;
set_adc_channel(4);
Delay_ms(10);
Temperature = read_adc();
Delay_ms(10);
Temperature = (Temperature/1023)*5;
Temperature = Temperature*12.5;
Voltage_absorption = (14.5-0.03*(Temperature-25))*choice_bat;
Voltage_float = (13.6-0.03*(Temperature-25))*choice_bat;
Current_ch = Current_pv - Current_bat;
}
void main()
{
setup_adc(ADC_CLOCK_INTERNAL);
setup_adc_ports(AN0_AN1_AN2_AN3_AN4);
set_tris_a(0xFF);
set_tris_c(0b00000011);
lcd_init();
Delay_ms(100);
while(TRUE)
{
if (Choice_bat_ON){
choice_bat=1;
}
else {
choice_bat=2;
}
lcd_putc('\f');
Mesure();
Delay_ms(500);
while(Voltage_bat <= (Voltage_absorption) &&Voltage_bat>= (12.6*choice_bat) ) {
lcd_putc('\f');
Mesure();
output_high(ON_OFF);
output_low(LED_YELLOW);
output_low(LED_GREEN);
output_high(LED_RED);
alpha=1;
pwm_on();
duty = 1000*alpha;
pwm_set_duty_percent(duty);
//Viewing
DisplayFormat();
}
lcd_putc('\f');
//Mesure();
while(Current_bat >= Imin &&Voltage_bat>= (12.6*choice_bat)) {
lcd_putc('\f');
Mesure();
Voltage_bat = Voltage_absorption;
alpha = Voltage_bat/Voltage_pv;
output_low(LED_RED);
output_low(LED_GREEN);
output_high(LED_YELLOW);
pwm_on();
duty = 1000*alpha;
pwm_set_duty_percent(duty);
DisplayFormat();
Mesure();
}
Mesure();
Delay_ms(500);
lcd_putc('\f');
while(Voltage_bat >= (12.6*choice_bat)) {
lcd_putc('\f');
Mesure();
Voltage_bat = Voltage_float;
alpha = Voltage_bat/Voltage_pv;
output_low(LED_YELLOW);
output_low(LED_RED);
output_high(LED_GREEN);
pwm_on();
duty = 1000*alpha;
pwm_set_duty_percent(duty);
//Viewing
DisplayFormat();
Mesure();
}
lcd_putc('\f');
if(Voltage_bat < (12.6*choice_bat)) {
output_low(ON_OFF);
alpha=1;
pwm_on();
duty = 1000*alpha;
pwm_set_duty_percent(duty);
lcd_putc('\f'); //Clear LCD Screen
lcd_putc("Excessive discharge");
lcd_gotoxy(1,2);
lcd_putc("Load disconnected");
Mesure();
output_high(LED_YELLOW);
output_high(LED_GREEN);
output_high(LED_RED);
Delay_ms(250);
output_low(LED_YELLOW);
output_low(LED_GREEN);
output_low(LED_RED);
Delay_ms(250);
}
}
}