This paper presents a distance sensor known as a rangefinder. This sensor measures the distances from a robot to obstacles based on the triangulation principle. This principle is widely used in photography and in other areas. For mobile robot applications, the rangefinder is designed to minimize the cost and the interference from external illumination in order to obtain a sufficiently large measurement distance. The light beam is generated with a small lamp and a lens. This light beam is reflected with a rotating mirror and scans the surrounding space. Obstacles reflect the light beam to the second mirror and the second mirror reflects it to the second lens. Then the focused light beam arrives at the line of optical sensors. A special electronic device gives the time of arrival of the light beam. This time is transformed to binary code for the computer. The computer transforms the binary code to the distance using the geometrical features of the rangefinder. The rangefinder with 10 optical sensors will make approximately 1,000 measurements per second. In this article the scheme of the rangefinder is described. The main parameters of the rangefinder prototype are presented.