First, you may try this circuit. The detector section consists of two IR LEDs, and two photodiode/phototransistors. The movement of objects including the direction of their movement is detected by the arrangement of the IR LED and photodiode detector pairs. The photodiode of each pair is mounted opposite to its corresponding IR LED fall directly on the photodiode detector.
In practice it’s very important how to position the LEDs and phototransistors in order to obtain the best results.
A more complicated circuit presented on the second picture. Here we use additional comparators to obtain a more sensitive circuit and the possibility to control the trigger level.