Faulty PIR Sensor?
Moovry
Posts: 5
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?
Can the PIR's run as is, with no microcontroller? Or is this just a faulty PIR?
Comments
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
-- Gordon
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.
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
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
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
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
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
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
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
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