CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

battery voltage display

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
savotech



Joined: 13 Dec 2012
Posts: 12

View user's profile Send private message Send e-mail Visit poster's website

battery voltage display
PostPosted: Thu Mar 07, 2019 6:41 am     Reply with quote

Hi house, i am having difficulty in efficiently displaying Lithium-ion battery voltage because of the recovery effect.
For example, if i discharge it to 3.45v then i switch off the load for sometime, putting in on back, the voltage has risen to 3.5v or above, then later decrease sharply.
Then when i plug my lithium ion battery charger the voltage increases sharply to 3.7v and above but when i remove the charger, it decreases sharply to 3.5v.
This is making me not to know the true voltage of my battery while charging or discharging. I know many devices like phone or laptop that uses lithium ion and displays the battery voltage accurately.

My question is that, is there a code calculation to include to my code while i plug the charger to make the microcontroller Display the true voltage. (I already know how to use adc to display voltage but the its battery voltage that is not stable)

I take a perfect example from my phone or laptop %battery display, both are effective. They don't exhibit the recovery effect. Once i discharge to 50% and i turn off the phone or laptop it will never increase or decrease until i actually charge or discharge respectively.

Thanks in advance for your help.
temtronic



Joined: 01 Jul 2010
Posts: 9216
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Mar 07, 2019 7:09 am     Reply with quote

How you measure the battery depends upon who made it, and each mfr has a specific method of determining the 'life' left in their battery.
Generally speaking, you can't just take the Open Circuit Voltage (OCV) and say '3.5= 75% life, 3.4=60% life'. You need to measure the battery's voltage under a specific load for a specific time, consult the mfr's data THEN you have a true reading of the battery. While my remote energy control systems used sealed lead acid batteries (Gates), the procedure was the same. Test the battery under xx amp load for yy time and the terminal voltage represented the 'life left' in the battery. The reason your phone is accurate is that they've done all this. They also use the SAME battery for the product. When they upgrade the battery, they have to redo the 'gas gauge' code within the phone program. You'll also find that they will discharge the battery, test, and when at the correct point THEN recharge using a several step algorithm, testing at points along the way.
getting the most from a battery is not simple BUT the mfrs do document these procedures for you.
One note. Be sure to use a stable, accurate voltage reference and NOT VDD ! VDD will vary a LOT, and is not recommended for ADC Vref except for say 8 bit mode.
Ttelmah



Joined: 11 Mar 2010
Posts: 19480

View user's profile Send private message

PostPosted: Thu Mar 07, 2019 9:22 am     Reply with quote

Things like phones, know how much current is being drawn from the battery.
I have a system I do, which estimates the power in a LiIon pack, and it has
curves internally stored for 0C, and 1C discharge rates. Then interpolates
between these based on the current being drawn, and between the points
on the resulting calculated values to get the percentage held.

3.7v seems a very low charge voltage. Normally 4.2 is the charge
voltage for a standard Li_Ion cell. 3.7, suggests something like an A123
cell?.

The phones use 'gas gauge' chips, which measure voltage and power.
Systems relying on voltage alone, usually have just a very minimal
perhaps 4 segment 'level gauge', because of the inaccuracies.
Ttelmah



Joined: 11 Mar 2010
Posts: 19480

View user's profile Send private message

PostPosted: Thu Mar 07, 2019 12:29 pm     Reply with quote

This thread:

<https://www.ecnmag.com/article/2012/11/fundamentals-battery-fuel-gauging>

Gives a nice description of fuel gauge systems.
savotech



Joined: 13 Dec 2012
Posts: 12

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Mar 08, 2019 3:19 pm     Reply with quote

@ttelmah, Thanks for the idea of measuring the current for a specific time, thanks for the link also, it was very helpful. I think i should be able to develop a code for that. Or alternatively, order a battery fuel gauge ic like ds2782.
temtronic



Joined: 01 Jul 2010
Posts: 9216
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Mar 08, 2019 4:06 pm     Reply with quote

If you buy/use a 'fuel gauge' device be sure ALL of the 20+ registers get the CORRECT data otherwise the device won't operate properly. That data must conform to the mfr specs of whatever battery you use.
Ttelmah



Joined: 11 Mar 2010
Posts: 19480

View user's profile Send private message

PostPosted: Sat Mar 09, 2019 1:26 am     Reply with quote

Some do implement 'learning' algorithms and will slowly adjust to a battery
change.
All though are dependant on 'Coulomb counting', not simple voltage.
Voltage on it's own, is not able to measure charge state, except under
'no load' conditions. Even then temperature is also needed.
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Mar 10, 2019 12:55 pm     Reply with quote

Just to toss it out there so the question is asked....

Are we sure the battery isn't a LiFePO4?

The charging voltages are close to Li-Ion -- but a little lower -- almost like what you've been mentioning.

(LiFePO4 charges @ 3.65V which could be interpreted as "3.7")

Just wondering.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah



Joined: 11 Mar 2010
Posts: 19480

View user's profile Send private message

PostPosted: Sun Mar 10, 2019 1:15 pm     Reply with quote

That's what I suspect. A123, is the commonest design of LiFePO4 cell
out there. It was originally used in DeWalt power tools.

<https://www.componentshop.co.uk/3-3v-2500mah-a123-lifepo4-26650-single-cell.html>

There is also a version with Yttrium added that charges to just under 4v.

They are nice cells, but with a slightly lower energy desity than LiPo.
temtronic



Joined: 01 Jul 2010
Posts: 9216
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Mar 10, 2019 4:27 pm     Reply with quote

What is critical is measuring the cell temperature and of course each manufacturer has SPECIFIC methods to recharge THEIR cellls. Just like you can't put Chevy wheels on a Ford, you MUST follow the mfr's method !!
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Mar 10, 2019 9:55 pm     Reply with quote

Ttelmah wrote:


They are nice cells, but with a slightly lower energy desity than LiPo.


Yes, LiFePO4 has a lower energy density than Li-Ion, but the tradeoff is they don't bust into flames.

And that's kinda nice. ;) (LoL)

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah



Joined: 11 Mar 2010
Posts: 19480

View user's profile Send private message

PostPosted: Mon Mar 11, 2019 2:54 am     Reply with quote

This is a common 'misconception' I'm afraid. Sad

LiFePO4 cells will still explode and burn. They are just _less likely_ to do so
in normal use.
They are slightly 'self balancing' on charge, so are very unlikely to have
a cell overvoltage when charging. They also generally tend not to ignite
when punctured, if under no load.
However if shorted, they will both overheat, and ignite. While a puncture
when they are under load can also cause ignition.
They are supposed to have a better life, so retain more power after a couple
of years compared to normal Li-Ion, but in use I've found them to be just
as bad in this regard. Lithium nickel is the cell I've had the best performance
from, and this too is meant to be a somewhat safer combination.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group