IR sensor problems
bobha
Posts: 5
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?
Can anyone help?
Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
Http://www.parallax.com
·
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
' {$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)
·
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
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.
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
Post Edited (Andy Lindsay (Parallax)) : 6/26/2006 2:11:42 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store
' {$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")
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