An open API service indexing awesome lists of open source software.

https://github.com/robotrapta/garden-watcher

Artificial Dog to bark at deer and other garden pests using Raspberry Pi and Groundlight
https://github.com/robotrapta/garden-watcher

computervision gardening raspberrypi

Last synced: 8 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# AI Garden Watcher

Uses [Computer Vision](https://pypi.org/project/groundlight/) 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](./media/needs-protecting.jpeg)
[The Enemy](./media/the-enemy.jpeg)
[Our tool](./media/our-tool.jpeg)
[Our tool](./media/the-tech.jpeg)
[Power over ethernet](./media/poe.jpeg)
[The whole scene](./media/the-whole-scene.jpeg)

# 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](https://github.com/groundlight/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](https://iterm2.com/)).

```
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](https://code.groundlight.ai/python-sdk/docs/getting-started/api-tokens) 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](https://github.com/groundlight/groundlight-pi-gen).