xiao_sense_nrf52840_battery_lib
xiao_sense_nrf52840_battery_lib copied to clipboard
Optimizing power consumption
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.