Shop OBEX P1 Docs P2 Docs Learn Events
PIR Cheat to detect stationary human? — Parallax Forums

PIR Cheat to detect stationary human?

UghaUgha Posts: 543
edited 2008-12-03 21:13 in Robotics
Can you stick a Parallax PIR sensor on a servo and cause it to rotate back and forth to detect
a stationary target or would the change in background heat cause too much noise to get a
correct reading?

I'm looking to detect a person only about 2 feet away.

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-12-02 00:56
    You can't move the PIR without getting a false high. Just try connecting it to a 3 pin cable, and wave it around.
  • GWJaxGWJax Posts: 267
    edited 2008-12-02 02:35
    The PIR sensor picks up motion not heat motion. It relies on the IR bounce back from objects, if you move the PIR it will trigger movement so this would not work as you would like unless you record each feedback from the PIR when it has stoped and continued for the full scan then return to to each possition and get a reading from that and compair the diffrence. This might work but will have alot of errors in the data. I say give it a shot and see what you can do. You might want to use the BS2p or BS2px for this operation just for speed alone plus more memory space. This might be something that I may try out some time to see if it can be done.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-02 02:55
    Just to correct one misperception: the PIR sensor does not primarily pick up reflected or "bounced back" IR but, rather radiated IR from warm bodies. It has no source of IR "illumination" for subjects to reflect.

    Frankly, I think Ugha's suggestion is at least worth an experiment. The detector's sensitivity to stationary heat sources versus the amount of radial deflection, along with the prevalence of false positives, is certainly worth quantifying.

    -Phil
  • GWJaxGWJax Posts: 267
    edited 2008-12-02 03:41
    Yep your right my bad sorry guys! I was thinking of something else but I do think it might be possible to write some code for it. I may do it this weekend if I get the chance to. If all goes well I'll post the code here for you all to view and edit to your liking.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • SRLMSRLM Posts: 5,045
    edited 2008-12-02 04:35
    Is the suggestion to mount the PIR on a rotational platform, then move it to a position, see what the output is, and move again? One problem that I foresee is that the PIR has a fairly slow response time, so to get a good reading it will take several seconds. If I remember right, it's something along the lines of "The module has to create an IR map...".
  • GWJaxGWJax Posts: 267
    edited 2008-12-02 04:46
    I do believe this is correct but I'll have to re-read the docs.on that and yes that is what I meant. but if you use a Ping this would be a better option as the Ping reacts quick to a fast scanning system.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-02 05:52
    I think the idea is to keep the sensor aimed in the direction of interest, but to "twitch" it just slightly to create apparent motion for any warm bodies that might be in its field of view. If none exists, the output should remain neutral; otherwise, the "moving" body will be detected.

    -Phil
  • SRLMSRLM Posts: 5,045
    edited 2008-12-02 06:12
    What about using the IR thermometer? Then you can create your own profile of the area, and also get a direction for the object (person). In fact, that sound like tomorrow's project [noparse]:)[/noparse]
  • UghaUgha Posts: 543
    edited 2008-12-02 12:17
    PhiPi: That's exactly what I mean, just a "twitch" to force it to trigger.

    SRLM: Some of those IR thermometers can be quite costly. If it's possible to make a "people detector" using a $8-10 sensor,
    that'd be very useful. [noparse]:)[/noparse]

    GWJax: I'd appreciate it if you could play around with it like you suggested. I don't happen to have any standard servos and
    returning to original position with a cont. rotation servo is a pain in the... well you know.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-12-02 15:40
    Phil,

    You’re right it is worth looking into…however I will add that in my experience any movement seems to trigger the device. Here is why, and a possible work-around. The Fresnel lens on the device gives it a roughly 180 degree view. Not quite, but trust me…it has a wide field of view. The lens focuses the thermal energy onto a set of sensors inside. These kind of resemble a CCD. In any event there is an analog circuit that creates a kind of electrical balance based on the heat patterns seen. This circuit allows for slow changes, but as soon as you move the unit a little bit it makes a big change on the small element inside and the circuit goes out of balance.

    Now, a possible work-around might be to restrict the field of view so that the PIR only sees a narrow field of view ahead. This would result in less overall motion and require a bigger change in IR for the elements to see. Of course, a good scientist will try it both ways, but ultimately that is where I see this going if it is to work. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • GreenLightGreenLight Posts: 8
    edited 2008-12-02 17:59
    I have tried this with the PIR as well.· What i have found is that the sensor is way to sensitive(any movement even in an empty room causes it to trigger). I covered it with a few pieces of plastic from a black radioshack bag and was able to get it to work. It would only trigger when moved if there was significant heat source in the room.
  • UghaUgha Posts: 543
    edited 2008-12-02 19:23
    Chris Savage: would removing the lens be a way of restricting its view and possibly have this work?

    GreenLight: Did you cover the entire white lens or just parts to make it more directional? Did you try any other materials?
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-03 02:41
    Chris

    I will have to give this a try

    I have one thing to ask what would be the best thing to use to restrict the field of view

    Now, a possible work-around might be to restrict the field of view so that the PIR only sees a narrow field of view ahead. This would result in less overall motion and require a bigger change in IR for the elements to see. Of course, a good scientist will try it both ways, but ultimately that is where I see this going if it is to work. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • SRLMSRLM Posts: 5,045
    edited 2008-12-03 04:34
    Well, I tried the infrared thermometer. It could probably tell you if a person is there, with a couple of restrictions: that person has to be freezing (or pretty near it). Here's what I measured: my room is at about 16 Celsius, and my measured body temperature is at 19 Celsius with a sweatshirt on, and 21 with just a T shirt. So, I could reliably detect the person sitting in my chair from about 2 feet away.

    I tried half of an IR LED shield over the sensor (the half that is a tube) but it didn't significantly change anything. I have yet to try a reflector of some kind.

    One thing that would destroy the system is any sort of electronics (computers). My body only registered at 19 Celsius, but my monitor came out very reliably at 27 Celsius. So (with either the IR thermometer or the PIR) you'll have to make sure that you don't point it toward non-human high temperature devices.

    On a side note, I noticed something interesting about the IR thermometer operation. When I placed it over a heat source (my heart in this case) and in very close proximity, then quickly pulled it away about 2 inches and pushed it back, the measured temperature shot up about 5 degrees, then fell back to what it was before. Any ideas on why this is? The closest thing that I can relate it to is possibly a Doppler shift, but I don't think I moved it that quickly...

    Post Edited (SRLM) : 12/3/2008 4:45:37 AM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-12-03 15:47
    Removing the Fresnel lens would most likely render the senor inoperable. The very basis for the way the sensor works depends on the lens. However, by request here are two links to sites that discuss limiting the field of view of the PIR sensor. Many of you will recognize the person from the first link.

    http://www.scary-terry.com/itw/pirsensor/pirsensor.htm

    http://techartblog.blogspot.com/2007/08/parallax-pir-sensors.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • GreenLightGreenLight Posts: 8
    edited 2008-12-03 21:13
    I covered the entire sensor with the plastic. It took about 4 or 5 layers before it would stop going off when noone was in the room and it was moved. And yes a monitor or any other significant heat source in the room can still make it go off.
Sign In or Register to comment.