This paper presents the development of an optical rangefinder based on self-mixing interferometry. The instrument measures the absolute distance from a remote target, without contact and respecting the Class I safety. A variation of the laser diode bias current origins a modulation of the wavelength and then, due to the phase shift along the channel path, the presence of a target generates interferometric fringes. The electrical frequency of the fringes signal is proportional to the target distance. The realized device consists in analog and digital circuits. The analog circuits drive the laser diode, detect the interferometric signal and filter it. A Digital Signal Processor is needed to acquire the fringes signal and, by extracting its frequency, evaluate the absolute distance. The developed rangefinder allows spatial resolution better than 100 µm over a range from 5 cm to 2 m.