A ranging sensor includes: a light emitting element; a projection lens for
projecting light emitted from the light emitting element to an object; a
condenser lens for condensing light reflected from the object; and a
light receiving element, provided at the light condensing position of the
condenser lens, for transmitting an output signal which varies according
to the position of the object by receiving the reflected light at the
light receiving surface thereof, wherein the condenser lens is held by a
holding member so that the condenser lens is movable in a predetermined
direction. Consequently, it becomes possible to easily adjust the output.