Detection of lithium battery