PIR false alerts
jknight291
Posts: 9
Hello,
I am trying to right up 3 Parallax PIR Sensors to activate a corresponding LED when activated. I am used the BOE and Basic Stamp 2. I have a simple If..Then syntax (see below) that I believe is working. However, when testing that the program works, I initially thought the PIRs as incredibly sensitive to environment changes all three LEDs would immediately light up when I sent the program, but after further investigation and testing, it seems that the PIRs are simply sporadic, there is no rhyme or reason to their activation. It seems as if the BoE is browning out, but that's impossible as I have changed the batteries and tested with electric power. The LEDs are just some random LEDs I picked up at Radio Shack with variable resistance.
Does it seem like there is something wrong with my code, or is this a power issue?
Thanks!
I am trying to right up 3 Parallax PIR Sensors to activate a corresponding LED when activated. I am used the BOE and Basic Stamp 2. I have a simple If..Then syntax (see below) that I believe is working. However, when testing that the program works, I initially thought the PIRs as incredibly sensitive to environment changes all three LEDs would immediately light up when I sent the program, but after further investigation and testing, it seems that the PIRs are simply sporadic, there is no rhyme or reason to their activation. It seems as if the BoE is browning out, but that's impossible as I have changed the batteries and tested with electric power. The LEDs are just some random LEDs I picked up at Radio Shack with variable resistance.
Does it seem like there is something wrong with my code, or is this a power issue?
Thanks!
' {$STAMP BS2} ' {$PBASIC 2.5} PAUSE 60000 'PIR Warmup DO IF (IN2=1) THEN HIGH 15 ELSEIF (IN3=1) THEN HIGH 14 ELSEIF IN4=1 THEN HIGH 13 ELSE LOW 15 LOW 4 LOW 13 ENDIF LOOP
Comments
For reference: http://forums.parallax.com/showthread.php?104867-Still-have-false-trigger-issues-with-the-Parallax-PIR-sensor....
Regardless, here is my question:
So, it looks like my issue is a power issue. If I do not want to use an external power source, would putting 10 kohm resistors on the PIR sensors fix this issue? Like I said before, the LEDs I have came with built in resistors, so I can't really adjust that, but I can adjust the PIR circuit. If I were to put the resistors on, would it be between Vdd or Vss? I'm concerned about burning them out so I just want to be certain.
To connect the LED's you should be able to easily connect them to the I/O pins and have a current limiting resistor inline with each LED. Unless the LED specifically has a built-in resistor (most do not) you need to add one. Typically a 470 ohm - 560 ohm is used for a 5V supply.
For the PIR you would connect ground, +5V, and then the signal line to an I/O pin on the stamp. If you are unsure if the LED's are working you can always use the debug output to send the value read in by each PIR sensor to the debug window on the PC.
You could also try the example in the PIR datasheet to test each sensor to make sure they are all working ok.
Robert
The LEDs I am using do have built in resistors, so I have them plugged directly to an I/O pin and Vss. They work individually when tested with a simple Do.. High.. Low.. Loop program.
Each PIR sensors works when tested individually using the DEBUG terminal and the information given on the data sheet. However, as soon as I run the above program, the LEDs start blinking sporadically - indicating the PIRs are being constantly activated; which is why I believe this is a power issue. Are the LEDs drawing too much? Would the resistor with the PIR help?
I don't know how much current the LED's are using but I don't think they should be a problem. How are you powering the board? Are you using a wall PS? What is the voltage/current rating on that? Can you measure the 5V supply to see if it at least appears stable?
How close are the PIR modules? Are they facing in completely different directions?
You said it works fine with a single module but not with three. How about with two going?
I'm not sure if multiple PIR modules will interfere with each other or not. That would be a good question for Parallax. You may want to call their support and ask.
Robert
In my setup, I have them in rectangular box of foam core with the side cut out. They are partitioned into three sections ("rooms"). See the picture I attached. In an attempt to reduce the sensitivity, I have further isolated each PIR with another "wall" blocking them from viewing outside of the box. The only way to activate them (in theory) is the reach around the wall.