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 Arduino

             

                    

                  


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 with low current consumption ( less than 1mA) . 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 developped for Arduino Boards ( Arduino Uno , Arduino Mega , Arduino Leonardo and Arduino Yùn) . It gives users the ability to communicate the state of charge of the battery via I2C or two 7-segment display.

 

Hardware configuration

Bill of Materials 

Component

Value

Arduino Board

-

Resistor (R1,R2)

4.7K Ohm -  ¼ Watt – 1%

Resistor (Rs)

0.22 Ohm -  1  Watt - 1%

Resistor (R3,R4)

15 K Ohm  - ¼ Watt - 1%

How to implement the state of charge determination firmware

Programming Your Arduino Board 

Download the Hex File “SOC_Determination_Algorithm_Arduino” . Choose the specific Hex File for your Board (Arduino Uno, Arduino Leonardo, Arduino Mega or Arduino Yún). You can program your Arduino board via USB connection by using XLoader. XLoader helps you to upload the *.hex file to Arduino boards using the Bootloader without the need of a programmer.  

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 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;

int 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++)
{
intc=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);
}