for detecting the presence of an object