Compact photoelectric sensor with infrared light, background suppression, and adjustable sensing range.