In view of the problem that existing on-off sensors are easy to falsely judge in strong electromagnetic field environment to cause inaccurate monitoring, a type of on-off sensor was designed using magnetic induction principle and high anti-interference technology, hardware architecture and software design of the sensor were introduced, and design principle of anti-interference of the sensor was introduced emphatically, namely following on-off conditions are set for the sensor: when the on-off sensor is powered on, its initial state is off, and when sampled value of the sensor is greater than a certain value of on judgment line in several times, the sensor determines the electromechanical equipment is on. When the on-off sensor is in on state and sampled value is less than a certain value of off judgment line, the sensor judges the electromechanical equipment is off. The results of experiment and application showed that the strong anti-interference design avoids problems of repeated on-off and incorrect judgment of on-off sensors caused by transient strong electromagnetic interference.