I need a sensor to measure the distance between itself and an object (which is my finger). What is a good sensor that can accurately measure such distance within about less than half a meter?
I think it would be an infrared sensor or an ultrasonic sensor.
Also I need it to sweep as much horizontal distance as possible. I need to stack them beside each other to cover a plane.
Edit: The horizontal distance is about 30 cm. Also note that it shouldn't be too expensive and the quality needed can be "not so perfect" it's okay. Assume it's for an experiment.
My question is mainly about what type of sensor should I look for
...if a finger is too small for most sensors, then it's okay to replace it with a bigger object so that the sensor can detect it.