This IR beam break set (about $12 per set on eBay) can be used up to 5m apart.
The individual model numbers are E18-5DNA and E3F-5.
The transmitter side has 2 wires; blue = ground, brown = 6V – 36V DC.
The receiver side has 3 wires; blue = ground, brown = 6V – 36V DC, black = output.
It has an NPN output and pulls to ground when the beam is broken.
This IR reflective sensor (about $6 – $7 on eBay) can be used to detect objects up to 80cm away.
A screwdriver adjustment near the wire entry sets the detection range.
The model number is E18-D80NK.
The unit has 3 wires; blue = ground, brown = 6V – 36V DC, black = output.
It has an NPN output and pulls to ground when an object is detected.
There are other versions of this sensor that have a 10cm, 30cm or 50cm ranges.