In one of my project i need to measure distance. Iam aware of ultrasonic & IR range finders available in the market, I want to know which one is best suitable for my application.
I fear, that none of the suggested solutions works at 5 m distance. In principle, you can measure distance by triangulation
with high accuracy, but unfortunately, you need a large base distance.
Unfortunately too, you didn't tell a word about resolution and accuracy. For higher accuracy, laser time-of-flight and possibly
optical FMCW techniques are the only promising candidates, I think.
Yes,
a good focused and pulsed VCSEL & in slight angle mounted position sensitive line-detector (i.e. a longly, 4 contact LDR) and quotient calculating anologe, event. digitalized, electronics....
K.
Heterodyne modulated light source/phase shift method will work well over that distance. It can be done with LEDs or laser. Ultrasonics will work (you can buy ultrasonic tape measures that do just that). Laser time of flight is tricky for short distances due to the electrical disturbance caused by firing the laser.