which motion sensor are you using?

what about now if you remove those lines

portc.3 = 1
pause 120
portc.3 = 0
pause 120

is this motion sensor is a rotary encoder??? can you add an simple pulldown resistor on input pin let's say 10K or lower???

let me know
¸
regards