Range on IR Object Detectors
Bootsy
Posts: 22
Hello all!
I'm working on building a small, autonomous robot capable of detecting objects. It moves quite quickly, so I'd like it to be able to "see" objects about a meter away, so it can do a graceful turn rather than smashing into it, backing up and trying again : ). However, using the IR LED and Detector setup, I haven't been able to get a range of more than about twenty cm. I've heard of ranges over five feet, how can I achieve that?
Thanks!
I'm working on building a small, autonomous robot capable of detecting objects. It moves quite quickly, so I'd like it to be able to "see" objects about a meter away, so it can do a graceful turn rather than smashing into it, backing up and trying again : ). However, using the IR LED and Detector setup, I haven't been able to get a range of more than about twenty cm. I've heard of ranges over five feet, how can I achieve that?
Thanks!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Don't forget color for IR!
P1
(220 O Resistor)
(IR LED)
VSS
P6
(Detector)
VSS
|
VDD
And here's the code snippet:
I know I don't depict which connection goes to which on the detector, but rest assured that it is connected properly.
With your setup, you should be able to get about 40cm of range.· Remember that your sensors are looking at reflected IR light and a lot of power is lost in the reflection process.· If you had an ideal target (100% reflected IR) you may be able to get substantially more range.
I am assuming that you are using PNA4602 sensors and QEC113 IR LEDs.
Step 1 optimize the frequency.· It is my experience that each IR LED and sensors works best at one frequency.· Do frequency runs for each IR/sensor pair and choose the frequency that gives the maximum reliable range.· This is a time consuming process.· You will notice that the results do not come close to the expected Bell curve that you may be expecting.
Step 2 switch to the BS2SX.· It is a faster chip and does a much better job of reproducing the 38kHz signal which gives slightly improved results.
Step 3 increase the power of IR beam generated.· Using a 220 ohm resistor with the IR LED limits the current to 15 ma.· To get more distance, increase current.· Remember that the BS2 pins cannot generate much more current, so use a transistor to increase drive current.· I like to use MOSFETs for this.· In early experiments, I have driven a QEC113 with about an amp of current and have seen two to three meters detected range.· Just keep the total power low (one reading every 15 or 20 msec works) and the QEC113 will survive.· My test setup with 1 amp drive worked for over a week continuously before I got tired of running it.
One more note, beware of outside IR influence (sun light).· The PNA4602 has built in AGC circuitry that limits sensitivity based on total IR power detected.· When there is a lot of IR, the gain is reduced, so the detected distance is drastically reduced.· Basically, don't run them outside and stay away from windows on bright, sunny days.
·· Rick Brooks
I was hoping I wasn't at max range already. Those are indeed the parts I am using, I think they're the only ones for sale by Parallax. As much as testing each pair's ideal frequency will be time consuming, I'm hopeful it'll work. Just so it doesn't take days, do you have any recommendation as to low and high ends and steps to go up by?
Thanks for the tip about outside light, I'll make sure to limit that. I was careful not to aim at windows or other sources because I assumed it would pick it up as a false signal. I didn't realize there was a gain built in for ambient conditions.
As for inserting a transistor, do you have any recommendations as to part numbers? Also, do I keep a resistor in, or can I chuck it?
Thank you very much for your helpful response.
Let the stamp do most of the work for the freq run.
I normally start out with a range of 36kHz to 42kHz and 100 Hz·steps at about 10 inches distance.· At each frequency, run the freqout ten times (pause about 10 msec between readings) and debug the frequency and number of hits.· You will be looking for tens.· If you get all tens, move the object farther away.· Start limiting the frequency range and reducing length of the steps while moving the object.· After about five or six runs you should be down to 1 Hz steps.··A single (or a few) frequencies normally stand out from the rest.
Presently I'm using IRFD024 FETs for the IR LED drivers.· They are small and mounted directly beside the IR LEDs.· The FET gate can be driven directly from the Stamp pin.· Use a small resistor to limit currect to the IR LED to whatever level you need.· I use a 15 to 30 ohm resistor dirven by an adjustable voltage regulator.· The sensing range is controlled by the voltage from the regulator.
·· Rick Brooks
Post Edited (Rick Brooks) : 2/9/2010 12:53:33 AM GMT