changes to battery sensor function

changes to battery sensor function