Shop OBEX P1 Docs P2 Docs Learn Events
Faulty PIR Sensor? — Parallax Forums

Faulty PIR Sensor?

MoovryMoovry Posts: 5
edited 2012-04-06 09:19 in Accessories
I recently bought a PIR Rev B motion sensor for a very simple project. The goal is to hook this motion sensor up to a buzzer that sounds when the PIR detects motion. I'm not using any microcontroller for this -- I'm simply connecting the output of the PIR to the buzzer. However, the PIR never seems to "warm-up", no matter how much time is given. It remains stuck on, and occasionally turns off for ~1 second at a time. I have tried both the short-range and long-range modes, but the result is the same.

Can the PIR's run as is, with no microcontroller? Or is this just a faulty PIR?

Comments

  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-04 13:29
    PIRs can pick up motion you can't readily detect, because it sees motion as changes between two infrared sensors. Try aiming it a different direction, and make sure the sensor is not being influenced by the vibration of your PC, for example. Avoid having it point toward an open window, drapes that may flutter in the wind, whatever.

    Try covering the entire Fresnel lens with electrical tape. Apply power and test to see if the internal LEDs eventually go out -- should be a minute or less.

    As far as your hookup, you can use the sensor without a microcontroller, but use care that you don't try to use the signal output of the PIR to drive a load. Some buzzers want more current than the PIR output line is designed for. The signal line should be limited to just one or two mA, I imagine. If you need to drive a load add a transistor or FET or the other usual solutions.

    -- Gordon
  • MoovryMoovry Posts: 5
    edited 2012-01-04 14:36
    I haven't tried covering it in electrical tape, but I have pointed it in many different directions that rule out movement as the cause of it turning on (directly at a wall in a dark room for example). Also, I have not had it connected to the buzzer output yet.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-01-05 11:43
    It's usually best to connect the output of sensors to some active circuit so that the pin doesn't float. That said, I just did a quick check of a PIR Rev B module I have and it worked as expected, even with the output pin disconnected. If you have a chance to connect the sensor to a circuit I'd do one more check that way, and if it still shows motion when there is none you might contact Parallax customer service. The sensor might be bad.

    -- Gordon
  • MoovryMoovry Posts: 5
    edited 2012-01-05 12:08
    I'll see what I can do. Thanks for the help, Gordon.
  • Ken GraceyKen Gracey Posts: 7,390
    edited 2012-01-05 12:39
    Moovry,

    Welcome to the forums! I can see that you've made a couple of posts so you're getting familiar with the place. You've already encountered one of our star performers for a reply. You'll find a bunch of experts on these forums, a few boring business people (ahem), and some very interesting folks in general.

    I also doubt that the sensor is faulty, but if it turns out it is I'd be happy to plop one in the mail to you. Just send your info to kgracey@parallax.com.

    One minor correction to the replies above - the PIR Rev B. can drive an external load. If memory serves correct you've got a few hundred mA to turn things on or off. Please see the full specifications at http://www.parallax.com/tabid/768/ProductID/83/Default.aspx By contrast the Revision A is unable to do this. (update a few minutes later: I took a look at the specs and they don't say how much current it can source, so I asked Jessica for help).

    Ken Gracey
    Parallax Inc.
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2012-01-05 14:44
    Hi Moovry,

    The PIR Rev B can provide up to 23 mA using a 5V supply. What type of power supply are you using with this sensor? That may help us narrow down the problem.

    Cheers,
    Jessica
  • MoovryMoovry Posts: 5
    edited 2012-01-06 18:17
    What exactly do you want to know about the power supply? It's basically a re-purposed DC power supply from something else. Simple step-down transformer and converter that plugs into a wall outlet and brings it to 5.12V DC output (measured using a multi-meter).
  • MoovryMoovry Posts: 5
    edited 2012-01-06 18:33
    Huh. I never would have guessed it, but the motion sensor appears to work as intended when I power it using 3 AAA batteries (~4.5V). Perhaps my DC power supply just wasn't providing clean enough power. Problem solved, thanks much.
  • rmcbrmcb Posts: 39
    edited 2012-01-12 20:21
    I read this post because I too have a problem with a PIR sensor (#555-28027). I have a BOE ( Rev D) and a PIR sensor (Rev B). I loaded it with the sample code that I got off the PIR's pdf file.

    PAUSE 40000

    DO
    DEBUG HOME BIN1 IN0
    PAUSE 100
    LOOP

    I have the BOE powered with a 9 Volt battery. When I load the pgm I get a series of 1's on the debug screen but nothing else. I never see the LEDs on the sensor light up or do anything else and I can wave my hand in front of the sensor at a range of about 4-5 inches and again nothing happens.

    I have the PIR plugged into Pins 1-3 of my bread board. GND connected to Vss, Vcc on the PIR connected to Vdd, and OUT connected to PIN0.

    What am I doing wrong?

    Thanks
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2012-01-13 17:25
    Hi rcmb,

    You have a PAUSE 40000 statement at the beginning of your program. are you seeing no response after 40 seconds after the program has run?

    Also, can you attach a picture of your DEBUG terminal? With the code you've included, you shouldn't see a series of 1's, just a single 1 in the top left-hand corner of the screen. A logical 1 also indicates that movement is detected, so it may be a faulty LED.

    Another thing to check: make sure Vcc is connected to Vdd and not Vin. Sometimes they're a little hard to distinguish between, and I know I've made that mistake!

    Cheers,
    Jessica
  • rmcbrmcb Posts: 39
    edited 2012-01-16 09:15
    Hi Jessica,

    Thanks for the response and sorry to bother you with what appears to be such a noob question.

    After the 40 second pause I see a series of 1's across the screen, as I took out the HOME statement, as show below. And there is no motion going on in the field of view.

    CODE:

    PAUSE 40000 ' PIR warm-up time
    DO
    DEBUG BIN1 IN0 ' Display state of P0
    PAUSE 1000 ' Small Delay
    LOOP ' Repeat Forever


    I have the PIR set in column 10 of my BOE breadboard area. OUT = row 1, VCC = row 2, and GND = row 3.
    I have a wire connecting column 1, row 1 to P0
    I have a wire connecting column 2, row 2 (P2) to Vdd
    I have a wire connecting column 2, row 3 (P3) to Vss

    Once the loop is running, there is a red LED, right next to the USB connection, on the BOE that flashes each time the loop runs.

    I'm powering this with a 9 volt battery and I've attached a shot of the BOE.

    Any help would be gratefully accepted.

    Thank you,

    Ryan

    DSCN4450.jpg


    Image-0135.jpg
    876 x 707 - 189K
    1024 x 768 - 103K
  • PublisonPublison Posts: 12,366
    edited 2012-01-16 09:42
    rmcb wrote: »
    I have the PIR set in column 10 of my BOE breadboard area. OUT = row 1, VCC = row 2, and GND = row 3.
    I have a wire connecting column 1, row 1 to P0
    I have a wire connecting column 2, row 2 (P2) to Vdd
    I have a wire connecting column 2, row 3 (P3) to Vss

    Ryan, Looking at the picture you provided, I have a couple of comments.
    Your yellow wire going to P0 looks like it is in row 2, I would move it down 1 row.
    The red wire is also going into row 2, which will hold P0 high all the time, (as you have it currently wired).
    It looks like your black wire is actually in row 4, not 3. (Hard to tell with the red wire in the way.

    Also, no connection is made on the breadboard over the center break, (channel). You will have to provide jumper wires from rows 1,2 and 3 on the left side to rows 1,2 and 3 on the right side of the breadboard.

    Hope that helps.

    Jim
  • rmcbrmcb Posts: 39
    edited 2012-01-16 11:14
    Jim,

    Thanks. I guess that really falls under the category of "duh!" I wasn't even paying attention to the center break at all!

    Thanks for the assist. It works as expected now. Talk about "operator error."

    And if I wanted to light up an LED I would just connect the LED to the output pin, in this case P0, with a resistor in the loop of course, and it should light up when the PIR sends high, correct?

    Thanks again, very much.

    How are you with RFID reader questions?

    Ryan
  • Isaac ElekomIsaac Elekom Posts: 4
    edited 2012-03-24 08:19
    I am making an animated dinosaur and would like to use the PIR 555-28027-RT for my dinosaurs eyes, I was wondering if there would be any problems if I painted a pupil on the sensor.
  • smithdavidpsmithdavidp Posts: 146
    edited 2012-04-05 07:56
    I'm just installing my PIR. My question is, since I am using the Prop BOE, should I put a 3.3k resistor in the output line (same as the Ping)? I plan to use the servo header to attach diectly to the PIR. P18 to be exact.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-04-05 15:52
    PIR rev B is a wide-voltage device. Power it at 3.3V and you don't need no stinking resistors.

    Go here for a simple hookup example. It shows the Propeller QuickStart board, but the PropBOE is the same idea:

    http://sites.google.com/site/parallaxinretailstores/home/pir-motion-sensor

    -- Gordon
  • smithdavidpsmithdavidp Posts: 146
    edited 2012-04-06 00:54
    So...... I just move the jumper to the VIN side and use the 3.3V VIN current? The reason I want to do it this way is to keep the breadboard clear for the infra red sensors, the temperature sensor (which I haven't figured out the pin set up yet) and the carbon monixed sensor.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-04-06 09:19
    So...... I just move the jumper to the VIN side and use the 3.3V VIN current?

    I assume you're talking about the PropBOE here? VIN isn't at 3.3V. It's 5-9 volts, or whatever you're powering the PropBOE. (5 volts if by USB, 9 volts if by 9-volt battery, 6-9 volts if by wall adapter.)

    If you want to use one of the servo header sets along the top, you'll need to remove the jump block for the set. Note the three terminals for the jumper: VIN, unmarked center, and 5V. Then connect a short jumper wire between the unmarked center post and the 3.3V rail. Be sure not to connect the 3.3V rail to VIN or 5V. .

    It might be easier to not use a servo header. Use one of the new 3-wire extension wire sets (under $1 each) to connect the PIR to the breadboard. Then jumper from there to 3.3V, ground, and whatever input pin you're using.

    -- Gordon
Sign In or Register to comment.