Feliciano or indman,
What AVR toolchain are you using? Googling shows some old ones like WinAVR and then newer stuff like Microchip Studio. I've never programmed with AVRs. Just PICs and older stuff like 68HC11, etc so it's a bit of a learning curve.
Hardware wise:
On my unit, the 78L05 is dropping out of regulation since U6, the SDB628 boost reg, is only outputting 6.5V (R18/R19 sets it to a nominal 6.6V but tolerances give me a bit less). So the 5V line was fluctuating at around 4.8-4.9V. I temporarily bridged a 100K resistor across R19 which boosted the input voltage to the 78L05 to 7.1V... Then the 5V stabilized. While it didn't make any significant difference to the capacitance readings, I did notice that it effected the battery voltage readout which leads me to believe the firmware I'm using doesn't use the TL431 reference and instead uses the 5V supply as the reference.
I did notice an error on your schematic though: