Implemented hardware module for measuring distance