-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Battery monitor feature v2 - based on INA219 Current&Power Monitor #1038
Open
gvidinski
wants to merge
30
commits into
opendata-stuttgart:beta
Choose a base branch
from
gvidinski:feature/Battery_monitor_v2
base: beta
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Battery monitor feature v2 - based on INA219 Current&Power Monitor #1038
gvidinski
wants to merge
30
commits into
opendata-stuttgart:beta
from
gvidinski:feature/Battery_monitor_v2
Conversation
This file contains 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
…into feature/Battery_monitor
…BR tag befor battery settings for better UX;
…ery_analog_value' is outside of the predefined range by any circumstances;
List of known i2c addresses
Changes in workflow files
build workflow: make it run only if ref_type != 'tag'
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.
I'm presenting you the new version of Battery monitor feature. It allows you, if UPS topology is used to power the board, to monitor the state of the battery by showing current battery voltage in mV along with it state in percent, current draw in mA and power consumption in mW(W).
This solution relies on TI INA219 Zerø-Drift, Bidirectional Current/Power Monitor IC With I2C Interface and can be used by simply attaching to the configuration an Adafruit INA219 Current Sensor Breakout board (Figure 1) or some of its clones.
Figure 1.
The UI is organized in the following manner. The feature can be enabled through the "Configuration" page. All the settings for the Battery monitor have to be entered form the “More settings” tab, under the “Enable battery monitor” checkbox (Figure 2).
When enabled (Figure 3) user may choose from a drop-down (Figure 4) between tree calibration settings already predefined by the Adafruit INA219 library, depending on concrete setup - 32V/2A, 32V/1A & 16V/400mA. But most important, in order to receive correct battery state percentage, the user will have to set the threshold voltage for both, the discharged [Battery U min (mV)] and the fully charged [Battery U max (mV)] state.
Then the actual battery state can be obtained at the “Device status” page (Figure5) in the form of “Battery status: -.--mV | -%”, "Current draw: ---mA" & "Power consumption: ---mW" (Figure 5.).
Build and testing was done using the PlatformIO under the Visual Studio Code IDE following the “Contributing Guidelines”.