Dubman
Posts: 122
Joined: Thu Mar 15, 2018 3:53 pm

Combining PIR and normal motion detection?

Thu Sep 12, 2019 2:58 pm

Hi, I have a python script that includes code for PIR detection in a home security system, but I get too many false alerts, probably moreso on very warm sunny days. The sensor is in the open air.
Is there a way l could add in a normal motion detection trigger that detects only movement? The idea being that the alert email only gets sent when both types of sensors are triggered at the same time, thus hopefully reducing false alarms. Any ideas how I would go about setting it up?

The pir sensor is installed with a wood sun shade, so no direct sun reaches the sensor.
Thanks

pcmanbob
Posts: 6939
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Combining PIR and normal motion detection?

Thu Sep 12, 2019 3:10 pm

When you say a " normal motion detection trigger " are you talking about a pir motion detector using in a normal alarm system ?

IE one of these
Image

If so then yes you can use the output of one of those type of pir sensor , they normally have a volt free output contact for both alarm and tamper,
but you would also need to provide power to it , which is normally 12v DC

But they still use a pir for the motion sensing so may also be affected by sun light or hot rising air.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Dubman
Posts: 122
Joined: Thu Mar 15, 2018 3:53 pm

Re: Combining PIR and normal motion detection?

Thu Sep 12, 2019 6:59 pm

Yes, I am currently using a pir sensor, a bit like the one in the previous post. I was wondering if it may be possible to also add another "in camera"
type sensor capable of detecting movement, with the objective of reducing false alerts. I'm using the Rpi camera module. Would motioneyeos be a solution?

pcmanbob
Posts: 6939
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Combining PIR and normal motion detection?

Fri Sep 13, 2019 9:42 am

We you could run motioneyeos and do motion detection but I don't know if it will interface with your existing code, motioneyeos would normally be used to trigger video recoding within its self using its own motion detection.

From this statement " normal motion detection trigger " I thought you wanted to add different pir hardware.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Dubman
Posts: 122
Joined: Thu Mar 15, 2018 3:53 pm

Re: Combining PIR and normal motion detection?

Fri Sep 13, 2019 11:08 am

The thing is that it's so hard to avoid false alarms and I suspect even harder when relying on only "in camera" type detection - that's why I thought of combining both (PIR and "in camera") together.

I know that it's possible to install a dual PIR plus microwave type detector, but I don't like the idea of the detector emitting microwaves in case they might be damaging to health in some way.
Thanks

PhatFil
Posts: 1368
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Combining PIR and normal motion detection?

Fri Sep 13, 2019 12:16 pm

I had fun and games with false positives from the usual pir modules with my attempts at a room multi sensor.. Forums and utubes were full of suggestions to shorten connecting leads, lengthen connecting leads, distance the module from the wifi transmitter and sources of pcb heat, twisting wires , iirc Andreas Spiess (Swiss Accent Utuber) investigated too..

In the end i gave up and bought off the shelf battery operated PIR devices with 433mhz transmitters intended for pairing with alarm systems. (Be mindful that the very cheapest options can use more expensive 12v 23A (not amps, just a number designation) camera batteries )
https://www.aliexpress.com/premium/sens ... _new_app=y

To pick up the 433mhz signals from the PIR devices you can wire up a receiver to the gpio and read the input, i cheat and use a tasmota rf bridge solution to decode 433mhz signals and echo them as wifi/mqtt.
https://github.com/arendst/Sonoff-Tasmo ... Bridge-433

I then found another utube recommending alternative sensors to solve the issue?? https://www.youtube.com/watch?v=jpjfVc-9IrQ
I have not tried these though as the cheap battery units simply work and are cheaper than i could build.

billw
Posts: 402
Joined: Tue Sep 18, 2012 8:23 pm

Re: Combining PIR and normal motion detection?

Fri Sep 13, 2019 2:01 pm

You could run pikrellcam without enabling motion detect videos because it always writes motion detects to a FIFO regardless if it is enabled to record videos. There is an example script example-motion-detects-fifo that reads this motion detect fifo to get all motion detects and you could combine your PIR detecting code with this script to know when you get both types of motion.
https://www.raspberrypi.org/forums/view ... 3&t=115583

Dubman
Posts: 122
Joined: Thu Mar 15, 2018 3:53 pm

Re: Combining PIR and normal motion detection?

Fri Sep 13, 2019 3:50 pm

Thanks for those suggestions. Hopefully I might manage to implement one of them.

Return to “General discussion”