They should match to do the trick, but close enough wave lengths work...
You can make this circuit a very good sensor if you want to place so personal effort in it...
You can avoid ambient light from being detected with a modulation trick...
For this the only thing you want to add is a high pass filter on the output of the detector
right BEFORE the op amp and of course generate a modulating signal at the output of the
emitter led...
With this method, you are gonna have a sensor like TSOP17 series and so...
using and being able to program tiny microcontrollers like ATtiny13 will do the trick for sure....
they will help you debug the circuit and place a digital output....
The only thing that really halts myself from doing that is the existence of premade ICs for that...
Like the one I wrote above...
Best Regards,
Lefteris
Greece