Modulated IR Beam Break
varnon
Posts: 184
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.
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
See http://www.robotroom.com/PNA4602M-Replacement-1.html and http://www.vishay.com/company/press/releases/2010/100628irsensors/
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.
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.
Thanks for the responses.
Kwinn, I dig your signature. I only wish all scientists really acted that way.
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.
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
Al
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.