Battery monitoring problem.

If the charger voltage is very dirty, 10nF is far to litte cap. Use 10+ uF.
Ensure a stable reference voltage to arduino.