Shop OBEX P1 Docs P2 Docs Learn Events
Modulated IR Beam Break — Parallax Forums

Modulated IR Beam Break

varnonvarnon Posts: 184
edited 2014-03-20 19:32 in Accessories
Hello all,

I've been pondering using a modulated IR beam in one of my projects, but I have a few questions and I thought somebody here might have some good answers/ideas. You may recall that my projects are mostly involved with recording animal behavior and providing consequences for their behavior (mostly food). IR beams are a great response device that I often use. It is easy to record an animal's behavior when they break and IR beam. Usually I set these up so when the animal breaks an IR beam a propeller pin goes high. Most of these projects are done in controlled settings indoors, but I have a few that are outdoors in natural lighting. I was considering using a modulated IR beam as I thought it might make the device less sensitive natural lighting, but I'm having a little trouble wrapping my head around it.

I am considering using an IR LED turning on at off at a frequency of 38kHz as the emitting end of the beam. With free pins and cogs, I will probably do this in software instead of with a 555 timer. (Typically I see modulated IR kits using typical through-hole IR LEDS, but is there any reason I can't use side lookers? They work great for my other projects.) On the receiving end of the beam, I am considering using a dedicated 38kHz IR receiver, like the one offered by Parallax. Sound good so far?

I would expect that if the receiver can see the 38kHz IR beam, current will flow. If an animal blocks the 38kHz IR beam, current will not flow. However, what happens if the receiver is in sunlight as it may cause some IR interference? If the 38kHz beam is unbroken, but the receiver is in direct sunlight, will current flow from the receiver? If an animal breaks the 38kHz beam, but the receiver is in direct sunlight, will current flow from the receiver? Would using a modulated IR beam really help me in this situation? It isn't to difficult to ensure that the device isn't in direct sunlight, but I like the idea of making it more resistant to outdoor conditions, especially when giving a device to someone else to use.

Any thoughts? It would be pretty cheap to try, so I might just pick up one of the receivers on my next order and test it out.

Thanks.

Comments

  • ercoerco Posts: 20,256
    edited 2014-01-03 17:44
    Few IR receivers will receive a continuous IR signal. One of the better ones is the fixed-gain Vishay TSOP4038.

    See http://www.robotroom.com/PNA4602M-Replacement-1.html and http://www.vishay.com/company/press/releases/2010/100628irsensors/
  • kwinnkwinn Posts: 8,697
    edited 2014-01-03 18:18
    varnon wrote: »
    Hello all,

    I've been pondering using a modulated IR beam in one of my projects, but I have a few questions and I thought somebody here might have some good answers/ideas. You may recall that my projects are mostly involved with recording animal behavior and providing consequences for their behavior (mostly food). IR beams are a great response device that I often use. It is easy to record an animal's behavior when they break and IR beam. Usually I set these up so when the animal breaks an IR beam a propeller pin goes high. Most of these projects are done in controlled settings indoors, but I have a few that are outdoors in natural lighting. I was considering using a modulated IR beam as I thought it might make the device less sensitive natural lighting, but I'm having a little trouble wrapping my head around it.

    I am considering using an IR LED turning on at off at a frequency of 38kHz as the emitting end of the beam. With free pins and cogs, I will probably do this in software instead of with a 555 timer. (Typically I see modulated IR kits using typical through-hole IR LEDS, but is there any reason I can't use side lookers? They work great for my other projects.) On the receiving end of the beam, I am considering using a dedicated 38kHz IR receiver, like the one offered by Parallax. Sound good so far?

    I would expect that if the receiver can see the 38kHz IR beam, current will flow. If an animal blocks the 38kHz IR beam, current will not flow. However, what happens if the receiver is in sunlight as it may cause some IR interference? If the 38kHz beam is unbroken, but the receiver is in direct sunlight, will current flow from the receiver? If an animal breaks the 38kHz beam, but the receiver is in direct sunlight, will current flow from the receiver? Would using a modulated IR beam really help me in this situation? It isn't to difficult to ensure that the device isn't in direct sunlight, but I like the idea of making it more resistant to outdoor conditions, especially when giving a device to someone else to use.

    Any thoughts? It would be pretty cheap to try, so I might just pick up one of the receivers on my next order and test it out.

    Thanks.

    Direct sunlight would probably swamp the receiver. You will need to put some sort of shroud on the receiver to avoid that.

    You might even consider using one of the serial objects at a low baud rate to send data over the beam instead of the 38KHz.
  • ercoerco Posts: 20,256
    edited 2014-01-03 21:04
    +1. Direct sunlight will swap most any IR system.

    38 kHz is the carrier (required) to use these receiver modules, although 56 kHz is a rarer alternative. You could modulate the carrier to send low baud rate data, which is petty much what IR remote control codes like SIRC are.
  • varnonvarnon Posts: 184
    edited 2014-01-10 14:27
    Okay, so direct sunlight is still an issue. I get that, and I get that the receivers still need to be protected from other sources of IR light. But would I get any benefit form using a modulated IR system if all I need is the beam break? Are direct and indirect sunlight still going to cause the same issues? I guess I don't completely comprehend the use of a modulated IR beam break if it isn't more robust to interference. I have seen so many tutorials for modulated IR beam break systems, but the benefit over a continuous on IR beam eludes me. Modulated IR beams make more sense to me when used for data transmission (like remotes). My apologizes if I am being dense, I feel like there is one super obvious thing I am just not getting.

    Thanks for the responses.
    Kwinn, I dig your signature. I only wish all scientists really acted that way.
  • Mike GreenMike Green Posts: 23,101
    edited 2014-01-10 15:04
    Outside the main problem is the intensity of the IR output of the sun and its reflections vs. the IR beam from the LED. There are few if any sources of modulated IR. At night, particularly outside, there are few sources of IR ... some street lights, automobile headlights, etc. ... They're not modulated.

    Inside there may be many sources of modulated and unmodulated IR, but most of them are of similar intensity.

    You would like to find ways to differentiate your sources of IR from others.
  • languerlanguer Posts: 6
    edited 2014-01-10 15:24
    A simple implementation is shown here (http://www.electro-tech-online.com/blog-entries/ir-beam-break-test-bed.156/). The modulation provides robustness against false positives. If the receiver is swamped with light which falls in its wavelength, the you just won't receive anything. These devices do work outdoors and some work quite well. The sun unfortunatley is an excellent source of light (it has pretty much every wavelength); but some of this receivers are quite directional, so if you can avoid the sun shining directly on their sensor area (by means of location, shroud, etc) they should work. Best way is to actually try them. The ones shown in the link above were later used to mimic a Nerf tagger and they worked quite well outside in broad daylight.
  • ercoerco Posts: 20,256
    edited 2014-01-10 17:35
    Don't confuse an unmodulated carrier with a steady, unmodulated IR source.

    Most IR LEDs are ~940 nm wavelength. Mostly invisible output, some might have a faint LED glow. You can apply steady voltage/current to it and get a steady signal output. This signal is indistinguishable from any other steady DC signal like sunlight, or light from lightbulbs, car headlights, etc. Detectable by intensity only, using a phototransistor or such, requiring amplifier and extra circuitry.

    If you pulse that LED at a steady 38 kHz carrier frequency, that pulsing (but unmodulated) signal can be distinguished from most background DC signals (sunlight, etc, unless swamped) using a few special "continuous signal compatible" IR receiver modules, such as the TSOP4038 mentioned above. These 3-pin modules are cheap (~$1) and have all sorts of built-in circuitry: amplifiers, filters, and can be hooked to a micro with no additional circuitry.

    Now modulate that 38 kHz carrier with Morse code like bit patterns and you have Sony IR codes or low baud rate data. Most IR receiver modules can be used to receive these types of signals. Again, these 3-pin modules are cheap (~$1) and have all sorts of built-in circuitry: amplifiers, filters, and can be hooked to a micro with no additional circuitry. But these "non-continuous signal compatible" IR receiver modules cannot detect the simple, steady 38 kHz carrier signal from the previous paragraph. Most are "active low" devices; their output goes low for a half-second in the presence of a steady carrier signal.

    And no 3-pin IR receiver module can detect an unmodulated (no 37 kHz carrier) DC signal.

    My favorite 556 IR beacon circuit is the simplest source of a 38 kHz carrier signal, shown at http://forums.parallax.com/showthread.php/142583-IR-Beacon-Tracking?p=1129122&viewfull=1#post1129122
  • al1970al1970 Posts: 64
    edited 2014-01-13 22:54
    I don't know if this will help you with the why of it. You don't want to overload the input of an amp. Think of the Sun as a DC voltage when it hits the light receiver. Use a capacitor in front of an amp and that will block out the DC voltage but since the LED has a AC freq (38K HZ) it will pass thru the cap into the amp.

    Al





    varnon wrote: »
    Hello all,

    I've been pondering using a modulated IR beam in one of my projects, but I have a few questions and I thought somebody here might have some good answers/ideas. You may recall that my projects are mostly involved with recording animal behavior and providing consequences for their behavior (mostly food). IR beams are a great response device that I often use. It is easy to record an animal's behavior when they break and IR beam. Usually I set these up so when the animal breaks an IR beam a propeller pin goes high. Most of these projects are done in controlled settings indoors, but I have a few that are outdoors in natural lighting. I was considering using a modulated IR beam as I thought it might make the device less sensitive natural lighting, but I'm having a little trouble wrapping my head around it.

    I am considering using an IR LED turning on at off at a frequency of 38kHz as the emitting end of the beam. With free pins and cogs, I will probably do this in software instead of with a 555 timer. (Typically I see modulated IR kits using typical through-hole IR LEDS, but is there any reason I can't use side lookers? They work great for my other projects.) On the receiving end of the beam, I am considering using a dedicated 38kHz IR receiver, like the one offered by Parallax. Sound good so far?

    I would expect that if the receiver can see the 38kHz IR beam, current will flow. If an animal blocks the 38kHz IR beam, current will not flow. However, what happens if the receiver is in sunlight as it may cause some IR interference? If the 38kHz beam is unbroken, but the receiver is in direct sunlight, will current flow from the receiver? If an animal breaks the 38kHz beam, but the receiver is in direct sunlight, will current flow from the receiver? Would using a modulated IR beam really help me in this situation? It isn't to difficult to ensure that the device isn't in direct sunlight, but I like the idea of making it more resistant to outdoor conditions, especially when giving a device to someone else to use.

    Any thoughts? It would be pretty cheap to try, so I might just pick up one of the receivers on my next order and test it out.

    Thanks.
  • varnonvarnon Posts: 184
    edited 2014-03-20 19:32
    A delayed update:

    Based on the comments I wasn't sure if a modulated IR beam would be that helpful for me. In terms of signal detection theory, I imagined that swapping an IR beam for a modulated IR beam might only change the proportion of hits, misses, false alarms and correct rejections but overall leave me with the same ratio of correct vs incorrect. However, I finally got around to putting some things together for testing, and the modulated IR beams work great for what I want.

    I used the IR kit Parallax offers and generated a 39kHz signal on the IR LED with a counter. My standard input detection code uses a 25 ms debounce. I cannot get the beam to fail. The beam works well even in strong sunlight with the IR decoder pointed directly at the sun. I am actually really impressed. There is still potentially an issue of modulated IR signals from other devices, but I am not too worried about that as the decoders will be mounted and shrouded to an extent. Overall I am happy with this set up and it seems to be very useful for my needs.

    Thanks for all the comments.
Sign In or Register to comment.