This document describes an automatic power supply system that can select the power source for a load from four different options (mains, generator, inverter, solar) using a PIC microcontroller. The system includes relays connected to each power source that are controlled by the microcontroller. If one source fails, the microcontroller automatically switches the relay to provide power from another source, ensuring uninterrupted power to the load. The design aims to provide reliable backup power for applications like industries and hospitals that require continuous electricity.