Cool stuff for Raspberry Pi, Arduino and all electronics hobby projects
Notifications
Clear all

[Solved / Archived] Witty Pi 4 L3V7 Battery Remaining Capacity

5 Posts
2 Users
1 Likes
678 Views
(@billsidea)
Posts: 5
Active Member
Topic starter
 

Any suggestions for how to estimate remaining battery percentage (both when charging and also when running on battery)?

I can do some estimates while running on battery ((current voltage - threshold voltage) / (4.2V - threshold voltage)), but not sure how to tackle it when the battery is charging.

There are some other USB devices (e.g. UPS-Lite) that return the remaining capacity via the i2c bus, but I'm not seeing a similar option for the Witty Pi 4 L3V7.

 
Posted : 14/08/2023 5:58 am
(@admin)
Posts: 507
Member Admin
 

Witty Pi 4 L3V7 can only see the voltage of the battery when it is not being charged.

During the charging the battery is disconnected from Vin and the voltage on Vin is actually the voltage from USB-C connector (drops a little bit via the SS54 diode). In such case you can not know the actual voltage of the battery.

If you wonder why Witty Pi 4 L3V7 does not always monitor the voltage of battery, the answer is the MCU (ATtiny841) does not have any spare pin for this purpose.

 
Posted : 14/08/2023 4:38 pm
(@billsidea)
Posts: 5
Active Member
Topic starter
 

@admin Thanks so much for the info. Can you confirm my calculation above makes sense for calculating remaining capacity while unplugged?

 
Posted : 14/08/2023 6:33 pm
(@admin)
Posts: 507
Member Admin
 

@billsidea Usually you can not calculate the remaining capacity in this way, because the voltage and remaining capacity are not changed in a linear way.

Different battery has different voltage-vs-remaining-energy curve. After you draw that curve, you may estimate the remaining energy by voltage.

You may read this https://meloyelo.nz/knowledge-base/voltage-vs-remaining-energy-of-lithium-ion-batteries/

 
Posted : 14/08/2023 6:38 pm
billsidea reacted
(@billsidea)
Posts: 5
Active Member
Topic starter
 

@admin Ok, thanks. This is great info for the novice (i.e. me), so thank you very much!

 
Posted : 14/08/2023 6:41 pm
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.