A power supply is an electrical device that provides a specific type and amount of power to an electrical circuit. It is used to convert one type of electrical energy into another type. It is also used to regulate and condition the output power from other sources, such as solar panels or electric batteries. The most common type of power supply is a switched-mode power supply (SMPS), which converts alternating current (AC) to direct current (DC). A power supply is used to regulate the voltage and current provided to a device, which helps maintain proper operation and protect it from damage due to overloads or power spikes.