An active sensor that emits a directional beam of visible or infrared light and then detects if the beam has been blocked by an object moving across its path. Some sensors work by having another photodetector at the other end of the beam, which detects when the beam is blocked. Others have the photodetector as part of the main unit and rely on reflections of the beam, either from a mirror at the other end or from the object crossing the beam.