If you need a sensor with both a good range and accuracy, this laser rangefinder is worth a look. It gives you a measurement accuracy of ±2mm within an impressive range of 10m, and can sense out to 40m if needed with an accuracy given by the formula ±2 + 0.05 * (D-10). Here, D is the distance in meters. It’s setup to either give you a single measurement, or it can produce a continuous measurement that could be used in a scanning application.
Data is output via a serial interface, so it can pipe this data to your favorite microcontroller without worrying about analog signals and the like. Check out the demonstration below where a microcontroller and touch screen are used, as well as an example with a computer interface.
Of course, in engineering you often have to balance 3 variables. This sensor has good accuracy and excellent range, but at around $100 the price variable isn’t as low as some other types of sensors that can be had for a few dollars or even cents. However, for this class of sensor it looks like a very good value, and may open up sensing possibilities that you haven’t yet considered!