I'm thinking about making my own laser security system (think mission impossible). So I was thinking I'd use a laser diode to shine a beam across a doorway into a light dependent resistor that's on the high side of a voltage divider and look for that signal to go low and raise an alarm if it does.

So I've done some quick research for parts and I'm surprised at how expensive laser diodes seem to be: Do I really need to use a "laser diode" to satisfy my requirement to shine focused light across say a 3 foot gap, or is there some other component that is cheaper and gets the same effect?

Does my LDR concept on the "receiver" side of the gap make sense or is there a better way? I guess my biggest concern is that it won't respond (resistance won't rise) fast enough when the beam is broken and I'll fail to pick it up as a logic low. If that's the case I imagine what I'll want instead is something like a photo-transistor rather than an LDR.


Hey, yes its possible and relatively easy, a simple red laser from a dollar store will work fine. Here is a great tutorial on how to do that: http://www.youtube.com/watch?v=t0FTzUhdg3w


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.

  • \$\begingroup\$ Disregarding OP's ridiculous manners, Out of interest, you say that "Looking for a 500 Hz signature from the analog signal is a simple task for a microcontroller."Can I ask how I might go about this? I thought that I could: set a timer, look at a threshold level, if the level falls below a value before the timer runs out, trigger event, when the timer runs out, restart the timer. Rinse and repeat. Is this correct? \$\endgroup\$ – Tim Mottram Apr 10 '14 at 16:14
  • \$\begingroup\$ @Tim: I'd do this by taking a reading several times per ms, then convolving those with the square wave. If you know the driving signal, then convolve it with that directly. If not, convolve it with two 500 Hz square waves (in this example) 90 deg out of phase. Note that "convolving" in this case is simply taking the original signal (times 1) or its negative (times -1), so not really a arbitrary convolution. This method can be highly specific to the carrier frequency, thereby eliminating just about all ambient noise. \$\endgroup\$ – Olin Lathrop Apr 10 '14 at 16:18
  • \$\begingroup\$ That's great, I knew there would be a clever way. Thanks Olin. :) \$\endgroup\$ – Tim Mottram Apr 10 '14 at 16:20

You don't need a laser at all, unless you actually want to have a visible beam. If you don't mind it being invisible, then just use an Infrared LED and a matching photodiode.

  • \$\begingroup\$ i think having it be visible adds to the coolness-factor somehow though :) \$\endgroup\$ – vicatcu Mar 20 '11 at 23:54
  • \$\begingroup\$ @vicatcu but a red laser won't be visible (at least not the beam), unless you live in a foggy place :) \$\endgroup\$ – clabacchio Mar 15 '12 at 8:30
  • \$\begingroup\$ @clabacchio true but you can see it when it strikes a surface, and you could create a fog to "reveal" it mission impossible style... \$\endgroup\$ – vicatcu Mar 15 '12 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.