I am trying to precisely measure cell voltage of a LiPo battery using a differential amplifier. The idea is to use an op amp to measure each cell voltage. I need to get a precision of about +-5mV considering that each cell differential voltage goes from 3 to 4.2V max but the input voltages in the op amp are from 25.2v (sixth cell) to 4.2v (first cell). Here is the circuit I am using with a LM324:
The output of the op amp goes to a micro-controller ADC. In this circuit the gain is 1.2 but I know resistors have tolerance so first I have a calibration step where I put a precise know voltage in the inputs of the op amp, I get the output voltage with the ADC and Vout/Vin = G so I get the real gain because of resistances variations.
But now I have a new problem, if I put 8.4V and 4.2V I calculate the gain that gives me for example 1.22. If now I put 9V and 4.2V gain is the same (1.22) but if I elevate or reduce the voltage even more let's say 15V and 10V the output doesn't responds to 1.22 gains, the total gain is now 1.29! I think this offset voltage I am getting (despite 2 to 3mV input offset of LM324) is due to bias current that are increasing as I increment input voltage is my assumption correct? If so, is there any relation between input voltage and offset voltage at the output according to the resistances in the circuit?
If my assumption is wrong, is any other way to reduce this error despite of using a precision amplifier? Because here are very rare and cost 5 times the price of an LM324 :/