Best way to detect an object presence

Switches work well.