balancer3  2.0.0.0
Main Page

Balancer 3 click

Balancer 3 Click is overvoltage protection device for 2-series cell lithium-ion battery packs that incorporates a high-accuracy precision overvoltage detection circuit and automatic cell imbalance correction.

click Product page


Click library

  • Author : MikroE Team
  • Date : dec 2019.
  • Type : GPIO type

Software Support

We provide a library for the Balancer3 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Balancer3 Click driver.

Standard key functions :

Example key functions :

  • Cell Balance Enable function.

    void balancer3_enable_cell_balance ( balancer3_t *ctx, uint8_t state );

  • Overvoltage Condition Check function.

    uint8_t balancer3_check_overvoltage_cond ( balancer3_t *ctx );

Examples Description

This application is device for 2-series cell lithium-ion battery.

The demo application is composed of two sections :

Application Init

Initializes device sets the time interval variable (time_inter) to the 0, which is used for OV condition message logging.

void application_init ( void )
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info(&logger, "---- Application Init ----");
BALANCER3_MAP_MIKROBUS( cfg, MIKROBUS_1 );
balancer3_init( &balancer3, &cfg );
}

Application Task

Allows user to enter a commands that can enable or disable

cell balance and check the overvoltage condition. When OV condition is not detected, the status message will be sent after every 8 seconds. When OV condition is detected, the status message will be sent after every 2 seconds. Press '0' when you want to disable cell balance. Press '1' when you want to enable cell balance. Press '2' when you want to check the OV condition status immediately.

void application_task ( void )
{
uint16_t time_inter;
uint8_t ov_cond;
log_printf( &logger, "* Cell balance is disabled * %d\r\n" );
log_printf( &logger, "* Cell balance is enabled * %d\r\n" );
ov_cond = balancer3_check_overvoltage_cond( &balancer3 );
if ( ( time_inter == 8000 ) || ( ov_cond == BALANCER3_OV_COND_DETECTED ) )
{
{
log_printf( &logger, "* Overvoltage condition is not detected * %d\r\n" );
time_inter = 0;
}
else if ( time_inter > 2000 )
{
log_printf( &logger, "* Overvoltage condition is detected * %d\r\n", ov_cond );
time_inter = 0;
}
else
{
time_inter++;
}
}
else
{
time_inter++;
}
Delay_ms( 1 );
}

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Balancer3

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


BALANCER3_CELL_BALANCE_DIS
#define BALANCER3_CELL_BALANCE_DIS
Definition: balancer3.h:71
BALANCER3_MAP_MIKROBUS
#define BALANCER3_MAP_MIKROBUS(cfg, mikrobus)
Definition: balancer3.h:51
balancer3_cfg_t
Click configuration structure definition.
Definition: balancer3.h:107
balancer3_enable_cell_balance
void balancer3_enable_cell_balance(balancer3_t *ctx, uint8_t state)
Cell Balance Enable function.
BALANCER3_OV_COND_DETECTED
#define BALANCER3_OV_COND_DETECTED
Definition: balancer3.h:78
BALANCER3_OV_COND_NOT_DETECTED
#define BALANCER3_OV_COND_NOT_DETECTED
Definition: balancer3.h:79
balancer3_check_overvoltage_cond
uint8_t balancer3_check_overvoltage_cond(balancer3_t *ctx)
Overvoltage Condition Check function.
application_task
void application_task(void)
Definition: main.c:62
balancer3_cfg_setup
void balancer3_cfg_setup(balancer3_cfg_t *cfg)
Config Object Initialization function.
application_init
void application_init(void)
Definition: main.c:34
balancer3_init
BALANCER3_RETVAL balancer3_init(balancer3_t *ctx, balancer3_cfg_t *cfg)
Initialization function.
BALANCER3_CELL_BALANCE_EN
#define BALANCER3_CELL_BALANCE_EN
Definition: balancer3.h:70