An optical displacement sensor using a triangular distance measuring method, which comprises: an imager having multiple pixel blocks, each of the pixel blocks including a group of pixels to receive light from an object, a light receiving level upper limit value specifying unit to specify a light receiving level upper limit for all of the pixels and multiple comparators to compare the specified upper limit value with the light receiving level of each pixel during exposure, the imager further including a logic circuit to logically add an output of each of the comparators, the imager being operable to stop exposure of all of the pixels in accordance with a result of calculation of the logical add; an exposure time measuring unit in the imager to measure an exposure time from a start of exposure to stopping of the exposure; a measurement distance calculating unit to calculate a measurement distance to the object on the basis of a displacement of a light receiving position in the imager; a data output/storage unit to output and/or store, in a condition in which the measured exposure time and the measurement distance calculated with this exposure time are associated with each other; and a distance actual value measuring unit to measure a distance actual value which is an actual distance to the object, on the basis of the data outputted and/or stored by the data output/storage unit; the distance actual value measuring unit being operable to measure the distance actual value by invalidating the calculated measurement distance corresponding to such measured exposure time in the event that the measured exposure time, when compared with the previous value to calculate a difference, is higher than a specified value, but by enabling the calculated measurement distance corresponding to the previous exposure time. an imager having multiple pixel blocks, each of the pixel blocks including a group of pixels to receive light from an object, a light receiving level upper limit value specifying unit to specify a light receiving level upper limit for all of the pixels and multiple comparators to compare the specified upper limit value with the light receiving level of each pixel during exposure, the imager further including a logic circuit to logically add an output of each of the comparators, the imager being operable to stop exposure of all of the pixels in accordance with a result of calculation of the logical add; an exposure time measuring unit in the imager to measure an exposure time from a start of exposure to stopping of the exposure; a measurement distance calculating unit to calculate a measurement distance to the object on the basis of a displacement of a light receiving position in the imager; a data output/storage unit to output and/or store, in a condition in which the measured exposure time and the measurement distance calculated with this exposure time are associated with each other; and a distance actual value measuring unit to measure a distance actual value which is an actual distance to the object, on the basis of the data outputted and/or stored by the data output/storage unit; the distance actual value measuring unit being operable to measure the distance actual value by invalidating the calculated measurement distance corresponding to such measured exposure time in the event that the measured exposure time, when compared with the previous value to calculate a difference, is higher than a specified value, but by enabling the calculated measurement distance corresponding to the previous exposure time.