Shop OBEX P1 Docs P2 Docs Learn Events
help with a pir motion sensor — Parallax Forums

help with a pir motion sensor

RobeRobe Posts: 13
edited 2005-06-21 16:58 in BASIC Stamp
I·have a DHM 5150 human motion sensor module that I have purchased from DR R.· and I·was wondering if I could use a·BS2 to run the sensor by using a code or do I need hardware.· Could anyone help me with a program to get·me started or what I should do to get it started with a basic stamp.
I would really appreciate your help thank you.···confused.gif

····

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-06-20 07:13
    Robe -

    A link to the "DR R." web site, or to the data sheet for the DHM 5150 would be real helpful.

    Regards,

    Bruce Bates
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-20 13:03
    The PIR sensor I have is pretty simple: the output pin goes high when motion is detected -- all one has to do is monitor the state of the input pin that the PIR connects to.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-20 14:49
    Hello,

    ·· If the type you have is the kind used in a Home Alarm System, these typically have a small reed relay which closes it's contacts.· In this case you would read it the same as a switch.· I did a search on Google with the information you gave, but didn't come up with a matching sensor.· So you could have one like Jon describes (Usually 3 pins), or it could be one from an Alarm System (screw terminals inside).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-21 15:00
    Hello,

    ·· After finding the docs for this device, I see it's more like what Jon described.· However, the docs are kind of cryptic, and from the looks of them, you will have some difficulty interfacing this device with a BASIC Stamp unless you use a comparator or something to trigger an output.· The output of this device appears to be at 1.5V when not active and 5V when active.· That presents a small problem for direct input, since 1.5V is a HIGH to the BASIC Stamp, as is 5V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-21 15:08
    You should be able to "fix" the output of the PIR with a simple voltage divider -- assuming the output is driven.· The attached circuit should knock the "off" voltage down to about half a volt.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    328 x 304 - 2K
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-06-21 15:37
    Gents -

    I don't claim much electronics expertise, but couldn't the same thing be accomplished by inserting any common diode (to drop the voltage by .7 volts) in line with the signal terminal?
    AFAIK the diode solution is current independent, where the resistor solution may not be. I don't know if that makes any difference in this case or not, but it saves having to dig out or purchase two resistors of specific values <shrug>.

    Regards,

    Bruce Bates
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-21 15:40
    You don't have my magic resistor set, Bruce? Everyone should have a small box that has 220, 470, 1K, 4.7K, and 10K resistors -- I almost never require any other value for my [noparse][[/noparse]admittedly simple] projects.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-21 15:43
    Hello,

    ·· Both methods should work fine...I myself was hesitant to suggest anything specific without having the device to play with, since the docs aren't real informative.· There are actually 2 analog outputs, but both seem to start at 1.5V so...The sensor Jon referred to might be a better solution.· I myself have the type used in Alarm Systems, which have a relay output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-06-21 16:58
    Bruce Bates said...
    Gents -

    I don't claim much electronics expertise, but couldn't the same thing be accomplished by inserting any common diode (to drop the voltage by .7 volts) in line with the signal terminal?
    AFAIK the diode solution is current independent, where the resistor solution may not be. I don't know if that makes any difference in this case or not, but it saves having to dig out or purchase two resistors of specific values <shrug>.

    Regards,

    Bruce Bates
    You are correct that the diode solution is current dependent, if you place it in series with the stamp pin the current is nearly zero. Plugging in a very small current value into the equation for the voltage drop yeilds a near zero value, so in this condition the diode will not perform as desired.·Setting a bias current for the diode will provide the desired result but this requires at least one resistor, so you may as well stick with the voltage divider Jon provided.
Sign In or Register to comment.