Different ranges with IR...
JiVeeMaN
Posts: 7
Hello, I'm totally new to this so excuse my incompetence [noparse]:)[/noparse]
I'm trying to learn this with robotics and I'm currently experimenting with IR range detection.
I've got two problems:
1. The range of my IR emitting diods is extremly unequal. One of the diods (I've got two) is emitting IR at a range of approx. 10 CM longer than the other one. This is pretty anoying because my boe-bot keeps turning left all the time (because the right sensor never detects anything, it's too far away)
2. What I understand by the book that comes along is that I should be able to adjust the range at which the detector detects IR by adjusting the frequency... I tried to emit IR with a frequency of 41000 Hz and compared it to 38500 Hz and the difference in detection was like 5 or ten centimeters...
Should it be like this, or is anything wrong?
Answers are very appreciated!
Thanks in advance,
Fredric
I'm trying to learn this with robotics and I'm currently experimenting with IR range detection.
I've got two problems:
1. The range of my IR emitting diods is extremly unequal. One of the diods (I've got two) is emitting IR at a range of approx. 10 CM longer than the other one. This is pretty anoying because my boe-bot keeps turning left all the time (because the right sensor never detects anything, it's too far away)
2. What I understand by the book that comes along is that I should be able to adjust the range at which the detector detects IR by adjusting the frequency... I tried to emit IR with a frequency of 41000 Hz and compared it to 38500 Hz and the difference in detection was like 5 or ten centimeters...
Should it be like this, or is anything wrong?
Answers are very appreciated!
Thanks in advance,
Fredric
Comments
2) If you look at the datasheet for the IR detector (downloadable from Parallax's webstore page for the detector), you'll see that the sensitivity of the detector varies based on frequency and there's a graph of this in the datasheet. The center frequency is 38KHz for the devices that Parallax sells and that's their point of maximum sensitivity.
What could possibly be blocking the LEDs? I've checked that now and nothing was in the way.
2. Sorry if you didn't understand the question, my english is not that good. But I was trying to say that I know about the range differense on different frequencies, but the problem is that there are almost no differense in detection between what should be 5 CM detection and what should be 40...
/Fredric
If the LEDs are very "bright", the IR detector may require a wider range of frequencies to see a significant difference. I'm using a Propeller as the controller and that has helped (from 38KHz to 43KHz for the range).
Well, the problem is that I've tried up to 50000 Hz, and there I'm starting to see any difference (10- 20 cm). But the funny thing is that i also tried 4000 Hz, and that was also detected on 10 cm range, even thought it's a very low value.
When an obstacle comes too close to the led (four centimeters) it gives no response att all, while the other one does... This is so strange, nothing seem to be comprehensable..
Now when I try them again, one of them is maybe detecting obstacle at 30 CM range but maybe not on 25 CM, and maybe at 20 CM. I don't understand this...
Post Edited (JiVeeMaN) : 5/30/2007 11:16:43 PM GMT
Almost every time I have seen this problem, there has been an error in either the circuit or code. However, I did see this happen with one of the Boe-Bot robots at a BASIC Stamp Educators Course last week and verified that both the circuit and code were correct.
Please let me know whether you are using a Boe-Bot, SumoBot, or Scribbler robot, and I will attach some test code for you to try.
If it turns out that your code and circuit are correct and you have a Boe-Bot robot, I would recommend using a larger resistor in series with the IR LED that sees too far.
For example, if the Boe-Bot robot's right IR LED sees an object 20 cm away, while the left sees an object 40 cm away, try doubling the resistance between the I/O pin and the left IR LED. This will make the left infrared "flashlight" dimmer, and the detector will not detect objects so far out. 15 to 20 cm is a good detection distance. Any more than that, and it's hard to tell why the Boe-Bot turns when it's avoiding objects.
Regards, Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
I'm attaching my program code to this post.
But what i also don't understand is that it works when I'm trying a frequency like 3000 or 4000. It shouldn't ? but it works.
The test code is attached.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Does TestIrPairsAndIndicators.bs2 still give you the discrepancy in distance measurements?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Regards,
Fredric
Also, check the resistor color codes. The resistor that connects P8 to the left IR LED anode should be 1 k (brown-black-red). The same resistor value (brown-black-red = 1 k) should be in series between P2 and the right IR LED anode.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Now when they are pretty synchronized and i'm using them to navigate, I've got another problem. When it runs into a 90 degree corner of a wall it starts turning in one direction, but as fast as it turns enough for the other sensor to also "see" the wall, it cannot decide which way to turn so it keeps turning in different directions like crazy! What shell i do?
/ By the way, thank you for all help Andy and Mike, it's really appreciated!
Post Edited (JiVeeMaN) : 5/31/2007 12:18:28 AM GMT
Corners and mazes are pretty doable. I would recommend trying out the various code examples in Robotics with the Boe-Bot (through chapter 8) first.
Also, here is a link to a better circuit for distance detection, and it should also work better for maze navigation: Better Boe-Bot IR Distance Measurements (Circuit + Programs).
This is one of the articles in the Stamps in Class "Mini Projects" thread on the Stamps in Class forum.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 5/31/2007 12:22:11 AM GMT
1) Note which side has the longer range.
2) Swap IR LEDs. Does the same side still have the longer range?
3) Swap IR detectors. Does the same side still have the longer range?
4) Swap series resistors. After what we've gone covered earlier, this shouldn't have any effect. It's still better to make sure.
If the side switched with item 2, one of the IR LEDs is too bright (or maybe the other is too dim). If it switched with item 3, one of the receivers is too sensitive (or the other is not sensitive enough). If it switched with item 4, check the resistors with an ohmmeter and compare the results to the markings. If the side with the long range never switched, one of the BASIC Stamp I/O pins might have a damaged buffer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.