necessary the photoelectric switch according to the present invention is different from the conventional switch in that a pulse width discrimination circuit 8 is provided between the comparator 6 and the detection circuit 7 and an amplifier circuit 4 has a saturation characteristic preventing function as shown in fig2 in the pulse width discrimination circuit 8 a series circuit comprises a delay circuit 81 and a one shot circuit 82 connected to the t input terminal of d type flip flop 84 an inversion circuit 83 is connected between the input terminal of the delay circuit 81 and the d input terminal of the flip flop 84 the q output terminal and the r input terminal of the flip flop 84 are connected to each other as shown in fig2 referring to fig3 ac d showing various waveforms the operation of the pulse width discrimination circuit 8 will be described fig3 a shows the waveform at the output of comparator 6 which is the input of the pulse width discrimination circuit 8 fig3 b shows the waveform at the output of the delay circuit 81 while fig3 c shows the waveform at the output of one shot circuit 82 fig3 d shows the waveform at the output of flip.