Patent ID: 8823682

Claim:
A proximity sensor for detecting whether or not an object to be detected comes close to the proximity sensor, comprising: a light-emitting element for projecting light toward a predetermined space; a light-receiving element for (i) receiving reflected light, which is light obtained when the light projected by the light-emitting element is reflected from the object to be detected and (ii) outputting an electric current signal in accordance with a quantity of the reflected light; storage means for storing state information indicative of a state of the electric current signal; determination means for determining (i) a larger one between the electric current signal and a first threshold and (ii) a larger one between the electric current signal and a second threshold, the second threshold being smaller than the first threshold; state updating means for (i) updating the state information with first information indicating that the electric current signal is not more than the second threshold, when it is determined by the determination means that the electric current signal is not more than the second threshold, (ii) updating the state information with second information indicating that the electric current signal is more than the second threshold, when (a) it is determined by the determination means that the electric current signal is more than the second threshold and (b) the state information is the first information, (iii) updating the state information with third information indicating that the electric current signal is not less than the first threshold, when it is determined by the determination means that the electric current signal is not less than the first threshold, and (iv) updating the state information with fourth information indicating that the electric current signal is less than the first threshold, when (a) it is determined by the determination means that the electric current signal is less than the first threshold and (b) the state information is the third information; and controlling means for (i) supplying, to an outside of the proximity sensor, a signal indicating that the object to be detected does not come close to the proximity sensor, in a case where the state information is updated with the first information or the fourth information and (ii) supplying, to the outside of the proximity sensor, a signal for indicating that the object to be detected comes close to the proximity sensor, in a case where the state information is updated with the second information or the third information.