If you need to detect some object or movement you can refer to Honeywell devices, there are several model with transmitter and receiver built inside the same package.
Here you can find a example:
**broken link removed**
Using infrared instead visible have advantage about immunity of the receiver against visible ligth.