PURPOSE: To increase the accuracy of a proximity switch by storing the count value of a counter which is outputted when no metal exists around a detection coil, and deciding the presence of a metal when the detected count value is smaller than the stored count value by an amount larger than a prescribed level at the time of using the proximity switch.
CONSTITUTION: A counter 11 counts previously the output pulse number 3a of a comparator 3 at the time of adjusting a proximity switch in a state where the metal to be detected within a magnetic flux produced by a detection coil L. The count value M of the pulse 3a is written into a memory 15 via a writing means 13. Then the value M written into the memory 15 is loaded to a count value deciding means 12A by a reading means 14 at the time of using the proximity switch. The means 12A compares the value A of the counter 11 that counted the number of pulses 3a with the threshold value (M-α) obtained by subtracting the prescribed value from the value M to decide the absence of a metal with A≥M-α and the presence of a metal with A<M-α respectively. Thus a proximity switch of high accuracy is obtained.