Shop OBEX P1 Docs P2 Docs Learn Events
pir sensor unresponsive, always high? — Parallax Forums

pir sensor unresponsive, always high?

MacadaciouseMacadaciouse Posts: 16
edited 2011-11-22 21:55 in BASIC Stamp
Hi all,
I'm trying to use a parallax pir sensor and the homework board to trigger a motorized effect. I have the relay circuit working, but the sensor isn't really responding to anything. My code is below, it seems pretty straightforward but obviously something is amiss. I have it running with a piece of paper covering the sensor in the hopes it will calibrate itself. Any ideas?
' {$STAMP BS2}
' {$PBASIC 2.5}
INPUT 0
IF IN0 = 1 THEN GOSUB move
IF IN0 = 0 THEN GOSUB no

move:
HIGH 10
DEBUG "move"
PAUSE 500
LOW 10
RETURN

no:
DEBUG "still"
RETURN

Comments

  • ercoerco Posts: 20,256
    edited 2011-11-22 08:33
    First, remove your paper. Permanently.

    Second, put a multimeter on the PIR sensor output lead and make sure it's working properly.

    Third, make sure the PIR connections to the Stamp are correct.

    Then report back, soldier.
  • MacadaciouseMacadaciouse Posts: 16
    edited 2011-11-22 08:45
    So I did have out and gnd mixed on the board (it's dark...) but I'm still not seeing a change. I covered the sensor with a piece of paper because it's in the middle of a retail store and I can't control what may trigger it; there are a handful of other animatronic christmas figures I wanted to isolate. Could I have fried it?
  • ercoerco Posts: 20,256
    edited 2011-11-22 13:22
    Could I have fried it?

    Quite possibly. :( Anything might be damaged from incorrect hookup, no mattter how brief.

    I have used the PIR sensor and it works very reliably when connected properly. :)
  • StephenMooreStephenMoore Posts: 188
    edited 2011-11-22 21:55
    I have 3 PIR sensors. Two work fine, the third gives me unreliable false detects no matter what I do... I've tried putting different resistor values on the input but to no avail. What do you expect out of a $10 part?
Sign In or Register to comment.