Conversation
The V2 and V2.1 use different battery divider pins and resistor ratios, and the divider rail must be enabled after wake. Probe both candidate inputs at startup, attach only the detected channel, and scale the measurement with the matching ratio. Add a generic pre-deep-sleep hook so the Heltec board can cut the battery divider rail before sleeping. Fixes meshcore-dev#1286
This branch has not been deployed
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.
Fix Battery monitoring for Heltec v2 / v2.1
I have only version V2.1 available for testing. The ADC to voltage conversion was verified with a multimeter.
In Begin() Method the two ADC Inputs for are measured. Based on the result either V2 or V2.1 hardware is selected for further measurements.
Just before entering DeepSleep the MOSFET is disabled to safe energy in deep sleep mode. During running the approximately 13uA are fine.
I would be nice I anybody has a V2 to verify the change. In Meshcore App for my Heltec V2.1 is displayed correctly (with and without battery connected).
See #1286