Shop OBEX P1 Docs P2 Docs Learn Events
IR sensor problems — Parallax Forums

IR sensor problems

bobhabobha Posts: 5
edited 2006-06-27 01:16 in BASIC Stamp
I'm having difficulty with my BOE-BOT standard IR sensors.· I have tried replacing both the ir leds and recievers, as well as placing them in different positions on the board.· However, all other sensors work fine on the breadboard and on the same line...
Can anyone help?

Comments

  • dandreaedandreae Posts: 1,375
    edited 2006-06-23 14:49
    Try checking the I/O pins by·blinking a standard LED.·· You may have damaged I/O pins or your IR LEDs and receivers are bad.· Make sure to run the IR Detection test program in "Robotics' with the Boe-Bot" text.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • JonathanJonathan Posts: 1,023
    edited 2006-06-23 14:50
    Bob,

    We need to know more before we can help. What is the problem? Do the sensors not pick anything up? Or are they always picking something up? How is the circuit connected? Are you using parts from Parallax, and if not what parts are you using?

    Have you tried running code for the IR sensoes only, or are you running all of the robot code? What code are you you running to drive the sensors? Post the code.

    It's very hard to help when we have no information. And the helpful folks on this list like to help!

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • bobhabobha Posts: 5
    edited 2006-06-24 16:20
    I am using all parallax parts, and have replaced both the recievers and leds.· I have tested them with a program which uses only the irs.· I have also tested the recievers with a tv remote but always get the same response... 1!· I have also tested the 1/0 pins with other sensors, such as photoresistors and "whisker" tactile-sensors and the Digital Encoder kit, which all work perfectly fine.· THe test program I am using is found in the Boe-Bot text on the bottom of page 273.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}



    freqSelect········· VAR········ Nib
    irFrequency········ VAR········ Word
    irDetect··········· VAR········ Bit
    distance··········· VAR········ Nib

    DEBUG CLS,
    ····· "·········· OBJECT", CR,
    ····· "FREQUENCY· DETECTED", CR,
    ····· "

    ·
    "

    DO
    · distance = 0
    · FOR freqSelect = 0 TO 4
    ··· LOOKUP freqSElect, [noparse][[/noparse]37500, 38250, 39500, 40500, 41500] , irFrequency
    ··· FREQOUT 8, 1, irFrequency
    ··· irDetect = IN9
    ··· distance = distance + irDetect


    ··· DEBUG CRSRXY, 4, (freqSElect + 3), DEC5 irFrequency
    ··· DEBUG CRSRXY, 11, freqSelect + 3

    ··· IF (irDetect = 0) THEN DEBUG "Yes" ELSE DEBUG "NO "
    ··· PAUSE 100
    · NEXT
    · DEBUG CR,
    ······· "

    ·
    ", CR,
    ······· "Zone······ ", DEC1 distance
    LOOP

    I attached the schematic ( I used P9 & P0 for the recievers and P8 & P2 for the Leds)

    ·
    1251 x 911 - 57K
    IMG.jpg 56.5K
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-25 04:35
    do you have the shields on the IR LED's and did you try getting a digital camera and checking to make sure they are flashing. i JUST had this poblem.
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-25 04:37
    i found a problem, in your code you called it freqSelect, where you have lookup freqSElect(see the capitol E) is it even compiling it? it should be....
  • bobhabobha Posts: 5
    edited 2006-06-25 18:26
    I do have the shields on my ir leds, the led has been replaced and is most likely working,· and the FreqSElect issue was simply a typo.· Still looking for a solution...
  • bobhabobha Posts: 5
    edited 2006-06-25 18:30
    I also checked the leds with a tv remote, and they worked fine.
  • JonathanJonathan Posts: 1,023
    edited 2006-06-25 18:50
    Have you checked the receiver using your remote control? Even if you do not have access to a 'scope, you should be able to see the voltage change with a DMM. Or you could set up the Stamp to sample the receiver using the COUNT or PULSIN commands.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-25 21:56
    yes but those simple typos may have abeen the problem, can you possible show us a picture of the layout.. you may have connected the pins backwards for the receiver or somthin
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-25 22:09
    You've got that LOOKUP deal, where I guess you're trying to survey for different center-frequencies.· I think that you're not giving it a good chance of hitting on any one.· Like with good ol' willthiswork89's program, I was using a vcr-remote and using/assuming 38-kHz -- and·the DEBUG would only result a "0" (detect state) once in a while, given the short-lived pulses from the remote's data-stream and the long pause before re-starting the loop.
    Once I modified the loop to jump back faster and to jump out on a positive I-R detect, the result was more consistent/telling.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
     
    irDetect VAR Bit
    
    INPUT 15
     
    Check:
     irDetect = IN15
     DEBUG "No infra-red emission", BIN1 irDetect,CR
     PAUSE 50
     IF irDetect = 0 THEN GOTO IRdone
     GOTO Check
    IRdone:
     DEBUG "Infra-Red emission Detected"
    END
    
    

    I suggest you add another FOR...NEXT to your program where you give·it several attempts (50, 100?), with a PAUSE shorter than 100, for each frequency trial.
    Select frequency, 100 attempts for a detect state, next frequency,...

    Post Edited (PJ Allen) : 6/25/2006 10:13:06 PM GMT
  • edited 2006-06-26 02:07
    I didn't see any reports on results from Chapter 7. ·With this in mind, my best advice would be to back up to Chapter 7, Activity #1 in the Robotics with the Boe-Bot text.· Read carefully, and follow the checklist instructions step-by-step. Although it's best to work through the whole chapter, you should at least complete Chapter 7, Activities #1-#3 before moving on to chapter 8.· Along the way, you'll probably find whatever wiring or coding mistake is causing all this.· Also, are you using a BASIC Stamp 2?· If you are using a BASIC Stamp 2p, 2px, 2sx, or 2pe, arguments in various commands in each program will need to be adjusted.

    Post Edited (Andy Lindsay (Parallax)) : 6/26/2006 2:11:42 AM GMT
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-06-26 04:35
    its not a coding mistake because i used his code and tested it with my IR sensor/LED and it worked fine after i fixed those typos... if basic is like every other codeing language its very case-sensitive.. that capital E would screw alot up... but it ran fine for me so there is definantly a wiring problem there
  • SSteveSSteve Posts: 808
    edited 2006-06-26 21:26
    willthiswork89 said...
    if basic is like every other codeing language its very case-sensitive.. that capital E would screw alot up...
    PBASIC is not case sensitive. "freqSElect" = "freqSelect" = "FREQSELECT" = "freqselect"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
  • bobhabobha Posts: 5
    edited 2006-06-26 23:45
    I tried what pj allen said, and still got the same response; 1!· I also tried the following program:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    irDetectLeft· VAR Bit

    DO
    · FREQOUT 8, 1, 38500
    · irDetectLeft = IN9
    · DEBUG HOME,· "irDetectLeft = ", BIN1 irDetectLeft
    · PAUSE 100

    and vice-versa for the right ir with IN0

    I am using a Basic Stamp,I'm sure that I didn't mix up the anodes & cathodes on the ir leds, and I'm still looking for a solution!· (I attached 2 pictures of my breadboard and a scan of the Boe-Bot text which I used to wire it.)(Sorry if the pictures are a bit "fuzzy")
    1600 x 1200 - 568K
    1600 x 1200 - 357K
    732 x 931 - 134K
  • SSteveSSteve Posts: 808
    edited 2006-06-27 01:16
    Do you have a digital camera or camcorder? Run the program in your last message and look at the LED on the camera's screen. You'll be able to see if it lights up or not.

    You're putting something in front of the BOE-Bot for the IR to bounce off of when you're running the program, right?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
Sign In or Register to comment.