Menu
Microbots
0
  • Learn
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
    • All Products
  • Community
    • Education
    • Software
  • About
    • Our Story
    • Reach Out
    • FAQs
  • English
  • Your Cart is Empty
Microbots
  • Learn
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
    • All Products
  • Community
    • Education
    • Software
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Language

  • 0 0

Understanding CodeCell Charging

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.

  • LiPo Battery Connector: Designed for safe and easy battery connection without soldering.
  • USB-C Port: Functions as a power source, charging port and a programming interface.

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:

  1. Conditioning Precharge – Ensures safe charging of deeply discharged batteries.
  2. Constant Current Charging – Provides a stable charge rate until the battery reaches a designated voltage threshold.
  3. Constant Voltage Charging – Maintains a constant voltage while gradually reducing current to complete the charge cycle.

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.

Default Charging Parameters

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.

Charging Indicators

The CodeCell library provides visual feedback on charging and power status using the onboard RGB LED:

  • Low Battery Warning: When battery voltage drops below 3.3V, the LED blinks red ten times, and the device enters Sleep Mode to conserve power.
  • Charging Process: While charging via USB, the LED remains blue. When the battery reaches full charge, the LED transitions to a breathing-light animation.
  • Battery Powered Mode: When running solely on battery power, the LED turns green and performs a breathing-light animation.

Reading Battery State

To read the power status of the CodeCell users can use the PowerStateRead() function:

  • 0 = Running from LiPo Battery Power
  • 1 = Running from USB Power
  • 2 = Power Status is Initializing 
  • 3 = LiPo Battery is low
  • 4 = LiPo Battery has fully charged
  • 5 = LiPo Battery is charging

Note: This feature is available from software release v1.2.8 and above, so make sure you have updated the firmware. The CodeCell remains operational while charging the battery, so if you like to stop operation, we recommend polling the power status.

Reading Battery Voltage & Level

To read the battery voltage you can use the BatteryVoltageRead() function or the BatteryLevelRead() to read the battery percentage.

For BatteryLevelRead(), the value returned is between 1–100%. If the battery is charging, it will return 101 and if the CodeCell is powered only via USB without a battery, it will return 102.

Conclusion:

With this information, you now have a full understanding of how CodeCell’s charging system works, including its default behaviors and customization options!

  • Share:


Also in CodeCell

Linking Your CodeCell to the MicroLink App
Linking Your CodeCell to the MicroLink App

Read More

Debugging CodeCell
Debugging CodeCell

Read More

CodeCell: Connecting with BLE
CodeCell: Connecting with BLE

Read More

Follow

Github

  • About
  • Software
  • Education
  • Contact
  • FAQs
  • Terms
  • Refund Policy
  • Privacy Policy

Join our Community ~ Be the first to know about new products and get exciting deals!

© 2025 Microbots.