How to detect the battery pack voltage