Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for attached motion sensor on GPIO #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pieter
Copy link
Contributor

@pieter pieter commented Jun 20, 2019

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

@brutella
Copy link
Owner

That looks great.

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

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 brutella#5
@pieter pieter force-pushed the master branch 2 times, most recently from 667ac5b to 8a12572 Compare July 17, 2019 19:47
@pieter
Copy link
Contributor Author

pieter commented Jul 17, 2019

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

@cyberhusky69
Copy link

cyberhusky69 commented Aug 22, 2019

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

if err != nil {
log.Info.Panic(err)
}
pin := rpio.Pin(10)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that must be:

Suggested change
pin := rpio.Pin(10)
pin := rpio.Pin(motionPin)

@itaihay
Copy link

itaihay commented Apr 11, 2020

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

@sighmon sighmon mentioned this pull request Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants