Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot Chapter 7: Navigating with Infrared Headlights — Parallax Forums

Boe-Bot Chapter 7: Navigating with Infrared Headlights

FooWhoFooWho Posts: 17
edited 2010-04-22 16:18 in Robotics
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.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2010-04-21 15:03
    It's a very bad sign that you can look at the IR-LED's with a digital camera, and NOT see them flashing. They should flash.

    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.
  • FooWhoFooWho Posts: 17
    edited 2010-04-21 15:53
    Yes, I have the·-·leg (on the "flat" side of the LED) connected to the Vss line and the + leg connected to my output pin.· I am·using a 1,000 Ohm resistor, per the instructions in the manual.

    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:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
     
    irDetectLeft         VAR Bit
    irDetectRight        VAR Bit
     
    DO
     
      FREQOUT 8, 1, 38500
      irDetectLeft = IN9
      
      FREQOUT 2, 1, 38500
      irDetectRight = IN0
     
      
      if (irDetectLeft = 0 AND irDetectRight = 0) THEN ' Double beep the buzzer if we see both
        
        FREQOUT 4, 350, 2000
        PAUSE 200
        FREQOUT 4, 350, 2000
      
      ELSEIF (irDetectLeft = 0) THEN ' Long beep if we see only left
        
        FREQOUT 4, 800, 2000
     
      ELSEIF (irDetectRight = 0) THEN ' SHort beep if we see only right
     
        FREQOUT 4, 400, 2000
     
      ENDIF
     
    LOOP
        
    


    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.
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-04-21 18:20
    1,000 ohms is a bit high. This will work for a "high-efficiency" visible light LED, but most IR-LED's aren't "high-efficiency". You probably need a 220 ohm resistor in there.

    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.
  • FooWhoFooWho Posts: 17
    edited 2010-04-21 18:40
    Thank you very much.· I will try using the smaller resistor this evening.

    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.
    ·
  • ZootZoot Posts: 2,227
    edited 2010-04-21 22:41
    For "near-sightedness" values around 1k to 2k ohm are not uncommon, as the text describes (a value in the 220 to 470 range will be pretty long -- 6" or more -- and you may get reflections back from the floor).

    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
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2010-04-21 23:33
    The instructions do say to use an 1 k-ohm resistor. Two things to double-check:

    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
  • PrettybirdPrettybird Posts: 269
    edited 2010-04-22 01:26
    Agree. 1K works fine. I am currently experimenting with IR sensors (homemade). Proper aiming is important. I tested and get around 8" with my hand. I have seen the backward made LEDs. A digital camera is the best test. I can also see a faint red glow when using a 220 ohm resistor.
  • FooWhoFooWho Posts: 17
    edited 2010-04-22 04:48
    I tried a 220 Ohm resistor and did not get any detection from the IR detectors nor any activity visible with the digital camera.· I also tried putting the LEDs in backwards with the same result.· I picked up a pair of IR LEDs from Radio Shack and though they were marked as having slightly different characteristics (940 nm wavelength versus 980 nm wavelength for the ones that came with the kit) they were cheap enough to give it a shot.

    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:

    PULSOUT 13, pulseLeft
    PULSOUT 12, pulseRight
    PAUSE 15
    

    to use a quick loop, to ensure he moves at least a certain distance away from the obstacle at first detection, like this:
    FOR motionCounter = 1 TO 10
         PULSOUT 13, pulseLeft
         PULSOUT 12, pulseRight
         PAUSE 15
    NEXT
    

    Post Edited (FooWho) : 4/22/2010 6:01:11 AM GMT
  • WhitWhit Posts: 4,191
    edited 2010-04-22 11:44
    Nothing can build your confidence like solving a problem! Great job FooWho. Glad you got it working.

    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
  • FooWhoFooWho Posts: 17
    edited 2010-04-22 16:18
    Whit said...
    Nothing can build your confidence like solving a problem! Great job FooWho. Glad you got it working.

    Aren't these forums great?

    Absolutely!· Everybody has been very helpful.· I have been having a ton of fun puting my robot together and learning a bunch thanks to the very nice documentation Parallax provides and the great help of the people here on the forum.
Sign In or Register to comment.