PIR Sensor detects motion in empty room
kenken
Posts: 13
Hello everybody,
My new PIR Sensor is connected to an Arduino using the code from the Arduino Playground (http://www.arduino.cc/playground/Code/PIRsense). It is directed towards a wall in an empty room. There is a window on the side but it is far enough away so no direct sunlight can come in. I tested it for 24 hours. Every 2-5 minutes it detected motion (even during the night).
It should not be caused by noise as it keeps quiet when I cover it with a ceramic cup.
I have also made sure that there is no motion during the calibration time.
Can anybody tell me what's wrong with this sensor? Or what I can do to make it work?
I would appreciate yor help very much.
My new PIR Sensor is connected to an Arduino using the code from the Arduino Playground (http://www.arduino.cc/playground/Code/PIRsense). It is directed towards a wall in an empty room. There is a window on the side but it is far enough away so no direct sunlight can come in. I tested it for 24 hours. Every 2-5 minutes it detected motion (even during the night).
It should not be caused by noise as it keeps quiet when I cover it with a ceramic cup.
I have also made sure that there is no motion during the calibration time.
Can anybody tell me what's wrong with this sensor? Or what I can do to make it work?
I would appreciate yor help very much.
Comments
Try putting the PIF in the end of a empty paper towel tube to reduce the focal width, and tell us how that worked. I use this method all the time to remove extraneous triggers.
And then toilet paper tube to fine tune.
-Phil
It is in H mode.
Robert
I tried but it didn't change anything. It seems to be a hopeless case?
So you think the sensor might simply not be working properly? It behaves really strange. Night or day, light or darkness it keeps firing every 2- 5 minutes.
It will also detect tiny critters like mice. Are you sure that room is "empty" when you're not looking?
-Phil
There isn't enough details yet to determine what the problem is yet. Just thought that if you had an opportunity to pickup another sensor it would be easy to swap that out and see if it made any difference.
I think it is important to mention that we don't know for sure that the SENSOR it firing every 2-5 minutes. All we know at this point is that your program thinks it is....
- How is everything wired up?
- Do you have a diagram on how the PIR sensor is wired to your board?
- Could you post a picture so we can see if anything looks out of place?
- How are you powering your project? Is a wall power adapter or battery? Is the power source electrically noisey?
- Is there any pull-up or pull down resistors installed on the I/O pin? Perhaps adding a 10K or ever 20K resistor may help.
- Have you tried a different I/O pin in case something is messed up with the particular pin you've selected?
Let us know,
Robert
The same might happen if sunlight (or perhaps other IR sources such as distant campfires, hot factory stacks, etc.) ripple off of water. But I would think window glass would filter out those wavelengths. PIRs I've used in the past don't seem to "see" through windows.
I don't have a camera at hand, but I have a lot of experience with soldering. So I can exclude for sure that the problem comes from inappropriate wiring. The connections are very easy: GND connects to GND, 5V to 5V and the output of the sensor to a digital pin of my arduino. I have tried several digital pins: same result.
In the software I activated the internal pulldown resistor. According to your suggestion I also put a 10K external resistor. The wires from Arduino to the sensor are about 2m long.
After observing for a longer time I came to the conclusion that it must nevertheless have something to do with some noise in the power system.
First I had Arduino powered from USB: motion detection every 2-5 minutes (sensor always under ceramic cup)
Then I used a separate power supply: the detection has a slightly longer intervall.
And when I switch off my soldering iron, which is connected to the same multi-outlet power strip, the sensor detects motion. So I conclude that the other detections should come from other peaks somewhere else (computer?).
The problem is that I have no other choice than having the Arduino, the computer and the power supply on the same power strip.
Do you have any clue how I could filter the noise? I tried to put a 100nF ceramic capacitor (the only one around) between GND and 5V close to the sensor. No success. From my point of view the PIR sensor is a bit too sensitive. I mean what I else can I do than provide a separate power supply (which I would like to avoid for space reasons...)
Thanks for your help so far,
Ken
What if you locate the PIR near the arduina, for troubleshooting purposes, leads short as possible (<<2m)?
PE - If they're not already, you could try loosely twisting the power leads, 1 turn / inch (25mm) or using 3-lead shielded mic-headphone cable? ** It'd be better/best to know whether the misfire occurs with the short leads.
power glitch forcing the PIR to re
1 - This sensor has a digital output signal of constant minimum duration and voltage.
2 - It detects changes in the infrared image of an area
If you have covered the sensor (attached with 2 meter leads) and the triggering does not occur that is an indication that it is not a power or noise pickup problem. Using a battery as the power supply and repeating the test with the sensor covered and then uncovered should confirm this.
To determine the cause you could use a video camera/recorder and microphone to monitor the area the sensor covers to see what if any events occur when the sensor is triggered. This could be something like the furnace coming on, a vehicle passing by, etc.
Thanks Kwinn, I have tried to use batteries, but that causes the Sensor to fired continuously. Don't ask me why. Might be because the Arduino I use is the NG-version that has trouble with external power?
Neverthelss, in the end I need to power it via USB anyway, butI slowly get tired of this sensor. It seems it is out of control and slowly detecting motion under my cup - with or without low-pass filter. It starts to depress me... it is not usable I am afraid.
kenken, I don't mind sending you another PIR sensor for comparison. Drop me your shipping address kgracey@parallax.com.
Thanks, Ken
Thank you for your offer of sending me a second PIR sensor for comparison.
I think I might really use it:
To exclude all errors on my side, I have borrowed another new Arduino board. With this one I was able to test the sensor with batteries. The sensor (still under a ceramic cup) kept detecting motion...
I used the same circuit and powered the PIR straight from a DC power supply, adjusted to 5.01 Vdc, and now it seems to be stable. The OUT measures 3.28V when it pulses High. So, since the PIR is designed to work down to 3.3 Vdc, I adjusted my PS to 3.34 Vdc and ran to circuit again. It is stable again with an Vout of 1.62 Vdc. Just to be 75% scientific on this one, I put the circuit back on the Arduino, still reading 4.97 Vdc, and it is still randomly flashing.
I had to make up for the other 25%, so I powered the Arduino with a AC-DC Wallwort converter, and ran it using the 9V, 7.5V and 6V settings. All of them allowed the Arduino to produce a stable 4.99 Vdc on the 5V pin and the sensor worked perfectly. There was only one last possible setup to test: Vin on the Arduino powered from the USB. The Vin was putting out 4.5 Vdc, and since the PIR works down to 3.3 Vdc, I gave it a shot and the original problem showed up again.
I don't have enough equipment in my basement to scope the Arduino power supply for noise, so I am going to conclude that it has something to do with the power coming from the USB. I'll have to poke around the Arduino forums for solving this issue; they might have more to say.
Trevor B
I connected the PIR + to 5V and the problem went away, but returned when I connected USB. In the KE Kit manual, the setup and testing section, it states that when no battery/power is connected, the LED should be dimly lit when USB is connected. Could this have anything to do with the false reading, eg. adding more power to the V+ bus on the bread board???
NOTE: I have the Parallax PIR sensor that was the first version, Rev A that has no rev markings, not the new PIR Rev B. I purchased it from Radio Shack.
So it works fine at 5V power without USB connected to the micro (Propeller in this case) for me. I have yet to test it out using 3.3V and connecting the PIR output to a micro pin, only tested with a led connected to gnd and PIR out.
Cover the sensor with a small box covered with aluminum foil or tape and see if the problem goes away. If it does the problem is NOT with the sensor or electronics.
I too found the same problem with PIR sensor when i was interfaced with Stellaris Launchpad board powered by usb. I searched a lot of websites, no one provided the correct solution. Still the same problem - continous false trigger by PIR sensor without Human presence. Finally i was landed on this page, as discussed in this thread, i have provided separate power supply to the PIR sensor and then connected the grounds of the power supply and MSP430 launch pad ground pin. Its works fine. So we have to provide the noise less power supply and not to use USB power coming from the PC or LAPTOP.
Once again Thank you all!
I am going to post the same on my site:
http://www.npeducations.com
Edit: I guess I misread...I thought you originally were not getting detection under the cup.
I've been following this thread very closely.
Interesting!
In the past, I've fabricated two projects using these PIR sensors.
One of them, my Billy Bones deer deturrent, uses a tube similar to Publison's comment in Post 3
This one works very good and is not affected by changes in ambient light or temperature.
I do realize that PIR sensors are sensing heat changes.
My second project was a Garden Owl deturrent.
The Garden Owl was an attempt at using the full PIR sensor field of view.
The Garden Owl works good from around sunset until about 9:00am.
After about 9:00am, it starts false triggering every few minutes.
This thread got me thinking that the PIR sensor is very sensitive in it's wide angle view.
Restricting the view, while it makes it more focused, makes it more usable.
Thats just my two cents worth.
I hope this helps resolve your troubles.
Gary