but i do not know the meaning of switching output. will it give me distance of the object linearly or it will just turn on after a certain fixed distance.
The language of the data sheet is confusing but it is reasonably clear that those sensors do not measure distance. They merely switch if an object is within detection range.
i want sense a object max. 4m away and find its distance from the sensor .
LASER "tape measures" use triangulation. I don't know exactly how they are constructed, but imagine you and your friend are standing a known distance apart holding flashlights, and imagine that the flashlights are angled so that the beams criss-cross. If you know distance between the two flashlights and the angle, you can calculate the distance at which the beams come together.
You cannot use the speed of light for short distances... If I've done my quick-and-dirty calculations correctly (and I might have made a mistake) light travels about 12 miles during the time of one Arduino clock cycle! ...Like I said my calculations might be off, but as far as the Arduino is concerned light will travel 4m, and back, in "zero time" (less than one clock cycle).
varangupta:
Is there any other laser distance sensor that i can purchase that will give me linear variation with distancce?
Maybe look here but not cheap. I have circuit and code on here somewhere that is probably about 80% to a DIY range finder though I never built the laser part, just the high speed timer & pulse. The stumbling block for me was a lens system to focus/detect the laser dot.