Repository navigation
B1: fix battery gauge (full pack read ~90%) - #56
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new, full 3000 mAh LiPo (multimeter 4.159 V disconnected = full) reads ~90% on B1 and never climbs. Two causes:
analogRead*(3.3/4095)is nonlinear near the top of the range and reads ~0.03 V low at full. Switch B1 toanalogReadMilliVolts(eFuse-calibrated) with the true 100k/100k → ×2.0 divider (perB1_V013_AUDIT.md), verified against the 4.159 V reading.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