Uses Computer Vision to keep an automated eye on your garden. If it detects any animals in the scene, it plays a sound of a barking dog through the loudspeaker to scare away the animals.
I'm trying to establish woodsorrel clovers as a beautiful groundcover. But I'm having trouble getting them established. Because deer keeping eating them. So I set up a raspberry pi with a loudspeaker and a camera to bark at the deer. It's all running on power-over-ethernet.
pip3 install -r requirements.txt
You need to customize the framegrab.yaml
file to point to the correct camera.
See framegrab for reference, but this
file is a pretty good starting point. It can use a local Raspberry Pi or USB camera,
or most any networked RTSP camera.
You can check that the camera code is all working properly by seeing a preview in your terminal (if you have an advanced terminal program such as iTerm2).
python3 trycamera.py
Make sure the sound is working properly:
python3 dogsound.py
If you'd like a different sound, just install a new .mp3
file.
You can use a free Groundlight account. Then get an API token and save it as an environment variable:
export GROUNDLIGHT_API_TOKEN="api_..."
python3 app.py
You might want to edit the motion detection parameters to make it more or less sensitive.
I used a Raspberry Pi 4 with a camera module. It will work anywhere you have the right python and libraries installed. I used Groundlight's pre-built Raspberry Pi image.