PDA

View Full Version : Lithium Ion battery



Nicmus
- 1st November 2006, 23:20
Does anyone have any experience with accessing the “fuel gage” on Lithium Ion batteries and point me to were I can find a easy to understand description of how to read the Status Of Charge (SOC) of a such battery using the I2C interface?
All I want to do is use a PIC (any PIC), read this particular piece of information from a smart battery and display it on a LED system and eventually alarm the user when the SOC is below a certain level. What I’m missing is what should the PIC say and what answer should I expect from the battery.
I tried the SMBus.org but they expect you to be a member and pay all kind of fees.
I also did Google and this forum search and didn’t get any satisfactory results.
Any input will be appreciated.
Regards,
Nick

sayzer
- 2nd November 2006, 09:32
Hi Nick,

Check this post and ask PEU how he made it.

http://www.picbasic.co.uk/forum/showthread.php?t=4782


---------------------------------

Nicmus
- 2nd November 2006, 15:07
Hi Sayzer,
Thank you for your input.
My project has to do with a battery which has the built in fuel gage.BTW it can be any 3.6V- 14.4V battery.
From what I understand reading voltage only on this kind of batteries is not accurate especially when your load fluctuates. The built in fuel gage takes in account a lot of factors (charge/discharge current, cells and pack voltages, temperature, age …) which can influence the “real” remaining charge and compensates for that.
What I want to do is to use this information already available and more precise then anything I can built and hopefully with a PIC 12Fxxx and a bi-color LED to identify five 20 % steps (green, umber, red and blinking green, umber, red).
It is also my understanding that the smart batteries come in two flavors when you try to communicate with them:
- 1 wire interface
- I2C interface
My flavor is the I2C and what I’m looking for is some info on how to talk to the battery (what to say, what address to read and who says what and when).
Thanks again and I’m sure with this forum resources we can get somewhere.
Regards,
Nick

Nicmus
- 5th November 2006, 22:25
I was hopping this topic will attract more interested hobbyists considering that the information which might surface here can be applied to a lot more projects where battery monitor is needed, not to mention a smart charger.
Many of the new smart batteries used with newer electronic devices can be used for hobbyist applications offering small size and high capacity.
I did find a little more information in this matter.
The SMbus interface used lets a master communicate to a battery pack using one of the three protocols:
- Write Word
- Read Word
- Read Block
To read from a slave the master will have to do this:
- Sends a start bit
- Sends the battery address (1 byte = first 7 bits are the address and last one specifies if is a Read or Write operation: 0 for Write and 1 for Read). 0 first time
- Waits for a Acknowledge bit from the battery
- Sends a command code (1 byte)
- Waits for acknowledge bit
- Sends a Start bit
- Sends the battery address (1 byte = first 7 bits are the address and last one specifies if is a Read or Write operation: 0 for Write and 1 for Read). 1 this time
- Waits for Acknowledge bit
- Shifts first data byte in
- Sends Acknowledge bit
- Shifts second data byte in
- Sends a Not Acknowledge bit and a Stop bit to end the transfer.
If anybody can add some more specifics to this it will be more than helpful to me. What I need is a possible map of how the info is stored in the battery, how a Start, Acknowledge, Not Acknowledge and Stop condition looks like.

I refuse to think that I’m on a “Dead End” situation especially when none of the “Big Guns” didn’t get involved yet.

Best Regards to all

Nick

SteveB
- 6th November 2006, 03:50
. ....how a Start, Acknowledge, Not Acknowledge and Stop condition looks like. Nick,
From your discription, this sounds like an I2C compatible interface, so the Start, Ack, etc, can be found in the I2C bus specs (http://www.nxp.com/acrobat_download/literature/9398/39340011.pdf), or just use the I2C in PBP and don't worry about it


. Sends the battery address (1 byte = first 7 bits are the address ....
....What I need is a possible map of how the info is stored in the battery...This is where the rubber meets the road. You certianly will need to do some research to get this address, and it's a show stopper. Then, once you've got the address, you are correct in needing the memory map to get any usefull info from the battery.

BTW, have you heard the rescent reports of exploding Li-ion batteries (particularly laptop batteries)?. They can be a bit finicky when it come to care and feeding. Here is an articale I came across on Tom's Hardware last week about Why they explode. (http://www.mobilityguru.com/2006/11/02/how_notebook_batteries_work_and_why_they_blow_up/index.html) Pretty simplistic, but it does raise the question: Do you really want to mess with this if you don't have all the info you need? Maybe the status reader, but probably not the charger unless you are sure you know what your doing.

Sorry I don't have any real useful information to help you out.
Steve

Nicmus
- 6th November 2006, 15:25
Thank you Steve.
I confirmed that we are indeed dealing with I2C bus and the I2C specs should apply.
Indirectly you answered an other question for me which was related with the PBP’s I2C and if it can handle something like this.
As soon as I get my parts I will try both: the PBP built in I2C and built my own subroutines for each condition and call them in a main program. I’m not sure if the built in I2C commands are flexible enough for this application.
I am aware of the news on Li-ion battery but at this time I’m only trying to read info from the battery and let the charging part to the professionals.
What I was trying to relay in my other posts is the fact that with only $1.00 you can monitor your battery level and take advantage of a large selection of small form factor / high capacity smart batteries (not necessarily Li-ion) to use in your projects. All I want at this time is the peace of mind that my project will never run the batteries dead and I have an advance warning when the batteries are low. I also want to put some of my "almost never used" smart batteries to do something more useful than collecting dust.
I will do some more digging and post the results.
Any other input is more then appreciated.

Best Regards to all PIC enthusiasts.

Nick