View Full Version : BOEBOT following using PIR

05-26-2009, 06:33 AM
I need help. I am trying to make the BOEBOT follow my hand around a maze. I have currently connected the PIR sensor to the BOEBOT. But currently i have no way of knowing if the PIR sensor is working or not .Can anyone provide sample bs2 code that will use's the PIR sensor and makes the BOEBOT follow my hand.

Any help is appreciated.
Thanks in advance

05-26-2009, 06:38 AM
I don't think you can get it to work like that. There is sample code here www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/PIRSensor-V1.2.pdf (http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/PIRSensor-V1.2.pdf)


This message sent to you on 100% recycled electrons.

05-26-2009, 06:54 AM
thanks for replying Mike2545
this might sound very obvious but Can someone explain to me if i want the BOEBOT to just turn on LED when motion detected and off when object idle. how do i setup the led and the jumper setting and how will the code code change from sample code above.

05-26-2009, 07:18 AM

05-27-2009, 07:46 AM
thanks SRLM for the link.
Yesterday using the test code I got the following result.

DEBUG HOME, BIN1 IN0 ' Display Status Of P0 At Home Pos.
PAUSE 100 ' Small Delay
LOOP ' Repeat Forever

My BOEBOT doesn't still detect motion but it just keeps turning LED on and off when i put the output cable to the LED and if i attach the output to the pin0 on the debug terminal it just shows 1. i have played around with jumper setting but still had no luck. Can someone help me?

05-27-2009, 09:08 AM
What do you mean by output cable? You should just have a single signal wire going into PO. Also, don't forget to make the pin an input. I'm not sure what the default is, but it's good practice.

05-28-2009, 01:21 AM
thanks agian SRLM

now i am using the single signal wire going into PO and still the problem remian it contenously changes from 1 to 0 and so on. but how do i·make·the·pin an input. here· is the sample code i used to test.

' {$STAMP BS2}
' {$PBASIC 2.5}
'--Warmup the PIR sensor
LoopCounter VAR Byte
FOR LoopCounter = 40 TO 1
· PAUSE 1000
DEBUG HOME, BIN1 IN0 ' Display Status Of P0 At Home Pos.
·' Small Delay
LOOP ' Repeat Forever

05-28-2009, 06:28 AM
just put this:
before the PIR warmup loop.
That'll set pin 0 as an input, and thus actually read in the status to IN0

This won't work for what you want though... the PIR has much to large of a
detection field and much too much delay in each detection.

Once you get the BOE detecting you may be able to get it to work somewhat
by forcing the BOE to stop and wait a few seconds before going into detection
mode. You won't be able to detect properly while its moving.