Sonsivri

Electronics => Projects => Topic started by: puta on February 16, 2023, 11:18:50 11:18



Title: How to monitor battery status
Post by: puta on February 16, 2023, 11:18:50 11:18

How can I monitor the remaining battery charge status on a battery operated ESP32 microcontroller project with re-chargable eg. 18650 battery. This is somewhat similar to battery operated handheld devices / cameras .. etc dispaly battery status. Is it done by just reading the voltage across the Battery terminal... 

Thanks for your help on this.


Title: Re: How to monitor battery status
Post by: sadman on February 16, 2023, 11:26:27 11:26
if in your project you are using LCD and by using analogue input of ESP32 easily monitor the battery voltage and can be display on LCD remains power of the battery you can find code snip by googling.


Title: Re: How to monitor battery status
Post by: puta on February 16, 2023, 11:32:46 11:32
Yes, exactly. I use TFT display in my project. Thanks for quick reply sadman !

Is monitoring the voltage across the battery terminal acurate enough?
I mean is the relationship between voltage and remaining charge is linear enough? and what voltage is considered 0V remain in the display etc..


Title: Re: How to monitor battery status
Post by: sadman on February 16, 2023, 01:49:51 13:49
Yes, exactly. I use TFT display in my project. Thanks for quick reply sadman !

Is monitoring the voltage across the battery terminal acurate enough?
I mean is the relationship between voltage and remaining charge is linear enough? and what voltage is considered 0V remain in the display etc..


you just need simple voltage divider example share which is used for 9 volt battery yes it will linear during charge show voltage as rises during charging.


Title: Re: How to monitor battery status
Post by: pushycat on February 18, 2023, 04:12:00 16:12
How can I monitor the remaining battery charge status on a battery operated ESP32 microcontroller project with re-chargable eg. 18650 battery. This is somewhat similar to battery operated handheld devices / cameras .. etc dispaly battery status. Is it done by just reading the voltage across the Battery terminal...  

Thanks for your help on this.

In addition to monitoring the voltage with a voltage divider network as suggested by "sadman" you can also put a shunt resistor in series to the Load, to monitor the current which will give a real time of juice left in the battery. But this will make it accurate but a bit complicated and difficult in coding.


Title: Re: How to monitor battery status
Post by: bobcat1 on February 19, 2023, 08:22:42 08:22
Hi

for accurately monitor battery information & status you will need to use a coulomb counter,

Either use a software algorithm who process: current, temperature, voltage & battery chemistry data or use a chip from known manufactures like (TI,ST,Analog device....)

All the best

Bobi  


Title: Re: How to monitor battery status
Post by: sadman on February 19, 2023, 11:51:15 11:51
as mentioned by bobcat1 Coulomb Counter is much better solution then the simple resister divider network a good hook up instruction can be found at spark-fun webpage with code example.


https://learn.sparkfun.com/tutorials/ltc4150-coulomb-counter-hookup-guide/all#:~:text=A%20coulomb%20counter%20is%20like%20an%20odometer%20for%20current.&text=By%20counting%20the%20pulses%20and,putting%20back%20into)%20your%20battery.

https://www.analog.com/en/product-category/battery-fuel-gauge-and-coulomb-counter.html

https://www.youtube.com/watch?v=mxIrqjYCLho

sadman


Title: Re: How to monitor battery status
Post by: Sideshow Bob on February 19, 2023, 01:29:12 13:29
How can I monitor the remaining battery charge status on a battery operated ESP32 microcontroller project with re-chargable eg. 18650 battery. This is somewhat similar to battery operated handheld devices / cameras .. etc dispaly battery status. Is it done by just reading the voltage across the Battery terminal... 

Thanks for your help on this.
Somewhat a digression but a site I often use regarding battries is the  Battery University https://batteryuniversity.com/


Title: Re: How to monitor battery status
Post by: fvjibdz on September 10, 2023, 11:10:48 11:10
However, if your application has a mainly constant power draw (i.e. IoT sensor waking up and performing work on fixed intervals), you might exploit this to have fun implementing a level estimation by yourself, only using the voltage.

https://www.stg-maximintegrated.com/en/design/technical-documents/app-notes/3/3958.html

Towards the end of the application note you can see that the voltage doesn't relate linearly to the battery charge level. You might profile your battery under your constant load, recording the voltage, to then store the curve and lookup its inverse for finding the current capacity. Then, as a next step, you might reason about adjusting the curve over time to account for battery aging and degradation. A simple idea could be, knowing that your load in Ampere is constant, to integrate the estimated consumption on each 100%-0% cycle and keep track of how the total capacity is decreasing, then adjust the charge estimate proportionally.

Of course a battery monitor/gauge is the best solution as suggested by the other members. I just wanted to give my 2 cents on how I would approach this if I were to force myself, of be forced, not to use it. A solution like this will for sure be less accurate, but for a hobby project I think it would be fun to implement something like it.