This is a very simple circuit built using only a few components to detect ac mains power failure and its…