Beginner
10 min

Extend the lifetime and current capability of a battery cells with NBM5100A and STM32F031K6

Battery life booster with adaptive power optimization

BATT Boost Click with Nucleo 32 with STM32F031K6 MCU

Published Oct 01, 2024

Click board™

BATT Boost Click

Dev Board

Nucleo 32 with STM32F031K6 MCU

Compiler

NECTO Studio

MCU

STM32F031K6

Enhance the power and prolong the lifespan of coin battery cells like the CR2032, ensuring longer-lasting performance for a wide range of electronic devices

A

A

Hardware Overview

How does it work?

BATT Boost Click is based on the NBM5100A, a coin-cell battery life booster with adaptive power optimization from Nexperia. It contains an intelligent learning algorithm and two stages of high-efficiency DC-DC conversion. The first stage, DC-DC conversion, transfers energy from the lithium battery to a capacitive storage element at a low constant current. When charged, a second DC-DC conversion cycle utilizes this stored energy to supply a regulated voltage with high pulse load current capability on the VDH output terminal. The battery is never directly subjected to large load pulse currents, resulting in a longer, more predictable battery lifetime. The NBM5100A has a programmable constant battery load current of 2mA

up to 16mA. It also features an ultra-low standby current, integrated fuel gauge, high peak power efficiency, low pulse output current, protection against battery voltage dips, and more. The capacitor balancing IO of the NBM1500A is connected to two supercapacitors and is intended for applications utilizing series-connected supercapacitors requiring voltage balancing. The input supply source of the NBM5100A can be selected from the 3.3V rail of the mikroBUS™ socket or the coin battery itself. The selection can be made over the VBT SEL jumper. BATT Boost Click uses a standard 2-wire I2C interface to communicate with the host MCU, supporting a clock frequency of up to 1MHz. The I2C address

can be selected over the ADDR SEL jumper. The auto mode utilizes the start pin (ON) for one cycle. There are two ways to define the end of the active state in auto mode: short pulse on the ON pin and long pulse on the ON pin. The NBM1500A will interrupt the host MCU when it is ready over the RDY pin. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.

BATT Boost Click hardware overview image

Features overview

Development board

Nucleo 32 with STM32F031K6 MCU board provides an affordable and flexible platform for experimenting with STM32 microcontrollers in 32-pin packages. Featuring Arduino™ Nano connectivity, it allows easy expansion with specialized shields, while being mbed-enabled for seamless integration with online resources. The

board includes an on-board ST-LINK/V2-1 debugger/programmer, supporting USB reenumeration with three interfaces: Virtual Com port, mass storage, and debug port. It offers a flexible power supply through either USB VBUS or an external source. Additionally, it includes three LEDs (LD1 for USB communication, LD2 for power,

and LD3 as a user LED) and a reset push button. The STM32 Nucleo-32 board is supported by various Integrated Development Environments (IDEs) such as IAR™, Keil®, and GCC-based IDEs like AC6 SW4STM32, making it a versatile tool for developers.

Nucleo 32 with STM32F031K6 MCU double side image

Microcontroller Overview

MCU Card / MCU

default

Architecture

ARM Cortex-M0

MCU Memory (KB)

32

Silicon Vendor

STMicroelectronics

Pin count

32

RAM (Bytes)

4096

You complete me!

Accessories

Click Shield for Nucleo-32 is the perfect way to expand your development board's functionalities with STM32 Nucleo-32 pinout. The Click Shield for Nucleo-32 provides two mikroBUS™ sockets to add any functionality from our ever-growing range of Click boards™. We are fully stocked with everything, from sensors and WiFi transceivers to motor control and audio amplifiers. The Click Shield for Nucleo-32 is compatible with the STM32 Nucleo-32 board, providing an affordable and flexible way for users to try out new ideas and quickly create prototypes with any STM32 microcontrollers, choosing from the various combinations of performance, power consumption, and features. The STM32 Nucleo-32 boards do not require any separate probe as they integrate the ST-LINK/V2-1 debugger/programmer and come with the STM32 comprehensive software HAL library and various packaged software examples. This development platform provides users with an effortless and common way to combine the STM32 Nucleo-32 footprint compatible board with their favorite Click boards™ in their upcoming projects.

Click Shield for Nucleo-32 accessories 1 image

Li-Polymer Battery is the ideal solution for devices that demand a dependable and long-lasting power supply while emphasizing mobility. Its compatibility with mikromedia boards ensures easy integration without additional modifications. With a voltage output of 3.7V, the battery meets the standard requirements of many electronic devices. Additionally, boasting a capacity of 2000mAh, it can store a substantial amount of energy, providing sustained power for extended periods. This feature minimizes the need for frequent recharging or replacement. Overall, the Li-Polymer Battery is a reliable and autonomous power source, ideally suited for devices requiring a stable and enduring energy solution. You can find a more extensive choice of Li-Polymer batteries in our offer.

BATT Boost Click accessories 1 image

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
Auto Mode Control
PA11
RST
ID COMM
PA4
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
Ready Interrupt
PA12
INT
NC
NC
TX
NC
NC
RX
I2C Clock
PB6
SCL
I2C Data
PB7
SDA
NC
NC
5V
Ground
GND
GND
1

Take a closer look

Schematic

BATT Boost Click Schematic schematic

Step by step

Project assembly

Click Shield for Nucleo-144 front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Nucleo 32 with STM32F031K6 MCU as your development board.

Click Shield for Nucleo-144 front image hardware assembly
Nucleo 144 with STM32L4A6ZG MCU front image hardware assembly
Stepper 22 Click front image hardware assembly
Prog-cut hardware assembly
Stepper 22 Click complete accessories setup image hardware assembly
Nucleo-32 with STM32 MCU Access MB 1 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
STM32 M4 Clicker HA MCU/Select Step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

Track your results in real time

Application Output via Debug Mode

1. Once the code example is loaded, pressing the "DEBUG" button initiates the build process, programs it on the created setup, and enters Debug mode.

2. After the programming is completed, a header with buttons for various actions within the IDE becomes visible. Clicking the green "PLAY" button starts reading the results achieved with the Click board™. The achieved results are displayed in the Application Output tab.

DEBUG_Application_Output

Software Support

Library Description

This library contains API for BATT Boost Click driver.

Key functions:

  • battboost_get_vcap - This function is used to read the storage capacitor voltage status

  • battboost_set_op_mode - This function is used to select the desired operating mode of the device

  • battboost_get_status - This function reads the the status information of low battery input, capacitor input voltage early warning, VDH output alarm and ready state

Open Source

Code example

This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.

/*!
 * @file main.c
 * @brief BATT Boost Click example
 *
 * # Description
 * This library contains API for the BATT Boost Click driver.
 * This driver provides the functions to controle battery energy management 
 * device designed to maximize usable capacity from non-rechargeable.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initialization of I2C module and log UART.
 * After driver initialization, the app executes a default configuration, 
 * sets the output voltage to 1.8V, charge current to 16mA, 
 * and early warning voltage to 2.6V.
 *
 * ## Application Task
 * This example demonstrates the use of the BATT Boost Click board. 
 * The demo application uses two operations in two states: 
 * the charging state and the active state. First, when the device is in a Charge state, 
 * the external storage capacitor is charging from VBT using a constant current 
 * and displays storage capacitor voltage levels and charge cycle count.
 * Upon completion of a Charge state, the device transitions to the Active state 
 * at which time VDH becomes a regulated voltage output of 1.8V (default configuration), 
 * displays storage capacitor voltage level, and monitors alarms 
 * for low output voltage (below 1.8V) and early warning (below 2.4V). 
 * Results are being sent to the UART Terminal, where you can track their changes.
 *
 * @author Nenad Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "battboost.h"

static battboost_t battboost;
static log_t logger;

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    battboost_cfg_t battboost_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    battboost_cfg_setup( &battboost_cfg );
    BATTBOOST_MAP_MIKROBUS( battboost_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == battboost_init( &battboost, &battboost_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    if ( BATTBOOST_ERROR == battboost_default_cfg ( &battboost ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }
    
    log_info( &logger, " Application Task " );
    Delay_ms( 100 );
}

void application_task ( void ) 
{
    float vcap = 0;
    uint8_t status = 0;
    uint32_t chenergy = 0;

    if ( BATTBOOST_STATUS_READY != battboost_get_ready( &battboost ) )
    {
        if ( BATTBOOST_OK == battboost_set_op_mode( &battboost, BATTBOOST_OP_MODE_CHARGE ) )
        {
            log_printf( &logger, "\nOperating state: Charge\r\n" );
        }

        if ( BATTBOOST_OK == battboost_get_vcap( &battboost, &vcap ) )
        {
            log_printf( &logger, " Capacitor Voltage: %.2f V \r\n", vcap );
        }

        if ( BATTBOOST_OK == battboost_get_chenergy( &battboost, &chenergy ) )
        {
            log_printf( &logger, " Charge cycle count: %lu \r\n", chenergy );
        }
        Delay_ms( 1000 );
    }
    else
    {
        if ( BATTBOOST_OK == battboost_set_op_mode( &battboost, BATTBOOST_OP_MODE_ACTIVE ) )
        {
            log_printf( &logger, "\nOperating state: Active\r\n" );
            if ( BATTBOOST_OK == battboost_get_vcap( &battboost, &vcap ) )
            {
                log_printf( &logger, " Capacitor Voltage: %.2f V \r\n", vcap );
            }

            if ( BATTBOOST_OK == battboost_get_status( &battboost, &status ) )
            {
                if ( BATTBOOST_STATUS_EW & status )
                {
                    log_printf( &logger, " Status: Early warning.\r\n" );
                }

                if ( BATTBOOST_STATUS_ALRM & status )
                {
                    log_printf( &logger, " Status: Low output voltage in the Active state.\r\n" );
                }
            }
        }
        Delay_ms( 1000 );
    }
}

void main ( void ) 
{
    application_init( );

    for ( ; ; ) 
    {
        application_task( );
    }
}

// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.