In this work, we use the diffraction properties of gratings (Talbot effect) to obtain a distance measurement through a Fourier transform method. The proposed technique is easy to use and requires low mechanical stability. Furthermore, it is suitable for out-of-laboratory applications and provides real-time (frame refresh) data acquisition capability.