How to measure whether the battery is low on power