# SOC (state of charge of batteries) for LiFePO4

I am trying to find the state of charge (SOC) of some batteries

• I have 3 LiFePO4 batteries, these are the ones I have purchased:

https://www.ampsplus.co.uk/ampsplus-14500-3-2v-500mah-battery-button

• I have them connected in parallel. For each battery I can measure their individual voltage and I can individually discharge each one through a resistor.

• The two methods I have found online to find the SOC (state of charge) of each battery are called coulomb counting and the second one is a voltage look up table.

Columb counting

This method involves integrating the current over time to find out how much charge is given to the batteries.

1. This only measures the difference in state of charge. Since you do not know how much charge is already in each battery you cant actually find the state of charge, how do you overcome this problem?

2. I only know how much current is going into the whole parallel connection and not into each battery, so that gives the SOC change across all of them and not each one. Is there a safe way to find the current going into each battery. Do we even need to find the current going into each one, if they are in parallel would they not just distribute this evenly between them?

Voltage look up table

This seems to be the easier method. If you have a graph of voltage VS SOC you can find how much charge is in each battery by simply measure the voltage on each battery and then comparing to the voltage values from the graph/look up table - The issue is

1. I looked at the data sheet as shown in the link and I cannot find anything like this. Therefore I would would need to find this myself. This leaves the question of how I could possibly do this?

2. When I do find this graph, then can I use the look up table for all the batteries, as in are the differences between them negligible enough to use the same graph for all or would I need to produce a different graph for each one?

I am thankful for any help and appreciate your time reading this.

• Arduino nano every
• SMPS for DC-DC conversion it can be a buck or boost
• I have designed a circuit for the batteries that can measure their voltages and discharge them individually.

Answering some questions ( I will edit this later with answers and everything If I am able to obtain them )

Just a note Russel, when you say 1%, what exactly do you refer to ?

To give an idea, this project uses an SMPS, Arduino and a circuit board.

Q1 - The current is measured using the ina219 current sensor. These values are taken every 1s and stored using the Arduino to an SD card.

Q2 - The batteries are connected in parallel using power cables. Each battery is in a circuit board which is this:

Using the relay, I can stop charging it and measure the voltage of each cell seperately and discharge them. It has an opto to isolate the cell from connections a relay to change pins for measuring and a pos and neg port which are used to connect the batteries together. The mosfet and resistor are only used when dischargining.

Q3 - For the integration, what I am doing is on the Arduino it collects the current measured every second. so its currentx1 second and I just add all the current basically since that find the area, AKA integration. ( yes it does assume the current is constant for that one second but the current is regulated by a PID controller so it has a very very small error).

As for SOH(state of health), temperature etc I will focus on these later, I am trying to implement SOC, balancing and charging first.

• For LFP, the voltage lookup isn't all that useful : it's a very flat curve around 3.2V. If 3.6V is 100% and 2.5V is 0%, you'll find 3.3V is about 90% and 3.1V is about 10%. Between those ... good luck. Coulomb counting works. May 31, 2021 at 23:38
• @user_1818839 I can measure the voltage up to a mV. I think this should at least be enough to differentiate between 95%, 85% 80% etc so 5% increments. I have collected some data of the voltage of the batteries e,g 3.301 etc. Additionally you are correct in saying that I am treating 3.6V as max voltage and 2.5V is lowest voltage.
– fred
May 31, 2021 at 23:41
• I am open to any suggestions on some algorithm or a method of determining the SOC. I am not trying to find the most complex method just something that atleast gives me something which is somewhat accurate.
– fred
May 31, 2021 at 23:41
• Hi fred! If your batteries are in parallel, you can't discharge them individually. Perhaps I'm missing something obvious? Jun 1, 2021 at 2:54
• Lithiums are not normal batteries. They can burn very intensely if mis-handled in charging or discharging. That's why lithiums need a competent BMS in front of them. If you want to DIY battery management, you can choose a lithium that has an embedded BMS (sits under the positive terminal so it makes the battery slightly taller; it's invisible to you for all practical purposes, so you get to have the fun of BMS design without the risk), or if you want to "run on bare metal", you can select a more docile chemistry such as NiMH. Jun 1, 2021 at 3:10

Since you do not know how much charge is already in each battery you cant actually find the state of charge, how do you overcome this problem?

Fully charge the battery, then 'count coulombs' until voltage shows it is nearly empty. This can be used as a reference for future partial charge and discharge, but may have to be repeated occasionally if the battery isn't normally fully cycled.

Do we even need to find the current going into each one, if they are in parallel would they not just distribute this evenly between them?

If the cells are all the same (part number, age, measured capacity etc.) then they should share the current approximately equally until they reach full charge. If the capacities are not close to equal they should share the current according to their individual capacities.

When an LiFePO4 reaches full charge its current draw decreases (compared to other cells at the same voltage). Since one cell is bound to get there first, the others will then be charging at higher current towards the end. Provided the cells are well matched and the charging current is not too high this shouldn't be a problem.

Note that any excess resistance between the cells will cause some to receive more charging current than others. Therefore they should be connected together with soldered or welded low resistance straps, not put in battery holders.

Voltage look up table... I looked at the data sheet as shown in the link and I cannot find anything like this

That may be because a voltage lookup table is not useful with LiFePO4, because the discharge curve is very flat over most of the cycle.

When I do find this graph, then can I use the look up table for all the batteries, as in are the differences between them negligible enough to use the same graph for all or would I need to produce a different graph for each one?

Once you find that graph you will probably understand why it won't work. The differences between brands may be 'negligible', but so is the voltage change. Here are some example discharge curves at various currents:-

Note the truncated Y scale. At low to moderate current drain the voltage drops very slowly until the battery is nearly empty, and could easily be swamped by current draw variations.

• I just want to clarify about finding the reference point to do coulomb counting. You mention fully charging the battery. I am currently charging the batteries using a synchronous buck which is connected to 5V input. The reason I am doing this is because I can control the inductor current which is basically the current going into the battery and this is 250mA. I assume to find the reference point you would need to do constant voltage charging ? to see when the current falls really low indicating it hit 100% SOC?
– fred
Jun 1, 2021 at 0:49
• this is the charging and discharging of the cell: prnt.sc/13nhilr (y axis is mV and x axis is time it reaches 3.6V and then goes down to around 3.4V due to the ESR and capacitance of the cell. The manufacturer states you should not charge it over 3.6V. I assume that to reach 100% SOC you might go over that?
– fred
Jun 1, 2021 at 0:55
• Looking at the discharge (happens after 3.4V until 2.5V) it is actually not as flat as one might think?
– fred
Jun 1, 2021 at 0:58
• Apologies, for the excess I am just confused as to how to " fully charge" the battery to get a reference point for 100% SOC. Assuming I fully charge it, I now begin to discharge it, how would I know when it reaches 0 SOC and how do I do this before killing the battery ( below 2.5V). These batteries are very sensitive to over and undervolting.
– fred
Jun 1, 2021 at 0:59
• Taking a battery down to 0% charge is sure way to kill it. Your discharge graph is missing important information. What is the time scale? What was the discharge current? 3.6V is actually higher than necessary. 3.5V is plenty, and 3.4V is enough if you don't mind waiting lygte-info.dk/info/BatteryLiFePO4Charging%20UK.html Jun 1, 2021 at 1:32