Help with Adjusting infared vision
A.C. fishing
Posts: 262
Hello. I'm very new to Robotics and programming. I have a Boe- Bot. I'm using the following code so the boe-bot chases targets of its own choice. My boe-bot "sees" targets using Infared vision.
How can I change it so the Infared isn't as sensitive, and only "sees" life and power sources, so it only chases them. Any ideas. thanks.
P.S. The scematic I'm using is the same as on the Boe-Bot's manual cover.
How can I change it so the Infared isn't as sensitive, and only "sees" life and power sources, so it only chases them. Any ideas. thanks.
P.S. The scematic I'm using is the same as on the Boe-Bot's manual cover.
' {$STAMP BS2} ' {$PBASIC 2.5}
irDetectLeft VAR Bit irDetectRight VAR Bit pulseLeft VAR Word pulseRight VAR Word
'---------[noparse][[/noparse]Initialization]------------------------------------------------
DEBUG "Attack Program Running!!" FREQOUT 4, 2000, 3000
'-------[noparse][[/noparse]Main Routine}----------------------------------------------------
Main:
DO
PULSOUT 13,790 PULSOUT 12, 790 GOSUB Check_IRs LOOP UNTIL (irDetectLeft = 0) OR (irDetectRight = 0)
DO IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN pulseLeft = 850 pulseRight = 650 ELSEIF (irDetectLeft = 0) THEN pulseLeft = 650 pulseRight = 650 ELSEIF (irDetectRight = 0) THEN pulseLeft = 850 pulseRight = 850 ELSE pulseLeft = 850 pulseRight = 650 ENDIF
PULSOUT 13, pulseLeft PULSOUT 12, pulseRight PAUSE 15
GOSUB Check_IRs LOOP
'--------[noparse][[/noparse] Subroutines ] ---------------------------------------------------------------
Check_IRs: FREQOUT 8, 1, 38500 irDetectLeft = IN9 FREQOUT 2, 1, 38500 IrDetectRight = IN0 RETURN
Comments
To adjust the sensitivity of the infrared receivers/emitters you can do a couple of things:
- use a larger resistor between the IR LED and the I/O pin to decrease IR power OR
- change the frequency in the FREQOUT lines of code to some other "out of tune" value from 38500 (try 37500 for example) OR
- make the object black so that some of the IR is absorbed
Of course, you could use a combination of these ideas and at some point the IR won't work at all.
I'm not sure what you mean by "power sources". Are you referring to 120 VAC wall voltage? Maybe you could hook up a cheap gaussmeter to measure EMF - explain what you mean by power sources.
Ken Gracey
Parallax, Inc.
http://www.parallax.com/detail.asp?product_id=555-28027
Ken Gracey
Parallax, Inc.
The PIRs are very interesting and come in a wide range of styles and designs. This little guy has all the circuitry on board, so you don't have to build. It is quite handy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan