Best way to detect an object presence

What about an infra-red break-beam sensor - just an IR LED on one side and a photo-transistor on the other side.

...R