Best way to detect an object presence

What im looking for is the simplest and less bulky way of detecting

Less bulky that what?