device according to the present invention is formed as described above when the stage 30 is placed in a fixed position and the light sources 16 and 17 are made to alternately emit a light by the light source driving means 46 in an out of focus state a signal of a fixed amplitude for example as shown in fig1 a will be put out of the dividing means 43 here the amplitude of this signal becomes a criterion of the deviation from the in focus state and means that if the amplitude 0 an in focus state will be made therefore if the stage 30 is moved little by little along the optical axis the output signal of the dividing means 43 will vary to be such signal as in shown in fig1 b or 12c if this signal is rectified and smoothed by the rectifying means 47 it will vary to be such signal as is shown in fig1 d or 12e therefore if this is differentiated by the differentiating means 48 the inclination of the envelope of the signal variation will be obtained if this inclination is negative the in focus state will be being approached but if it is positive the in focus state will be being separated therefore whether it is positive or negative is judged by the comparator if a reversely rotating signal in case the inclination is positive and a normally rotating signal in case it is negative are respectively applied to the lens driving means 45 the stage 30 will be moved toward the in focus state when the amplitude 0 if the movement of the stage 30 is stopped the in focus state will be obtained the.