Electronic battery sensor