Magnetic contact detectors