La version de votre navigateur est obsolète. Nous vous recommandons vivement d'actualiser votre navigateur vers la dernière version.

 Battery SOC Determination For PIC16F887

                     

               

         

 

Main Features

  • Suitable for Li-Ion and Li-Poly technologies

  • Cell Capacity : 860 mA.h (3.2Wh)

  • High accuracy State of Charge determination

  • SOC Determination based on Coulomb Counting 

 Applications

  •  All Applications needing battery state of charge determination 

General Description

The state of charge determination algorithm is offered to battery users who need a high precision SOC determination. This version is developed for Li-ion batteries with 860mA.h (3.2Wh) capacity and can be downloaded from Yaslamen Website for free.

The state of charge determination algorithm is implemented on Arduino Board. It gives users the ability to communicate the state of charge of battery via I2C or two 7-segment display.

Hardware configuration

 

Bill Of Materials 

Component

Value

                                                     PIC16F887

-

                                                 Resistor Bridge

                                            4.7kΩ-  ¼ Watt – 1%

                                                    Resistor (Rs)

                                            0.1 Ω -  1  Watt - 1%

                                                  Resistor Bridge

                                            1.0 kΩ  - ¼ Watt - 1%

 

How to implement the state of charge determination firmware

Programming Your PIC16F887 

After  downloading  the  Hex  file  “SOC_Determination_Algorithm_PIC16.hex”,  you  can  implement  it  on  your MCU PIC16F887 using any type of Microchip programmer.  While using an ICSP programmer, such as Pickit3, you have to add a programming connector to the schematic presented before.

 

 

Battery state of charge Communication

There are two ways to communicate the battery state of charge : either by displaying it on a 7-segment display(common Anod) or by sending it via I2C to any other application.

Via 7 segment display

Via I2


                       

               


Data Frame from slave to master 


 


Sample Arduino Sketch 


 

#include<Wire.h>

int adress_slave=9;

int data_bytes=15;

int i=0;

char tab[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

void setup()

{

Wire.begin();

Serial.begin(9600);

}

void loop(){

Serial.print("Battery Parameters");
Serial.print(":\n");
Wire.requestFrom(adress_slave,data_bytes);
while(Wire.available()==0);
for(inti=0;i<15;i++)
{
charc=Wire.read();
}
tab[i]=c;}
Serial.print('\n');
Serial.print("Vbat=");
Serial.print(tab[0]);
Serial.print(tab[1]);
Serial.print(tab[2]);
Serial.print(tab[3]);
Serial.print("mV");
Serial.print('\n');
Serial.print("Ibat=");
Serial.print(tab[4]);
Serial.print(tab[5]);
Serial.print(tab[6]);
Serial.print(tab[7]);
Serial.print("mA");
Serial.print('\n');
Serial.print("SOC=");
Serial.print(tab[8]);
Serial.print(tab[9]);
Serial.print(tab[10]);
Serial.print("%");
Serial.print('\n');
Serial.print("Battery Capacity=");
Serial.print(tab[11]);
Serial.print(tab[12]);
Serial.print(tab[13]);
Serial.print(tab[14]);
Serial.print("mAh");
Serial.print('\n');
delay(2000);
}