Sensing a contact between two point

Put an light beam down each line at the surface level.

For a beam generator, use an LED that shines through 2 collimated holes, each the approximate size of the diameter of the object. You'll need two of these, one for each line Use 2 photo transistors at the other end of each line behind a screen to detect the beams. The screen will have the same holes as the collimator. Laser LEDs would work best. See the attached drawing.

detector.JPG