IR beam sensor
IR beam sensor is what the typical IR motion sensors that you would imagine to look like. The theory behind how they works are simple as well. The sensor is consisted of a IR emitter and receiver. The emitter side sends out a beam of human-invisible IR light, and the receiver across the way is sensitive to that same light. When something passes between the two, and its not transparent to IR, then the 'beam is broken' and the receiver will let you know.
The design graph of the beam sensor:
You can see that the receiver has three cables while the emitter has two cables connected only. The extra cable of the receiver is the output wire, which allows signals transmitted to the GPIO. A load (components with resistance such as resistor or LED) is required for drawing current between the sensor and the GPIO.