diff --git a/docs/hardware.md b/docs/hardware.md index 64e66ce..ab4358d 100644 --- a/docs/hardware.md +++ b/docs/hardware.md @@ -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