Add support for BQ27441 battery monitor#323
Open
zakrent wants to merge 5 commits intoSlimeVR:mainfrom
Open
Conversation
09b281b to
13e8674
Compare
Author
|
Sorry, it exploded after I rebased it but now should be fine. |
gorbit99
reviewed
Jul 31, 2025
src/batterymonitor.h
Outdated
| float getVoltage() const { return voltage; } | ||
| float getLevel() const { return level; } | ||
|
|
||
| String getExtendedInfo(); |
src/serial/serialcommands.cpp
Outdated
| } | ||
| logger.info( | ||
| "Battery voltage: %.3f, level: %.1f%%", | ||
| "Battery voltage: %.3f, level: %.1f%%, %s", |
Contributor
There was a problem hiding this comment.
this adds an unnecessary leading "," when anything other than the BQ chip is in use
src/defines.h
Outdated
Comment on lines
66
to
68
| #if BATTERY_MONITOR == BAT_BQ27441 && I2C_SPEED > 100000 | ||
| #error BQ27441 library supports only 100 kHz I2C speed | ||
| #endif |
Contributor
There was a problem hiding this comment.
Not sure how well this requirement would work, the sensor reading speed is already somewhat the bottleneck with 400kHz
Author
There was a problem hiding this comment.
You're right, for daily use I use trackers iwth single IMU but if I tried it with 2nd one it got laggy.
I improved the sparkfun lib to support i2c >100 kHz.
gorbit99
approved these changes
Aug 2, 2025
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.
Adds support for BQ27441 battery gauge IC.
This IC is used for example in this sparkfun dev board: https://www.sparkfun.com/products/13777 and also can be used on custom PCBs.
It uses Sparkfun library for this IC: https://github.com/sparkfun/SparkFun_BQ27441_Arduino_Library, it is MIT license.
I modified this library slightly to disable
Wire.begin()call in it.