The CodeCell offers flexibility in power supply options, allowing it to be powered through either the LiPo battery connector, a USB-C cable, or both simultaneously. This ensures adaptability across different use cases.
Power management is handled by the BQ24232 battery management chip, which supports Dynamic Power-Path Management (DPPM). This allows the CodeCell to run from external power while simultaneously charging the battery. The battery charging process follows three key phases:
The BQ24232 chip regulates the output voltage, supporting a maximum output of 1500mA when powered by the LiPo battery and 450mA when powered via USB.
By default, the LiPo battery charge current is set to 90mA. This is optimized for the optional 170mAh LiPo battery, ensuring a safe and balanced charging rate.
Advanced users who wish to modify the charge current can do so by replacing 0402 resistor R12. However, this modification requires precise soldering skills, as 0402 components are extremely small. For further details, refer to the BQ24232 datasheet.
The CodeCell library provides visual feedback on charging and power status using the onboard RGB LED:
By default, the CodeCell enters Sleep Mode while charging to maximize efficiency. However, starting from software release v1.2.7, users can override this behavior using the USBChargeState() function, which keeps the CodeCell awake during charging.
To keep the CodeCell awake while charging, add the following code to your setup function:
void setup() {
Serial.begin(115200); // Set Serial baud rate to 115200
// Ensure Tools/USB_CDC_On_Boot is enabled if using Serial
myCodeCell.Init(LIGHT); // Initializes Light Sensor
myCodeCell.USBChargeState(1); // Keeps CodeCell awake during charging
}
Behavior with USBChargeState(1):
This feature is useful for applications that require CodeCell to remain active while charging, such as continuous data logging or IoT monitoring.
With this information, you now have a full understanding of how CodeCell’s charging system works, including its default behaviors and customization options!
Join our Community ~ Be the first to know about new products and get exciting deals!
© 2025 Microbots.