changes to battery sensor function

changes to battery sensor function
Merge branch 'John'