TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136798 times)
  2. FAT32 Library (69983 times)
  3. Network Ethernet Library (55951 times)
  4. USB Device Library (46274 times)
  5. Network WiFi Library (41892 times)
  6. FT800 Library (41187 times)
  7. GSM click (28990 times)
  8. PID Library (26420 times)
  9. mikroSDK (26375 times)
  10. microSD click (25382 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Balancer 5 click

Rating:

5

Author: MIKROE

Last Updated: 2019-11-20

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Battery Charger

Downloaded: 2899 times

Not followed.

License: MIT license  

Balancer 5 Click is an intelligent 2-cell Li-Ion battery charger, system power manager, and a battery fuel gauge Click board.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Balancer 5 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Balancer 5 click" changes.

Do you want to report abuse regarding "Balancer 5 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Balancer 5 click

Balancer 5 click

Native view of the Balancer 5 click board.

View full image
Balancer 5 click

Balancer 5 click

Front and back view of the Balancer 5 click board.

View full image

Library Description

Library provides functions for controling pin state and reading it from device, and reading and writing data to device.

Key functions:

  • void balancer5_charge ( uint8_t state ) - Control device charging sate
  • uint8_t balancer5_read_data ( uint8_t reg_addr ) - Reads and returns one Byte of data from registar
  • void balancer5_write_data ( uint8_t reg_addr, uint8_t write_data ) - Writes one Byte of data to registar

Examples description

The application is composed of three sections :

  • System Initialization - Initialization of I2C module and setting pins to output
  • Application Initialization - Checks ID, starts charging, reads charge status registers and configures ADC
  • Application Task - Reads ADC values from registers and logs it
void application_task ( )
{
    temp_data = balancer5_read_data( BALANCER5_REG_IBUS_ADC1 );
    temp_uint_data = temp_data;
    temp_uint_data <<= 8;
    temp_data = balancer5_read_data( BALANCER5_REG_IBUS_ADC0 );
    temp_uint_data |= temp_data;
    IntToStr( temp_uint_data, demo_txt );
    mikrobus_logWrite( "- IBUS:", _LOG_TEXT );
    mikrobus_logWrite( demo_txt, _LOG_TEXT );
    mikrobus_logWrite( " mA", _LOG_LINE );

    temp_data = balancer5_read_data( BALANCER5_REG_ICHG_ADC1 ); 
    temp_uint_data = temp_data;
    temp_uint_data <<= 8;
    temp_data = balancer5_read_data( BALANCER5_REG_ICHG_ADC0 );
    temp_uint_data |= temp_data;
    WordToStr( temp_uint_data, demo_txt );
    mikrobus_logWrite( "- ICHG:", _LOG_TEXT );
    mikrobus_logWrite( demo_txt, _LOG_TEXT );
    mikrobus_logWrite( " mA", _LOG_LINE );

    temp_data = balancer5_read_data( BALANCER5_REG_VBAT_ADC1 );
    temp_uint_data = temp_data;
    temp_uint_data <<= 8;
    temp_data = balancer5_read_data( BALANCER5_REG_VBAT_ADC0 );
    temp_uint_data |= temp_data;
    IntToStr( temp_uint_data, demo_txt );
    mikrobus_logWrite( "- VBAT:", _LOG_TEXT );
    mikrobus_logWrite( demo_txt, _LOG_TEXT );
    mikrobus_logWrite( " mV", _LOG_LINE );

    temp_data = balancer5_read_data( BALANCER5_REG_VBUS_ADC1 );
    temp_uint_data = temp_data;
    temp_uint_data <<= 8;
    temp_data = balancer5_read_data( BALANCER5_REG_VBUS_ADC0 );
    temp_uint_data |= temp_data;
    IntToStr( temp_uint_data, demo_txt );
    mikrobus_logWrite( "- VBUS:", _LOG_TEXT );
    mikrobus_logWrite( demo_txt, _LOG_TEXT );
    mikrobus_logWrite( " mV", _LOG_LINE );

    temp_data = balancer5_read_data( BALANCER5_REG_VCELLTOP_ADC1 );
    temp_uint_data = temp_data;
    temp_uint_data <<= 8;
    temp_data = balancer5_read_data( BALANCER5_REG_VCELLTOP_ADC0 );
    temp_uint_data |= temp_data;
    IntToStr( temp_uint_data, demo_txt );
    mikrobus_logWrite( "- VCELLTOP:", _LOG_TEXT );
    mikrobus_logWrite( demo_txt, _LOG_TEXT );
    mikrobus_logWrite( " mV", _LOG_LINE );

    temp_data = balancer5_read_data( BALANCER5_REG_VCELLBOT_ADC1 );
    temp_uint_data = temp_data;
    temp_uint_data <<= 8;
    temp_data = balancer5_read_data( BALANCER5_REG_VCELLBOT_ADC0 );
    temp_uint_data |= temp_data;
    IntToStr( temp_uint_data, demo_txt );
    mikrobus_logWrite( "- VCELLBOT:", _LOG_TEXT );
    mikrobus_logWrite( demo_txt, _LOG_TEXT );
    mikrobus_logWrite( " mV", _LOG_LINE );

    temp_data = balancer5_read_data( BALANCER5_REG_TS_ADC1 );
    temp_uint_data = temp_data;
    temp_uint_data <<= 8;
    temp_data = balancer5_read_data( BALANCER5_REG_TS_ADC0 );
    temp_uint_data |= temp_data;
    temp_float_data = temp_uint_data;
    temp_float_data *= 0.098;
    FloatToStr( temp_float_data, demo_txt );
    mikrobus_logWrite( "- TS:", _LOG_TEXT );
    mikrobus_logWrite( demo_txt, _LOG_TEXT );
    mikrobus_logWrite( " %", _LOG_LINE );

    temp_data = balancer5_read_data( BALANCER5_REG_TDIE_ADC1 );
    temp_uint_data = temp_data;
    temp_uint_data <<= 8;
    temp_data = balancer5_read_data( BALANCER5_REG_TDIE_ADC0 );
    temp_uint_data |= temp_data;
    temp_float_data = temp_uint_data;
    temp_float_data *= 0.5;
    FloatToStr( temp_float_data, demo_txt );
    mikrobus_logWrite( "- TDIE:", _LOG_TEXT );
    mikrobus_logWrite( demo_txt, _LOG_TEXT );
    mikrobus_logWrite( log_degree, _LOG_LINE );
    
    mikrobus_logWrite( "____________________", _LOG_LINE );
    Delay_ms( 5000 );
}

Additional Functions :

  • void charger_status_1_handler ( uint8_t cs1_data ) - Handles data from charger status 1 and logs it
  • void charger_status_2_handler ( uint8_t cs2_data ) - Handles data from charger status 2 and logs it

The full application code, and ready to use projects can be found on our LibStock page.

Other mikroE Libraries used in the example:

  • Conversions
  • UART
  • I2C

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

6DOF IMU 11 click

0

The 6DOF IMU 11 click is a Click board™ based on the KMX63, a 6 Degrees-of-Freedom inertial sensor system on a single, silicon chip, which is designed to strike a balance between current consumption and noise performance with excellent bias stability over temperature.

[Learn More]

DAQ click

0

DAQ Click is a compact add-on board representing a data acquisition solution. This board features the ADAQ7768-1, a 24-bit precision data acquisition (DAQ) μModule system that encapsulates signal conditioning, conversion, and processing blocks into one SiP from Analog Devices. It supports a fully differential input signal with a maximum voltage range of ±12V with an excellent common-mode rejection ratio (CMRR). The input signal is fully buffered with a low input bias current, enabling the ADAQ7768-1 to interface to sensors with high output impedance directly.

[Learn More]

ADC 6 click

0

ADC 6 click is an advanced 24bit multichannel analog to digital converter (ADC), with 8 fully differential or 15 single ended/pseudo differential sampling inputs, and very flexible routing capabilities. The click board has two 2x10 pin headers, used both to configure the device and connect the input channels.

[Learn More]