xiao_sense_nrf52840_battery_lib icon indicating copy to clipboard operation
xiao_sense_nrf52840_battery_lib copied to clipboard

Optimizing power consumption

Open Tjoms99 opened this issue 8 months ago • 4 comments

Summary

Addressing the issue of current draw by certain GPIOs when enabled, with a focus on optimizing power consumption.

Affected GPIOs

These three GPIOs are drawing current when enabled:

#define GPIO_BATTERY_CHARGE_SPEED 13
#define GPIO_BATTERY_CHARGING_ENABLE 17
#define GPIO_BATTERY_READ_ENABLE 14

Proposed Solution

When not in use, two of these GPIOs can be disabled to save power:

  • GPIO_BATTERY_CHARGE_SPEED
  • GPIO_BATTERY_READ_ENABLE

Details

  • GPIO_BATTERY_CHARGE_SPEED :

    • Should be disabled when the charger is not connected.
  • GPIO_BATTERY_CHARGING_ENABLE:

    • If disabled, the battery driver will not be able to detect when a charger is connected or disconnected.
    • Consequently, it will not be able to reconnect GPIO_BATTERY_CHARGE_SPEED automatically, and this would have to be done manually which is something we dont want.
  • GPIO_BATTERY_READ_ENABLE:

    • Should be enabled just before a voltage sample is taken.
    • Should be disabled immediately after the sampling is done.

Tjoms99 avatar Jun 23 '24 21:06 Tjoms99