Docs: clarify battery divider resistor value is flexible, not fixed at 200k

It's a ratio divider -- what matters is the two resistors matching each
other, not hitting 200k exactly. Also note sdkconfig.xiao now enables
FRAME_BATTERY_ADC_GPIO by default, which the doc's "off by default"
line no longer reflected.
This commit is contained in:
2026-07-20 23:08:31 -04:00
parent ce98c564e8
commit 37145ef135
+15 -3
View File
@@ -123,14 +123,26 @@ BAT+/BAT- charge pads on its underside and charges over USB-C):
does no low-voltage cutoff of its own), soldered or JST-PH-pigtailed
to the BAT pads. JST-PH polarity is not standardized -- verify with a
multimeter before connecting.
- Battery level sense: 2x200k divider from BAT+ to GND, midpoint to
GPIO0/A0 (shared with the back button -- deliberate, see
- Battery level sense: two equal-value resistors in series from BAT+ to
GND (200k is the reference value, but any matched pair works -- it's
a ratio divider, so what matters is the two resistors matching each
other, not the absolute value; higher values just draw less constant
current from the battery, e.g. ~10uA for 200k+200k vs ~2uA for
1M+1M, at the cost of a slightly noisier ADC reading from the higher
source impedance -- not noticeable in practice up to around 1M given
how coarse the percent curve already is). Midpoint to GPIO0/A0
(shared with the back button -- deliberate, see
[`firmware/README.md`](../firmware/README.md#battery-xiao-esp32-c6)).
- Optional mains detection: 2x100k divider from the 5V pin to GND,
midpoint to a spare GPIO (e.g. 22).
Both features are off by default in firmware
(`FRAME_BATTERY_ADC_GPIO`/`FRAME_VBUS_SENSE_GPIO` = -1).
(`FRAME_BATTERY_ADC_GPIO`/`FRAME_VBUS_SENSE_GPIO` = -1) -- except
`FRAME_BATTERY_ADC_GPIO`, which [`firmware/sdkconfig.xiao`](../firmware/sdkconfig.xiao)
turns on (GPIO0) by default for XIAO builds, since that's the one
board this feature was designed for. Mains detection stays off by
default even there; set `FRAME_VBUS_SENSE_GPIO` yourself if you wire
that divider too.
## Power