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
- Host: GitHub
- URL: https://github.com/robotrapta/garden-watcher
- Owner: robotrapta
- License: mit
- Created: 2024-06-12T02:06:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T01:45:15.000Z (about 2 years ago)
- Last Synced: 2025-02-01T12:44:13.436Z (over 1 year ago)
- Topics: computervision, gardening, raspberrypi
- Language: Python
- Homepage:
- Size: 5.45 MB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.
[
](./media/needs-protecting.jpeg)
[
](./media/the-enemy.jpeg)
[
](./media/our-tool.jpeg)
[
](./media/the-tech.jpeg)
[
](./media/poe.jpeg)
[
](./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).