/garden-watcher

Artificial Dog to bark at deer and other garden pests using Raspberry Pi and Groundlight

Primary LanguagePythonMIT LicenseMIT

AI Garden Watcher

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.

Motivation

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.

Woodsorrel needs protecting The Enemy Our tool Our tool Power over ethernet The whole scene

Setting up

Installing python dependencies

pip3 install -r requirements.txt

Camera configuration and preview

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

Checking the sound

Make sure the sound is working properly:

python3 dogsound.py

If you'd like a different sound, just install a new .mp3 file.

Groundlight account setup

You can use a free Groundlight account. Then get an API token and save it as an environment variable:

export GROUNDLIGHT_API_TOKEN="api_..."

Running the real thing

python3 app.py

You might want to edit the motion detection parameters to make it more or less sensitive.

Hardware

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.