photodiode microcontroller
OP was talking beam break detector, those are other types..
For beam break you just modulate IR LED on one side, when receiver doesn't see it something is in the beam. Easily can do 20 meters. Not a good alarm since it's easy to defeat, but fine for people counting or detecting. Used on a lot of garage doors near the floor as an object sensor, break the beam while the door is going down and it goes back up.
Radio Shack used to have one for a long time for a door chime/alarm that had a sensor and IR sender in the same unit, and just a reflector for across the room on the other side to bounce the beam back. Most Radio Shacks had one set up at the front door for years. Never sold well and they dumped them a few years ago, now most of their door sensors are just the magnetic type.