Laser Diode Security System
Moderator note: This answer had arrived to this thread as a result of a merge.


The problem appears to be that you want to detect a person passing between the line of sight of two transducers.  Let's say the aim is to have a digital output indicate the presence or abscence of something interrupting the line of sight.

There are various ways to achieve this.  One important spec is the distance.  Since you mention detecting a person, I'll say you need to span of about 4 feet.  This could be done with a laser on one side and some sort of light sensor on the other.  That light sensor could be a CdS photoresistor, a photodiode, or even a solar cell.  The circuit for each of those is a bit different, but all of them are fairly simple.  I'd probably start with a photodiode in leakage mode.  CdS cells are simple and highly sensitive, but react slowly.  That won't work well with modulation, as I think you will want (see below).

One issue is ambient light.  Good mechanics around the transmitter and receiver, perhaps including optics, can limit the effect of ambient light.  However, it's still a good idea to factor it out.  I would do this by modulating the light beam.  You don't look for a particular light level, but rather the amplitude of the modulated signal.

For example, the light could be sent in pulses 1 ms long every 2 ms, or put another way, a 500 Hz square wave.  The receiver circuit creates a analog signal that does some high pass filtering to eliminate the ambient bias, then presents the result to a microcontroller.  Looking for a 500 Hz signature from the analog signal is a simple task for a microcontroller.  That also allows for some logic to make sure the signal is blocked long enough to be considered a real event, and probably a little hystersis to avoid too much chatter if things are on the edge.

At 4 feet or so, you don't need a laser and you should be able to put the transmitter and receiver on the same side with a passive reflector on the other.  That simplifies the electronics and providing power because everything is integrated into a single unit.  That also allows the micro not only to know the expected frequency, but also the phase, which will make it easier and more reliable to detect the modulated signal.

To not require extra accurate alignment, like a true mirror does, you could use a retroreflector.  Those reflect light mostly back in the direction it came from, at the expense of some overall attenuation.  They are also cheap and available in hardware and automotive stores and the like.

A laser would work, but I'd also look into IR LEDs.  It's not immediately obvious whether LEDs with some optics or a laser is the best alternative, in part because you haven't said what your criteria really are.  The advantage of IR is that people can't see it, so it is easier to hide the fact that a human passing is being detected.