would you please explain circuit give in following link
https://www.electroschematics.com/6005/ir-beam-breaker/
Just to confirm I am trying to help with something that detects when an IR beam is broken, which is how I understood your question.
My method was to try and get you understanding the most simple IR source and IR detector type circuit, but simplicity comes at a cost!
The simple circuit will be sensitive to stray IR light which can be from an incandescent light bulb or more likely sunlight. This will be much greater than our IR generator power and will swamp our simple detector.
What your link describes is a way to get round this problem. It is not 100% perfect but does work very well and was developed by the TV industry to make TV remote controls work with stray IR.
Basically the IR beam transmitted is pulsed on and off at 38kHz, the received IR is sent to an integrated circuit built into the IR receiver and this tries to look at only IR at 38kHz. It is AC coupled and filtered to look at only the light pulses switching at around 38kHz. This removes the interference from light bulbs and the sun which are only low frequency.
Beam broken is now 'no 38kHz IR received' and beam not broken is a '38kHz IR signal received'.
Other conditions could be detected as the beam broken, e.g. IR transmitter is off, or the IR beam is misaligned, but this could also be considered 'fail safe' if it being used for intruder detection and makes it more 'tamper proof'.
Hope that helps but come back if you have further questions.
- - - Updated - - -
Looking around that web site I found
http://www.electroschematics.com/6239/invisible-alarm/
This is similar to my simple beam break detector, i.e. suffer from stray IR. the detector diode also needs to be an IR one or have a filter to avoid it also detecting daylight!!!