added heartbeat timer to the charge phase to check if the battery has reached 100%