Measuring the voltage of a working and damaged lithium battery