Skip to content

B1: fix battery gauge (full pack read ~90%) - #56

Merged
avillach merged 1 commit into
mainfrom
b1/battery-gauge-calibration
Jul 1, 2026
Merged

avillach merged 1 commit into
mainfrom
b1/battery-gauge-calibration

Conversation

@avillach

@avillach avillach commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

A new, full 3000 mAh LiPo (multimeter 4.159 V disconnected = full) reads ~90% on B1 and never climbs. Two causes:

  1. ADC under-read — raw analogRead*(3.3/4095) is nonlinear near the top of the range and reads ~0.03 V low at full. Switch B1 to analogReadMilliVolts (eFuse-calibrated) with the true 100k/100k → ×2.0 divider (per B1_V013_AUDIT.md), verified against the 4.159 V reading.
  2. Scale never reaches 100% at rest — the % table only hit 100% at 4.20 V, which a LiPo only touches while actively charging; at rest it settles ~4.15 V, capping the gauge ~95%. Add a B1 rested-LiPo curve where 4.15 V = 100%.

Also explains the 90↔98 flicker (reading catching the ~4.2 V charging voltage vs the rested value).

B-only. E unchanged (2026.06.29.02, byte-identical → CI skips it). B → 2026.06.29.04.

🤖 Generated with Claude Code

Two bugs made a fully-charged pack cap ~90%:
1. Raw analogRead*(3.3/4095) is nonlinear near the top of the ADC range and
   under-read ~0.03V at full (a rested-full 4.16V pack read ~4.13V). Switch B1
   to analogReadMilliVolts (eFuse-calibrated) with the true 100k/100k -> x2.0
   divider (B1_V013_AUDIT.md); verified vs a 4.159V multimeter reading.
2. The % table only hit 100% at 4.20V, which a LiPo only reaches while actively
   charging — at rest it settles to ~4.15V, so full capped ~95%. Add a B1
   rested-LiPo curve where 4.15V = 100%.

B-only (#ifdef BUILD_B1); E unchanged (still 2026.06.29.02). B -> 2026.06.29.04.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@avillach
avillach merged commit 24bf1bb into main Jul 1, 2026
1 check passed
@avillach
avillach deleted the b1/battery-gauge-calibration branch July 1, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant