hmar2
New Member
Posts: 4
|
Post by hmar2 on Nov 9, 2016 22:18:23 GMT
I have Arduino/Raspberry Pi setup from Computourist running excellently except for one thing. I have noticed that many PIR detectors trigger detection of motion when there is nothing to detect. I have tried with pull-up resistors, pull-down resistors but out of the 5 PIR-detectors I bought only 2 are trustworthy. The other 3 detects motion either every time the radio transmission is on to send the temp/humidity readings (every minute) or once/twice every 3-4 hours. Neither is acceptable. I've read on Adafruit's site that these detector can be sensitive to wifi signals and it's recommended to separate the them as much as possible. But with the RFM69HW the problem should even worse since the RF power is significantly higher from our chip than from a wifi chip. How have you guys managed to solve this? I've read that papa used a 10k pull-down resistor and others 10-20k pull-up resistors. I cannot be the only one struggling with this, right?
Cheers
|
|
|
Post by greginkansas on Nov 10, 2016 1:26:28 GMT
I must have got lucky 3 out of 5 work good for me. I do think its the cheap PIRs more than anything.
|
|
|
Post by papa on Nov 10, 2016 15:21:08 GMT
Yes, hmar2 (& greginkansas), it's tricky getting acceptable PIR results: detecting "presence" most times, but avoiding most false triggers. No doubt manufacturing quality may be a factor (One of 3 I used seemed defective.) Also how one places the device (distance & aim) plus 3 places on the PIR device for customizing (repeatable trigger & the 2 variable resistors). Moreover as I remember from my research & experience, false PIR triggers often happen from the electrical power drawn from the Arduino when the RFM69 radio is sending data. Coding some delays seems to help (For more on this, see the posts listed in the next paragraph.) hmar2, I cannot tell what code you are using or how much you read / tried in what I posted related to PIRs. It might help if you study my thread here, especially the posts: 12/17/2015 at 7:56pm & 8:14pm AND 12/22/2015 at 9:04 am (except use the sketch I refer in the next sentence), 9:28am, & 9:32am. You might use the updated sketch posted here & customize the following "defines" appropriately: PIR, PIRHACK, GW24, NODEID, ENCRYPTKEY, DEBUG, FREQUENCY, & IS_RFM69HW. You might look at sketch sections that start with "ifdef PIR" The sketch uses Arduino pin D3 to receive PIRinput. Note: In the above, I was not very satisfied with my attempts to power a PIR node with battery, but then again, I was not using good quality Lithium ion batteries.
|
|
hmar2
New Member
Posts: 4
|
Post by hmar2 on Nov 10, 2016 17:40:56 GMT
Thanks for the elaborate answer, papa! Great!
I'll have a look at the sketch within the next few days. I fully agree that the false triggers appears when the node is transmitting data. But I am not fully convinced it is the drained power during transmission that's the root cause. I also tried with an external power supply for the PIR detector and the false triggers continued as I increased the supply voltage. At around 7 V there was an improvement, but not for every single detector. I also thought I could see a correlation between the position of the PIR detector relative to the helicoil antenna. It appeared to be favourable to place the detector "above" the antenna and worse on the side of it. Although not being an expert on radiation pattern from such an antenna, I believe it emits similar to a mono- or dipole antenna, i.e. perpendicular to the antenna itself. Hence, my conclusion was that its EMI causing the false triggers. But I am def not convinced on that either.
Since I am using 3.3 V arduino pro mini clones at the nodes, I do not want to have to supply both 5 and 3.3 V. So I "hacked" the PIR detectors by bypassing the diode and the regulator by soldering a wire from before the diode to the regulator output leg. If it is the drop in supply power that's causing the false triggers, then I've just made it worse I'm afraid...
I used the Computourist Gateway 2.4 and the DHT node 2.2 code as a starter and modified it slightly to my needs. The gateway itself is a Bouno switch to 3.3 V with an Ethernet shield, like most do.
Cheers
|
|
hmar2
New Member
Posts: 4
|
Post by hmar2 on Nov 10, 2016 18:13:33 GMT
Papa, From what I understand from the code, if I'm not using sleep mode then the only modification I need to do is a delay(3600) after transmission (in function sendMsg) and in the beginning of every loop. Is that correct? It is not enough with the delay right after transmission?
Cheers
|
|
hmar2
New Member
Posts: 4
|
Post by hmar2 on Nov 10, 2016 19:46:13 GMT
Actually, this will only work if the time the detector is ON is shorter than the delay time, since the detector will still give a false trigger but we're just not detecting it on the digital input.
Cheers
|
|
|
Post by papa on Nov 10, 2016 21:27:45 GMT
Yes, hmar2, since you are using a hacked PIR sensor, those two delay(3600) worked best in my experience. You may need to experiment with HOW LONG of a delay works for you. Caution: Without one modification, a Buono plus Ethernet shield Gateway can supply hazardous voltage to the RFM69 radio. See my thread here, at the Sep 22, 2016 at 2:58pm post for an explanation & a fix. Papa: That's an intriguing theory that the PIR false triggers are caused by EMI interference (depending on PIR sensors' position relative to emitters). If the delays truly help avoid false triggers (as they seemed to for me), how does that confirm or question the theory? Could the PIR false triggers be caused by the RFM69 send's power drain AND by EMI interference? Keep us posted on what you learn. More reliable PIR sensor results would be helpful to this DIY Home Automation project.
|
|