Boe-Bot Chapter 7: Navigating with Infrared Headlights
I think there is a problem with my IR LEDs that came with my Boe-Bot.· I have verified that my circuit matches the diagrams included in the text.· I have verified that my code is correct.· I have replaced the IR LEDs with visible LEDs and confirm that they activate when my program is running.· I can shoot an IR remote control at my boe-bot and it detects that.· It just doesn't do anything when I have the IR LEDs installed.
I have also tried looking at the IR LEDs using a digital video camera, they do not exhibit any visibility (whereas the various remote control units laying around the house I have tried do).· Can I replace the IR LEDs that came with my kit with an IR LED from say Radio Shack or similar that I could pick up on my way home from work tomorrow?· Or are there particular characteristics about the LEDs that would require I mail order the identical part from the website here?· In particular, in looking around online I have seen some IR LEDs for sale that mention 850 nm wavelength while others mention 950 nm wavelength.· I just want something that my little IR detectors can detect so I can build the next chapter in the book.
I have also tried looking at the IR LEDs using a digital video camera, they do not exhibit any visibility (whereas the various remote control units laying around the house I have tried do).· Can I replace the IR LEDs that came with my kit with an IR LED from say Radio Shack or similar that I could pick up on my way home from work tomorrow?· Or are there particular characteristics about the LEDs that would require I mail order the identical part from the website here?· In particular, in looking around online I have seen some IR LEDs for sale that mention 850 nm wavelength while others mention 950 nm wavelength.· I just want something that my little IR detectors can detect so I can build the next chapter in the book.
Comments
You are aware an IR-LED is an LED, meaning it works when you plug it in one way, and not the other, right? Also that it needs a current limiting resistor to keep from burning out immediately. Having said all that, you are correct that there is nothing "special" about the Parallax IR-LED's, one from Radio Shack should also work fine.
You should also be aware that for the IR-Detector unit to pick up any IR signal, the output to the IR-LED should be using a "FREQOUT IR_Pin, 38500" -- the IR-Detector only detects IR-light blinking at this rate. This is in order to provide some noise isolation.
I tried installing the regular red LED in place of the IR LED.··The detector does detect that.· I assume that there is some bleed over from the red LED into a frequency the IR detector can sense.
I am using this code for my detection:
If I shoot the TV remote at the boe-bot, the buzzer beeps every time.
I have also tried putting the IR LEDs in the reverse way, in case I was somehow mistaking the "+" leg and the "-" leg.· My understanding is that this should not be harmful to the LED.
Typical desired values for a 'normal' efficiency LED is about 12 to 15 mA. The LED is a 'non-linear' device, meaning once you reach a certain voltage across it (typically 1.4 volts for an LED) it will conduct WAY more current for very small voltage rises -- which is why you need the resistor.
So, to calc the value of the resistor. You're going to put 5 volts across the resistor -- LED circuit. The LED will drop 1.4 volts, so that puts (5-1.4 == 3.6 volts) 3.6 volts across the resistor. If the resistor is 220 ohm, the current will be (V = I * R, V/R = I, so 3.6/220 == 16 mA) 16 milliamps, which should work well. If the resistor is 1,000 ohms, that's (3.6/1000 == 3.6 mA) 3.6 mA, which is WAY too low for an IR-LED.
The good news is that you probably haven't damaged the IR-LED so far.
I understood the instructions in the book as saying to use a 1,000 Ohm resistor, but it is always possible I misunderstood or that the instructions may contain a mistake.· I did think that it was unusual to use a 1,000 Ohm resistor, since all other circuits involving LEDs have so far used 470 Ohm resistors, but I did not know how or why one sized resistor is chosen over another.· Your explanation is very good because it points out the reason why different resistors are used.
·
As allanlane5 mentioned, though, you should be able to see these IR flashing in a digital camera screen even with high values (low intensity).
Try hooking up the IR led through a 220 directly to +5v (vdd) and ground (vss) -- look at it in the camera. If you don't see it BRIGHT, then it's a bad IR led.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
1. You are really using a 1 k-ohm (brown-black-red) and not a 10 k-ohm (brown-black-orange), it is easy to mistake an orange band for a red band, since they are so tiny. The red LED would glow, but not so brightly, and the infrared LED would also be dim enough to make the Boe-Bot extremely "nearsighted." I've seen this happen at Educator's Courses
2. Your LEDs may have been manufactured with the lead lengths or cases reversed. I've seen this also, but it is rare. It's still worth trying to put them in "backward" to see what happens.
Let us know how it goes!
-Steph
Everything seems to be working correctly now (even using the 1K Ohm resistors).· I start detecting objects out at about 11" - 12" and when observed with a digital camera, I can see a faint red glow of activity.· Thanks for your assistance folks!·
EDIT
YES!· Boe-Bot is sucessfully navigating all over my house now.· I had a little bit of trouble at first because as he approached obstacles, he would "freak out" and just dance back and forth not going anywhere.· I decided this was because the sensors were trigering off and on in an almost random fashion as he approached an obstacle (especially corners).· I modifed the original movement statements:
to use a quick loop, to ensure he moves at least a certain distance away from the obstacle at first detection, like this:
Post Edited (FooWho) : 4/22/2010 6:01:11 AM GMT
Aren't these forums great?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Whit+
"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney