Medical apparatus includes an electrical power supply, which is configured for connection to an electrical medical device that is coupled to a body of a patient. In one embodiment, the apparatus includes alternating current (AC) lines that include a ground line. A switch is coupled to connect and disconnect the AC lines from an AC power source. A current sensor is coupled to sense a current flowing in the ground line and to actuate the switch to disconnect the AC lines when the current exceeds a predetermined threshold. In another embodiment, a plurality of electrocardiogram (ECG) leads, including a common lead, are coupled to the body of the patient. An auxiliary current sensor is coupled to monitor a current flowing through the common lead and to actuate the switch to disconnect the power connection when the current exceeds a predetermined limit.