Battery impedance detection circuit