hkcam icon indicating copy to clipboard operation
hkcam copied to clipboard

Add support for attached motion sensor on GPIO

Open pieter opened this issue 5 years ago • 4 comments

I don't know Go so I don't really know what I'm doing. Also I don't have a HC-SR501 myself yet, so this is more theoretical, but figured it might be useful for some.

This assumes running on Raspberry Pi, using an HC-SR501. This device outputs a HIGH signal when motion is detected, or a low signal when no motion is detected after a certain delay.

Can be set by specifying --motion_pin to the GPIO pin on the raspberry to which the HC-SR501 data pin is connected.

Implements #5

pieter avatar Jun 20 '19 17:06 pieter

That looks great.

I do have a HC-SR501 IR motion sensor. Hopefully I can test the pull request asap.

brutella avatar Jun 21 '19 08:06 brutella

FYI I tested this change today with an actual sensor, and the motion device in Homekit worked perfectly.

pieter avatar Jul 17 '19 19:07 pieter

Hello I'm new here but find the hkcam project very intreresting. Does the motion detection also work with Doppler radar sensor RCWL-0516 ? The main advantage over PIR sensors are the can be placed inside a case, have a higher range like 7 m and only detects human or animal motions (as they react on water inside bodies). This way the cam only detects motions it should and not vaccuum cleaners moving around or plants moving through wind.

The connections between the Pi and RCWL-0516 are as follows. Raspberry Pi RCWL-0516 5V VIN GND GND GPIO17 OUT

More infos on how to connect this motion detector can be found here https://www.electromaker.io/tutorial/blog/using-a-doppler-radar-sensor-with-the-raspberry-pi-12

cyberhusky69 avatar Aug 22 '19 09:08 cyberhusky69

Is there any way to get this PR approved and documented a little? It's exactly what I'm looking for

itaihay avatar Apr 11 '20 14:04 itaihay