How does it work?
BATT-MON 2 Click is based on the MAX17262, an ultra-low power fuel-gauge IC that implements the ModelGauge™ m5 algorithm from Analog Devices. It provides, at the same time, tolerance against battery diversity for most lithium batteries (providing good performance for most cell types) and applications. The MAX17262 features internal current measurement for up to 3.1A pulse currents and accurately measures voltage, current, and temperature to produce fuel gauge results. It shows the best performance for batteries with 100mAhr to 6Ahr capacity.
The ModelGauge™ m5 EZ algorithm combines the short-term accuracy and linearity of a Coulomb counter with the long-term stability of a voltage-based fuel gauge, along with temperature compensation, to provide industry-leading fuel-gauge accuracy. The MAX17262 automatically compensates for cell aging, temperature, and discharge rate, providing accurate state-of-charge in percentage (%) and remaining capacity in milliampere-hours (mAh) over a wide range of operating conditions.
As the battery approaches the critical region near empty, the ModelGauge™ m5 algorithm invokes a unique correction mechanism that eliminates errors. The MAX17262 provides an accurate estimation of time-to-empty and time-to-full through three methods for reporting the age of the battery such as reduction in capacity, increase in battery resistance, and cycle odometer.
BATT-MON 2 Click communicates with MCU using the standard I2C 2-Wire interface to read data and configure settings with a maximum frequency of 400kHz. An alert/interrupt function is also available that outputs an interrupt signal to the ALR pin of the mikroBUS™ socket indicating fuel-gauge alerts. This feature is visually presented by a red LED marked as ALR. Besides, this Click board™ also features battery pack temperature sensing through an integrated temperature sensor or an external NTC thermistor which can be connected to the onboard terminal labeled TH.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VIO SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Battery charger
Applications
Can be used for various applications such as health and fitness monitors, terminals, home, building automation, sensors, toys, and more
On-board modules
MAX17262 – 1-Cell fuel-gauge IC from Analog Devices
Key Features
Low power consumption, ModelGauge™ m5 algorithm, internal current sensing, supports Li+ and variants, battery pack temperature sensing, no calibration required, alert indicator, and more
Interface
I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on BATT-MON 2 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
LD2 | ALR | – | Alert LED Indicator |
JP1 | VIO SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
BATT-MON 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Battery Voltage Range | 2.3 | – | 4.9 | V |
Battery Capacity | 0.1 | – | 6 | Ahr |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the BATT-MON 2 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for BATT-MON 2 Click driver.
Key functions
-
battmon2_get_battery_voltage
This function reads the battery voltage in mV. -
battmon2_get_battery_current
This function reads the battery current in mA. -
battmon2_get_battery_percentage
This function reads the battery remaining SOC percentage.
Example Description
This example demonstrates the use of BATT-MON 2 Click board™ by monitoring the measurements of battery voltage, current, capacity, percentage, time-to-empty or time-to-full, as well as the chip internal temperature.
void application_task ( void )
{
float voltage, capacity, percentage, current, die_temp;
if ( BATTMON2_OK == battmon2_get_battery_voltage ( &battmon2, &voltage ) )
{
log_printf ( &logger, " Voltage: %.1f mV rn", voltage );
}
if ( BATTMON2_OK == battmon2_get_battery_current ( &battmon2, ¤t ) )
{
log_printf ( &logger, " Current: %.1f mA rn", current );
}
if ( BATTMON2_OK == battmon2_get_battery_capacity ( &battmon2, &capacity ) )
{
log_printf ( &logger, " Capacity: %.1f mAh rn", capacity );
}
if ( BATTMON2_OK == battmon2_get_battery_percentage ( &battmon2, &percentage ) )
{
log_printf ( &logger, " Percentage: %.1f %% rn", percentage );
}
if ( current > 0 )
{
uint32_t time_to_full;
if ( BATTMON2_OK == battmon2_get_battery_ttf ( &battmon2, &time_to_full ) )
{
log_printf ( &logger, " Time to full: %uh %umin %usec rn", ( uint16_t ) ( time_to_full / 3600 ),
( uint16_t ) ( time_to_full % 3600 ) / 60,
( uint16_t ) ( time_to_full % 60 ) );
}
}
else if ( current < 0 )
{
uint32_t time_to_empty;
if ( BATTMON2_OK == battmon2_get_battery_tte ( &battmon2, &time_to_empty ) )
{
log_printf ( &logger, " Time to empty: %uh %umin %usec rn", ( uint16_t ) ( time_to_empty / 3600 ),
( uint16_t ) ( time_to_empty % 3600 ) / 60,
( uint16_t ) ( time_to_empty % 60 ) );
}
}
if ( BATTMON2_OK == battmon2_get_die_temperature ( &battmon2, &die_temp ) )
{
log_printf ( &logger, " Internal temperature: %.2f C rnn", die_temp );
}
Delay_ms ( 1000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.BATTMON2
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. UART terminal is available in all MikroElektronika compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.