A UPS (Uninterruptible Power Supply) is an electrical device that provides backup power to connected loads…