One of the most common causes of a pump randomly shutting off is incorrect voltages. The pump requires a motor to function, and that motor requires electricity. According to Inyo Pools, most pool pump motors are designed to run off 115v or 230v. The pool may be wired to the incorrect voltage if it randomly shuts off every few seconds after turning it on. Consult an electrician to inspect the pump immediately, especially if you are unfamiliar with pool pump wiring.
The pump uses a spinning impeller to suck water through the pool's filters. The impeller can get stuck, which will cause the motor to hum loudly and then potentially shut itself off. Any sort of debris may get wedged in the impeller, hindering its movement, like leaves, rocks or even articles of clothing or animals like birds that may have fallen into the pool. You will need to open up your motor and remove anything that may be obstructing the impeller.
Capacitors regulate the amount of electricity going to the motor, which operates the pump. A blown capacitor cannot properly regulate the power, which could cause your pump to suddenly shut off. Hire a professional electrician who specializes in pools to inspect the motor's capacitors to see if they need replacement.
A pump that is running but not actually moving any water may need to be primed. A lack of flowing water can give the illusion that the pump has shut off. Priming is when water is allowed to flow through the pump and the pool's filters. Numerous reasons account for why the water is not reaching the pumps, most notably caused by a drop in the water level. Ensure that the plumbing leading into your pool has not been clogged so that freshwater cannot enter, and verify that the filter is clean. A dirty filter may not allow water to pass through efficiently.
Many pool systems may be designed to shut off automatically if they begin to overheat. The mechanisms that perform this task are known as thermal overload switches. The pump may also shut off if there is not enough power to go to the motor. A local power drop from your power supplier can cause the pump to suddenly shut off. Power drops may be common on very hot days when many of the people in your area are running their air conditioners at full blast.