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

Misleading battery status #224

Open
moneymanolis opened this issue Oct 15, 2022 · 1 comment
Open

Misleading battery status #224

moneymanolis opened this issue Oct 15, 2022 · 1 comment
Labels
bug Something isn't working gui

Comments

@moneymanolis
Copy link
Contributor

moneymanolis commented Oct 15, 2022

After fully charging the battery is never showing a full bar and it very quickly deteriorates from green to orange. I am not sure whether this is due to my device or a more general problem, e.g. rounding errors.
Using Specter Shield with battery.

Related to this, it would be a better UX to see a charging symbol when charging the DIY while on. Or is the charging too minimal when on? @stepansnigirev

@moneymanolis moneymanolis added bug Something isn't working gui labels Oct 15, 2022
@stepansnigirev
Copy link
Collaborator

The battery status is implemented here:
https://github.com/cryptoadvance/specter-diy/blob/master/src/platform.py#L267

Right now it's a simple linear interpolation based on some values from the datasheet.

If you want to make a proper display of the battery status you can calibrate it. For that I'd suggest writing a script that will:

  • turn on the display (to make power consumption larger)
  • read the battery level every 10 seconds or so in an infinite loop
  • after every measurement open a file on the SD card in append mode and add measured value there together with time.time() value

Then you can charge the battery to 100%, and keep the script running until the device turns off.
Then we can plot the results and see how we should change the function to return better estimates.

Charging is close to zero when the device is on, depending on the device can be even negative.
It should be possible to optimize the power consumption but I didn't put any effort into that.
For example, currently the display is fully refreshed even if nothing happens on the screen, but most screens are static. So one optimization would be to refresh the display only when touch is detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gui
Projects
None yet
Development

No branches or pull requests

2 participants