Shop OBEX P1 Docs P2 Docs Learn Events
Simple PIR wiring problem for newbie — Parallax Forums

Simple PIR wiring problem for newbie

bddbbd.bbddbbd.b Posts: 12
edited 2007-02-19 04:35 in BASIC Stamp
I am having trouble connecting my Ademco/Honeywell PIR ceiling mount 997 motion sensor to my BS2 for a simple digital input. All the schematics I can find online are for PIRs with three wires (power, ground, and signal) but mine has four (power, ground, and two "to closed circuit protective loop" that are hooked up to the relay. I connected one wire to power and the other to my pin, and used debug to monitor the signal. The switch wiring seems to work with my toggle switch, but it does not seem to work with the PIR. The walk-test LED blinks and seems to respond to motion when it is powered, but I am not having luck with the relay.
Is the BS2 voltage too low?
Is the wiring wrong?
Is the sensor broken?
Am I just doing something stupid?

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-02-16 03:49
    Here is a link to the schematics, seems the PIR is powered with 12vdc. You must keep this supply voltage separate from the Stamp Vdd . Take the 5v from the Stamps Vdd to one side of the alarm relay and return with a wire from the other side of the relay to your selected pin on the Stamp through a 220ohm resistor.

    http://www.alarmsuperstore.com/ademco/manuals/pirs/997.pdf

    Jeff T.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-02-16 17:25
    Hello,

    I have used these in Security Systems for years. The output is usually a N.O. or N.C. Relay contacts. So you can wire those two points as if it were a push button on the BASIC Stamp. See the Help File or BASIC Stamp Manual under the BUTTON command for wiring diagrams for Active HIGH/LOW connections. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • bddbbd.bbddbbd.b Posts: 12
    edited 2007-02-16 22:49
    I am still not having any luck with this. I tried the BUTTON command, and it would just register motion constantly, or not at all.
    I tried a continuity test with my multimeter on the relay wires while the sensor was powered, but it never registered continuity... I think this is an NC relay, so I am getting confused again.
    I am mostly confused by the wiring situation, which seems to be the problem since the debugger never registers a _change_ in the state of the pin. thanks for the help.
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-02-16 23:45
    Hi, I missed an important detail in the last thing I told you, to prevent floating voltage on the pin you are using to monitor the relay contacts, it needs to be held low. Lets say we are using Pin 1 as our input, connect a 220 ohm resistor in series with a 10 K resistor, connect the 220 to Pin1 and the 10K to Vss. Where the two resistors are connected together attach the return wire from the relay and instead of the button command try this code.

    main:
    DO WHILE IN1=1
    DEBUG "contacts are closed", CR
    PAUSE 500
    LOOP
    DO WHILE IN1=0
    DEBUG "contacts are open" ,CR
    PAUSE 500
    LOOP
    GOTO main

    Jeff T.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-02-17 21:03
    Sorry, I didn’t mean for you to use the BUTTON command, just the circuits on it’s page, which have pull-up/pull-down resistors on them. Can you post a wiring diagram/schematic of exactly how you have it hooked up?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • bddbbd.bbddbbd.b Posts: 12
    edited 2007-02-19 03:13
    Chris,
    Thanks for the advice- I am still not getting useful results with the PIR. I used both the diagrams from the BUTTON page. When I wire it active-low the debugger gives me x=1 and when it is active-high it says x=0, as I would expect. The problem is that it never changes state, even though the walk-test LED lights up (I tried it with the LED disabled, too). Using the same wiring with an N.C. pushbutton in place of the PIR relay gives me the results I need...
    As far as the schematic, I used the one from the manual (which is actually the same as the one I started with, taken from Dan O'Sullivan's Physical Computing). I took a 10k ohm resistor from +5V to pin 7, and the relay from pin 7 to ground.
    I double-checked that my debugger is reading the right input pin, and the circuit works with the pushbutton switch, so I am really at a loss.

    If I weren't such a total beginner at this I would suspect that the PIR is malfunctioning, but that seems like the cardinal "don't blame the compiler" debugging sin. It sounds like there is a relay switching on and off when the LED flickers, but I am not sure if that means anything. As I said before, I don't get continuity from the relay wires, but I don't know if that means anything, either. Is there a good way to check if the relay is broken?

    Jeff,
    I tried your circuit and code, but never got it to work, even with the pushbutton switch. I assume that I miswired it, since I am not an expert at reading graphical schematics and have even more trouble with verbal versions. If you could post a diagram (or even photo of a breadboard) I could give it another shot.

    I really appreciate all the help.
    Ben
  • FranklinFranklin Posts: 4,747
    edited 2007-02-19 04:35
    The two wires are a switch that is closed until you have movement. If you put an ohm meter across them you should be able to see this open when the movement is detected. Some pirs have a test position with the walk light but in that position the alarm contacts are disabled. Make sure yours is in active mode when testing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.