BQ27621-G1 Breakout Board v1 is an open-source printed circuit board by pbdaran, from the pbdaran/BQ27621-G1 repository on GitHub, published under the MIT licence. It is a 2-layer board of 33.5 × 33 mm with 19 parts on 11 nets, routed with 116 tracks and 28 vias.
It is built around the BQ27621YZFR-G1A, RMCF0603FT10K0 and RMCF0603FT5K10, with the UMK107B7474KA-TR and G800W305018EU among its other parts. Its parts include 5 resistors, 2 capacitors, 2 connectors and 1 IC. It belongs with the interfaces and adapters and microcontroller boards boards of this library.
This Arduino library provides a comprehensive interface for the Texas Instruments BQ27621-G1 battery fuel gauge IC, enabling easy integration with Arduino-based projects. The library supports all major features of the BQ27621-G1 as described in the Technical Reference Manual (SLUUAD4C, December 2013 - Revised August 2014).
Features
Control Commands: Manage device states (SEALED/UNSEALED, CONFIG UPDATE, SHUTDOWN, etc.).
Standard Commands: Read battery parameters such as Temperature, Voltage, StateOfCharge, RemainingCapacity, and more.
Extended Commands: Access and modify Operation Configuration, Design Capacity, and block data operations.
Data Memory Access: Configure safety parameters, charge termination, SOC thresholds, sleep current, terminate voltage, and battery chemistry ID.
Battery Profile Selection: Support for default (CHEM_ID 0x1202) and alternate chemistry profiles (0x1210 for 4.3V, 0x354 for 4.35V).
I2C Communication: Robust functions for reading and writing word and block data over I2C.
Requirements
Hardware:
Arduino-compatible board with I2C support (e.g., Arduino Uno, Mega, etc.).
BQ27621-G1 battery fuel gauge IC connected via I2C (SDA, SCL, power lines).
Software:
Arduino IDE (version 1.8.0 or later recommended).
Wire library (included with Arduino IDE).
Dependencies: None beyond the standard Arduino Wire library.
Installation
Download the Library:
Clone this repository or download the ZIP file.
Extract the BQ27621 folder containing BQ27621.h, BQ27621.cpp, and the example sketch.
Install the Library:
Place the BQ27621 folder in your Arduino libraries directory (typically ~/Arduino/libraries/).
Restart the Arduino IDE if it was open during installation.
Connect the Hardware:
Connect the BQ27621-G1 to your Arduino:
SDA to Arduino SDA pin.
SCL to Arduino SCL pin.
VCC to 3.3V or 5V (check your board's compatibility).
GND to Arduino GND.
Verify the I2C address (default: 0x55). Adjust in the constructor if different.
Open the Example:
In the Arduino IDE, go to File > Examples > BQ27621 > BQ27621_Example.
Upload the example sketch to your Arduino.
Usage
The library provides a BQ27621 class with methods to interact with the fuel gauge. Below is a basic example of initializing the device and reading battery parameters:
cpp
#include <Wire.h>
#include"BQ27621.h"
BQ27621 batteryGauge; // Default I2C address: 0x55void setup(){
Serial.begin(9600);
while(!Serial);
if(!batteryGauge.begin()){
Serial.println("Failed to initialize BQ27621!");
while(1);
}
Serial.println("BQ27621 Initialized Successfully");
// Configure battery parameters
batteryGauge.setUnsealed();
batteryGauge.enterConfigUpdate();
batteryGauge.setDesignCapacity(1200); // Set to 1200mAh
batteryGauge.setTerminateVoltage(3200); // Set to 3200mV
batteryGauge.exitConfigUpdate();
batteryGauge.setSealed();
}
Example Sketch
The provided example sketch (BQ27621_Example.ino) demonstrates the full range of library features, including:
Initializing the BQ27621-G1 and verifying communication.
Configuring the device in UNSEALED mode.
Setting safety parameters, charge termination, SOC thresholds, and operation configurations.
Selecting an alternate battery chemistry profile (e.g., CHEM_ID 0x1210 for 4.3V batteries).
Reading and displaying battery status (voltage, SOC, capacity, current, power, etc.).
Toggling the GPOUT pin for debugging.
To use the example:
Open BQ27621_Example.ino in the Arduino IDE.
Adjust configuration parameters (e.g., DesignCapacity, TerminateVoltage) based on your battery specifications.
Upload the sketch and monitor the Serial output at 9600 baud.
Library Methods
Constructor
BQ27621(uint8_t i2cAddress = 0x55): Initialize with the I2C address (default: 0x55).
Initialization
bool begin(): Initialize I2C communication and verify device presence.
Control Commands
uint16_t getControlStatus(): Read the control status register.
void setBatteryInsert(): Signal battery insertion.
void setSOCThresholds(uint8_t socfSet, uint8_t socfClear): Set SOC final discharge thresholds.
void setOpConfig(uint16_t config): Set operation configuration.
void setOpConfigB(uint8_t config): Set operation configuration B.
void setSleepCurrent(uint16_t current): Set sleep current threshold.
void setTerminateVoltage(uint16_t voltage): Set terminate voltage.
void setChemID(uint16_t chemId): Set chemistry ID.
Notes
I2C Address: The default I2C address is 0x55. If your BQ27621-G1 uses a different address, specify it in the constructor.
SEALED vs. UNSEALED Mode: Configuration changes require UNSEALED mode. The library uses the default unseal keys (0x8000 0x8000). For production, set the device to SEALED mode after configuration.
Battery Chemistry: The library supports switching between three chemistry profiles (0x1202, 0x1210, 0x354). Ensure the selected profile matches your battery's maximum charging voltage (4.2V, 4.3V, or 4.35V).
Power Modes: The BQ27621-G1 automatically manages power modes (NORMAL, SLEEP, HIBERNATE, SHUTDOWN). Use enterShutdown() carefully, as it requires a GPOUT pin transition to wake up.
Error Handling: The begin() function checks for device presence. Always verify initialization before proceeding.
Checksums: Block data operations include automatic checksum calculation to ensure data integrity.
Troubleshooting
No Communication: Verify I2C connections, pull-up resistors (4.7kΩ recommended), and the correct I2C address.
Invalid Readings: Ensure the device is properly configured (e.g., correct chemistry ID, design capacity). Check if the device is in SEALED mode, which restricts some operations.
Configuration Issues: Enter UNSEALED mode before making configuration changes. Use enterConfigUpdate() for data memory modifications.
License
This library is released under the MIT License. See the LICENSE file for details.
Acknowledgments
Based on the Texas Instruments BQ27621-G1 Technical Reference Manual (SLUUAD4C).
Developed for use with Arduino-compatible platforms.
For further details, refer to the BQ27621-G1 datasheet (SLUSB3) and Quick Start Guide (SLUUAP5) available at www.ti.com.
Designing a compact, reliable battery management breakout board isn’t just about cramming chips together — it’s about understanding the trade-offs behind every component choice.
The 3D shell, buttons, and other associated models are licensed under a Creative Commons Attribution 4.0 International License .
129 parts
Questions
How big is the BQ27621-G1 Breakout Board v1 PCB?
It measures 33.5 × 33 mm and has 2 copper layers, 1.57 mm thick.
What parts does the BQ27621-G1 Breakout Board v1 use?
19 parts, built around the BQ27621YZFR-G1A, RMCF0603FT10K0, RMCF0603FT5K10 and UMK107B7474KA-TR. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the BQ27621-G1 Breakout Board v1 KiCad files?
From the pbdaran/BQ27621-G1 repository on GitHub, at the commit this page was made from: the board is Hardware/BQ27621-G1_Breakout_Board_v1.kicad_pcb and its schematic Hardware/BQ27621-G1_Breakout_Board_v1.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the BQ27621-G1 Breakout Board v1 design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).