PowerBank Click Board
PowerBank Click Board
Overview
The PowerBank Click Board™ is a USB charging expansion board that can be used for creating power bank devices or adding a charging option to your device. For battery charging management, this board uses MP2632B a highly integrated 3A Lu-ion and Li-polymer battery charger from Microchip. In addition to the battery charger, PowerBank Click also has an MCP3221 analogue to digital converter, which is serving for monitoring battery voltage over the I2C interface. Besides battery charging and monitoring features, this board also has an operation section button, notification LEDs for operational mode selection and battery status. Power banks are popular for charging USB charged devices and can be used as a power supply for various USB powered devices such as lights and small fans.
The PowerBank Click Board™ is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click Board™ comes as a fully tested product, ready to be used on a system equipped with the mikroBUS™ socket.
How Does The PowerBank Click Board™ Work?
The PowerBank Click Board™ can supply power from the connected battery through a USB port as well as charge the battery. The MP2632B can operate in both charge mode and boost mode to allow for full-system and battery-power management. It has an integrated VIN-to-SYS pass-through path to pass the input voltage to the system. The pass-through path has built-in over-voltage (OVP) and over-current protection (OCP) and a higher priority over the charging path.
This board can also re-charge connected battery from microUSB connector on the bottom side by providing input power. When the input power is present, the MP2632B operates in charge mode. The MP2632B detects the battery voltage automatically and charges the battery in three phases: trickle current, constant current, and constant voltage. Other features include charge termination and auto-recharge. The MP2632B also integrates both input current limit and input voltage regulation to manage the input power and prioritize the system load.
In the absence of an input source, the MP2632B switches to boost mode through PB to power SYS from the battery. In boost mode, the OLIM pin programs the output current limit, and the MP2632B turns off at light load automatically. The MP2632B also allows for output short-circuit protection (SCP) to disconnect the battery completely from the load in the event of a short-circuit fault. Normal operation resumes once the short-circuit fault is removed.
The operational mode selector button on the PowerBank Click has few purposes. If the button is pressed for more than 1.5ms, the boost is enabled and latched if V IN is not available. LEDs 1-4 are ON for five seconds whenever the button is pressed for more than 1.5ms. If the button is pressed for more than 1.5ms twice within one second, it serves as a torch light ON/OFF switch. If the button is held pressed for more than 2.5 seconds, this is defined as a long push, and boost is shut down manually.
A 4-LED driver is integrated for voltage-based fuel gauge indication. Together with torch-light control, the MP2632B provides an all-in-one solution for power banks and similar applications without an external microcontroller.
The PowerBank Click is also equipped with a MCP3221, a successive approximation A/D converter (ADC) with a 12-bit resolution to monitor battery voltage over I2C bus over mikroBUS™ socket.
This Click Board™ is designed to be operated only with 5V logic level. A proper logic voltage level conversion should be performed before the Click board™ is used with MCUs with logic levels of 3V3.
SPECIFICATIONS
Type | Battery charger |
Applications | Battery Charger Applications, Power-Bank Applications for Smartphones, Tablets and Other Portable Devices |
On-board modules | MP2632B switch-mode battery charger |
Key Features | Switch-mode battery charger with system power-path management designed for single-cell Li-ion or Li-polymer batteries |
Interface | I2C |
Compatibility | mikroBUS |
Click board size | L (57.15 x 25.4 mm) |
Input Voltage | 5V |
PINOUT DIAGRAM
This table shows how the pinout on PowerBank Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | NC | ||
NC | 2 | RST | INT | 15 | NC | ||
NC | 3 | CS | RX | 14 | NC | ||
NC | 4 | SCK | TX | 13 | NC | ||
NC | 5 | MISO | SCL | 12 | SCL | I2C Clock | |
NC | 6 | MOSI | SDA | 11 | SDA | I2C Data | |
NC | 7 | 3.3V | 5V | 10 | 5V | Power Supply | |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
ONBOARD SETTINGS AND INDICATORS
Label | Name | Default | Description |
---|---|---|---|
PWR | PWR | - | Power LED Indicator |
LD1-4 | LD1-4 | - | Battery Status LEDs / Fault Indicator |
LD5 | LD5 | - | Operation Mode Indicator |
T1 | - | - | Operation Mode Selector |
CN1 | - | - | USB Power/Communication Port |
CN2 | - | - | USB Charge Port |
Software Support
We provide a library for the PowerBank Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions that enables the usage of the PowerBank click board. It offers reading from output register and calculations that result in relatively accurate measurement of connected batteries voltage.
Key Functions
uint16_t powerbank_read_data ( );
- Function is used to read raw data from MCP3221.uint16_t powerbank_read_voltage ( uint16_t v_ref );
- Function is used to calculate voltage of the connected battery.
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C module and LOG structure.
- Application Initialization - Initalizes I2C driver and makes an initial log.
- Application Task - (code snippet) This example shows the capabilities of the PowerBank click by measuring voltage of the connected battery. In order to get correct calculations user should change "v_ref" value to his own power supply voltage.
void application_task ( ) { voltage = powerbank_read_voltage( v_ref ); WordToStr( voltage, log_txt ); mikrobus_logWrite( "Battery voltage: ", _LOG_TEXT ); mikrobus_logWrite( log_txt, _LOG_TEXT ); mikrobus_logWrite( "mV", _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); Delay_ms( 2000 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- Conversions
- UART
Additional Notes and Information
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.
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.
Software Support
We provide a library for the PowerBank Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions that enables the usage of the PowerBank click board. It offers reading from output register and calculations that result in relatively accurate measurement of connected batteries voltage.
Key Functions
uint16_t powerbank_read_data ( );
- Function is used to read raw data from MCP3221.uint16_t powerbank_read_voltage ( uint16_t v_ref );
- Function is used to calculate voltage of the connected battery.
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C module and LOG structure.
- Application Initialization - Initalizes I2C driver and makes an initial log.
- Application Task - (code snippet) This example shows the capabilities of the PowerBank click by measuring voltage of the connected battery. In order to get correct calculations user should change "v_ref" value to his own power supply voltage.
void application_task ( ) { voltage = powerbank_read_voltage( v_ref ); WordToStr( voltage, log_txt ); mikrobus_logWrite( "Battery voltage: ", _LOG_TEXT ); mikrobus_logWrite( log_txt, _LOG_TEXT ); mikrobus_logWrite( "mV", _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); Delay_ms( 2000 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- Conversions
- UART
Additional Notes and Information
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.
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.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.