RFX is a toroidal machine for the fusion research based on the RFP configuration. During the pulse, in any conductive loop close to the machine very strong currents can be induced, which may damage the diagnostics and the other instrumentation. To avoid loops, the earthing system of the machine is tree-shaped, however an accidental contact between metallic earthed masses of the machine may give rise to an unwanted loop as well. An automatic system for the detection of ground loops in the earthing system has therefore been developed, which works continuously during shutdown intervals and between pulses. In the paper the design of the detection system is presented, together with the experimental results on prototypes.