Repeater, room server, companion: turn off SenseCAP Solar battery divider after reading voltage

This commit is contained in:
tth committed 2026-11-24 19:55:11 +01:00
1 parent 85ec23f96b
commit d89062c105
3 files changed
+6 -2

No files matched your search

+4
View File
@@ -245,6 +245,10 @@ unnecessary idle draw that affect all nRF52 boards (not only SenseCAP Solar):
finds zero devices (re-enabling temporarily for the `i2c` CLI command).
`NOISE_FLOOR_CALIB_INTERVAL` is raised from 2 s to 10 s to cut idle SPI
wake-ups 5x.
- **SenseCAP Solar battery divider (`VBAT_ENABLE`)**: held `HIGH` (off) at boot
and restored to `HIGH` immediately after `getBattMilliVolts()` instead of
staying continuously `LOW`. (`initiateShutdown()` still drives it `LOW` when
arming LPCOMP wake.)
## Measuring this yourself — two traps
@@ -31,10 +31,9 @@ void SenseCapSolarBoard::begin() {
pinMode(BATTERY_PIN, INPUT);
pinMode(VBAT_ENABLE, OUTPUT);
digitalWrite(VBAT_ENABLE, LOW);
digitalWrite(VBAT_ENABLE, HIGH);
analogReadResolution(12);
analogReference(AR_INTERNAL_3_0);
delay(50);
#ifdef PIN_USER_BTN
pinMode(PIN_USER_BTN, INPUT_PULLUP);
@@ -59,6 +59,7 @@ public:
analogReference(AR_INTERNAL_3_0);
delay(10);
adcvalue = analogRead(BATTERY_PIN);
digitalWrite(VBAT_ENABLE, HIGH);
return (adcvalue * ADC_MULTIPLIER * AREF_VOLTAGE) / 4.096;
}