# Confusion about LiPo charging/capacity monitoring with micro-controller

I have a LP601730 3.7V 250mAh battery and ATMEGA328 micro-controller. These are the specs for the battery:

 Normal capacity:              260mAh (0.2C discharge)
Minimum capacity:             250mAh (0.2C discharge)
Charging voltage:             4.2V
Standart charge:              Method: CC/CV
Current: 0.5C
Voltage: 4.2V
End current: 0.02C

Maximum charge current:       250mAh
Maximum discharge current:    500mAh
End of discharge voltage:     2.75V


I'm new to electronics and normally if I have an 1amp power supply, the component that is connected to it will 'eat up' only the amount of amps it requires and I have to only worry about providing correct amount of voltage to the component, but as far as I understood, this is not the case for the batteries, correct?

1. If I understood correctly, I have to provide 4.2V and 130mA based on C rating of 0.5 or maximum of 250mA, correct? if I connect it to 1AMP power supply, will it:

1.1 - Charge 4x faster
1.2 - Blow up
1.3   Eat only the 250mA it requires?

2. I want to use ATMEGA's ADC to measure the capacity while the circuit is discharging. As far as I understood, for LiPo batteries I can only detect 'rough' estimate, ether it's full / mid / low based on this diagram if I take voltage as the indicator:

How would I measure current to detect capacity in greater detail without using any special components?

1. When charging the battery, it seems I can't use the voltage as an indicator to tell when the battery is charged, since it seems it stays constant as in this picture, correct? Also, I see that in the picture the voltage starts off at 2V, does this mean after I connect the battery to 4.2V, the voltage will drop to 2V 'automatically' and then take off to 4.2 or do I have to control this voltage with micro-controller from 2V to 4.2V?

Same question for the current, as far as I understood, the more the battery is charged, the less current is going to go through and this current drop is 'set' by the battery, correct?

1. ... will it:

Rechargeable (but really, all) batteries have a limit as to how quickly their chemical reactions happen. Any energy that isn't used in the reaction turns into heat, so putting in more current than possible could result in permanent damage.

1. ... without using any special components?

You need to measure the voltage difference across a shunt resistor. Since this voltage is very small, you will also need to amplify the difference so that it can be measured with any precision.

The ATmega328 can do neither differential measurement nor does it have any gain, therefore you will either need to use something like the INA250 in order to perform coulomb counting, or you will need to switch to an AVR that can do both (and find a suitable shunt resistor).

1. [charging]

You can use voltage to detect the end state for charge, but you need to switch the charging circuit off so that you can measure it unimpeded. The 2V start point is arbitrary; it is simply used to show how the charging curve may look.

The charging circuit must control the voltage and current; the battery will always take what it can and turn what it can't into heat. You may also want to consider adding temperature sensing so that you don't try to charge the battery when it is too hot or too cold (cold can slow chemical reactions, causing heat damage to the battery).

• Thank you very much for explaining. Regarding #1, to be clear, if I will put the battery on 1AMP 4.2V, it will end bad, because battery won't draw 250mA, it will draw 1A and overheat, correct? – 0x29a Oct 28 '16 at 0:33
• It may not draw the full amp, but whatever it does draw but doesn't use will go towards damaging it. – Ignacio Vazquez-Abrams Oct 28 '16 at 1:05