A device to improve the safety of neuronal, heart, muscle and organ electrical stimulation devices during MRI scanning. The device consists of means to open and/or closing the circuit to the electrical stimulation device and to the battery pack, while, concomitantly, closing and/or opening another circuit to a dedicated path that dissipates the stored energy induced by the radiofrequency used in imaging MRI.