Smart Battery Management for Enhanced Safety