Shop OBEX P1 Docs P2 Docs Learn Events
Help needed with IR detection! — Parallax Forums

Help needed with IR detection!

RayderonRayderon Posts: 7
edited 2010-12-08 14:10 in Accessories
I am designing a tracking robot to 'hunt' for a IR emitting target robot. but i encountered some problems with the IR emitter part.

I used IR recievers mounted on the front of the tracking robot to look out for IR signals, the test program is as follow:

irdetectleft VAR Bit
irdetectfront VAR Bit
irdetectright VAR Bit
DO
irdetectleft = IN3
irdetectfront = IN2
irdetectright = IN1
DEBUG HOME, "irdetectright = ", BIN1 irdetectright
DEBUG CR, "irdetectfront = ", BIN1 irdetectfront
DEBUG CR, "irdetectleft = ", BIN1 irdetectleft
PAUSE 100
LOOP

I installed a test program to emit IR on another Boe-bot with the IR transmitter.

DO
FREQOUT 1, 1000, 38500
PAUSE 100
LOOP

However, the tracking robot IR recievers failed to detect the target Boe-bot with the IR transmitter. All devices are working properly. I am not sure what is the problem here. The parts worked fine when i attached all parts into the same boe-bot and moved the IR transmitter infront of the IR recievers, they are able to detect the IR but when i seperate the parts into different Boe-bots, the IR recievers failed to detect the IR from the IR transmitter. Anyone willing to help me with this? I will really appreciate it. Thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-12-07 22:10
    You're sampling the IR receivers very quickly (in less than a millisecond probably), then spending 50 milliseconds outputting debugging information and a pause of 1/10 of a second. Most of your receiving robot's time is spent not looking for an IR signal. On top of that, the transmitting robot isn't transmitting all the time. You might check that the IR receivers and LED are hooked up the same when using two BoeBots. I'm sure you don't have the LED and one receiver on the same I/O pin when you're using only one BoeBot, yet you're using the same number I/O pin when you're using two BoeBots.
  • RayderonRayderon Posts: 7
    edited 2010-12-07 22:44
    oh ic. thanks for your help! :)
  • ercoerco Posts: 20,255
    edited 2010-12-08 14:10
    Additionally, the IR LEDs are very directional. You can't see them unless they're aiming mostly at the sensor, so you may need a perimeter ring of 6-10 LEDs to spot a BoeBot in any orientation. Signal strength (LED current) is a balancing act; obviously a stronger signal can be detected farther away, but at some point a strong signal gets reflected off nearby walls and objects, and you'll detect the reflection instead of the BoeBot.
Sign In or Register to comment.