Skip to content
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

Fixed miyoo mini inaccurate battery readings. #1712

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

DevL0rd
Copy link

@DevL0rd DevL0rd commented Dec 4, 2024

This PR fixes the following issues on the Miyoo Mini:

  • Fixes sudden low battery warnings or shutdowns do to unstable/unsmoothed voltage reading
  • Fixes inaccurate battery readings
  • Fixes inaccurate voltage droop curve
  • Prevent battery rising again due to system power draw changes. (about 80mv variance, a single percent on the battery)
  • Fixes device not cutting of for 40 minutes to 1hr after hitting 0% battery

The existing issue was due to reading ADC value as if it was 4.3V to 3.3V.
The correct range should be from 4.2V to 3.0V as the miyoomini has a li-ion, not a li-po battery.
Additionally I havee simplified the ADC to voltage reading, and interpolated the voltage across a lookup table to make the battery percentage relation completly linear.

I also collected 10 samples of the battery reading and averaged them together to better smooth the adc data.

These changes have completely fixed the wildly inaccurate and strange battery readings for the Miyoo Mini.
And they have made the battery drain curve completely linear, with proper power cutoff right at 0%.

If any one has a miyoo mini also, please give it a go :)

image

@DevL0rd DevL0rd force-pushed the mmv4-batteryaccuracy branch from 0388160 to dbdb3b2 Compare December 4, 2024 14:01
@Yin26
Copy link

Yin26 commented Dec 7, 2024

hi, would it be possible to share those changes with me? I seem to have battery drain problems and this sounds like it'd be really helpful!

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.

2 participants