Shop OBEX P1 Docs P2 Docs Learn Events
Detecting a negative pulse — Parallax Forums

Detecting a negative pulse

JonathanJonathan Posts: 1,023
edited 2009-01-06 17:06 in General Discussion
Hi All,

Still working on the homebrew alarm system, and now I have another question. I feel like I'm flooding the sandbox, but here goes.

I have a PIR motion sensor. It outputs a brief postive pulse (+7VDC) when it turns off the light, and two negative pulses (-7VDC) when tripped. I need to convert the negative pulse to a positive somehow. Any thoughts?

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-01 17:09
    A bridge rectifier will convert the pulses all to positive. You probably should use an optoisolator as well. The diode drop from the bridge would be around 1.4V and the LED in the optoisolator would have a similar drop. That would leave about 4V to drop in a resistor. At around 10mA, you should use a 470 Ohm resistor. On the Stamp side, you'll need a 10K or so pullup from the collector of the optoisolator's transistor to Vdd (the emitter connects to Vss and the junction of the two goes to the Stamp pin).
  • JonathanJonathan Posts: 1,023
    edited 2009-01-01 17:26
    Mike,

    The only problem I see with that is how to tell which pulse is which. I *might* be able to do that with detecting the pulse width, as they are different in length.

    The sequence is like this: Upon powering up the PIR, it takes a few minutes to settle, then emits an "off" pulse (+7V). It then waits for motion and if it sees some, emits an "on" (-7V) pulse. It appears the unit has a latch type relay, mounted in a lightbulb fixture. I need to wait for the first "off" pulse, then enable the alarm system. I suppose it would actually be ok to turn it on and wait for *any* pulse, then wait for *any* other pulse.

    I'll go play. I just want to make sure I don't get false triggers.

    Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-01-01 19:27
    Jonathan,

    Try this circuit:

    attachment.php?attachmentid=57699

    It will output separate pulses for "on" and "off".

    -Phil

    _
    447 x 287 - 2K
  • JonathanJonathan Posts: 1,023
    edited 2009-01-01 20:35
    Clever phill! I have it working with Mike's suggestion, but I'll try yours as well, I have parts for it laying around. I'm well on the way, video system is triggering and recording, alarm bell sounding, light flashing and the phone dialing. What would I do without y'all??!!

    Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • JonathanJonathan Posts: 1,023
    edited 2009-01-06 17:06
    Phil,

    I f you read this, thanks for the opto circuit above. Not only can I differentiate between on and off, but it also solved a ground loop issue due to the PIR using negative voltages. Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Sign In or Register to comment.