Receiver for optical barrier

Thread Starter


Joined Jun 19, 2020
Hi, I am working on a problem with detecting a reflected IR signal. I have a TX IR LED that sends light at 32 kHz frequency. If something is in front of the diode (reflectimg surface), some light bounces back. Next to the TX LED, I have an RX LED to catch this bounced light. I want to catch this light and change it back to the original signal (just need a signal from 0 to 3.3V and the same frequency as the TX IR LED). But, I also need it to work well when there is other IR light around, like from the sun or a lamp. Right now, it works, but if the sun comes out or I turn on a lamp, it stops working right. Any ideas on how to make it better? I thought about adding a capacitor with the RX LED, but then it doesn't catch the signal as well.
Shchematic is enclosed.

Thank you very much. Jan.



Joined Jan 29, 2010
Hi NN,
This is the 'slicer' method I use, R3 and C1 set the OPA input DC level according to the ambient IR, Sun etc.
It has worked well for many years outside over a range 6 mtrs.

I suggest you try to incorporate this method in your OPA design




Joined Jan 23, 2018
A very useful scheme for detecting an IR beam break at quite a distance was used in a Radio Shack brand security alarm system over 30 years ago. IT used a stereo decoder IC to both generate the frequency and then detect the reflected signal. The "STEREO" output was used to indicate the beam was unbroken.
Last edited:


Joined Jan 23, 2018

This approach gives high sensitivity and high rejection of. Noise (including sunlight).

View attachment 318138
The incoming signal must be synchronous with the 1 kHz pulse into the demodulator. It should work fine at 32 kHz for square waves.
That circuit will work out very well if the same square wave is used to control the IR beam generation. THAT is exactly what was done in the Radio Shack photo-electric beam-break security system package. An added advantage is that it is very close to hacker-proof, in that a separate beam would need to be perfectly synchronized to work.


Joined Aug 21, 2008


A problem with a simple square wave is that it will respond to signals (sub harmonics generally) that have frequency components that are the same as the demodulating square wave. A digital pseudo noise generator will reduce that problem greatly.


Joined Jan 23, 2018
Will that be a problem if the source/detector is a PLL IC like the stereo decoder IC used in the Radio Shack photo alarm many years back??