Logo Garden Defender  1.0
Garden_Defender

Garden Defender Logo

Description

WhatsApp Image 2023-04-06 at 18 43 52

Protect your garden from unwanted animals with the garden defender. The garden defender is a robotic water pellet gun that deters unwanted animals by shooting at them with a water pellet. The robotic gun will continuously scan your garden with a webcam. With the combination of computer vision and a deep learning algorithm “YOLO”, the garden defender can detect and distinguish between a “friendly” and “unwanted guest” before shooting a water pellet.

Details

In most cases, a fence or a garden wall is not enough to prevent unwanted animals visiting your garden. This is particular true for gardeners who like to grow vegetables. Animals such rats and birds might see your vegetables as free food. Or your neighbourhood cat might have taken a liking to your lawn as its personal toilet.

One solution to deter these “unwanted guest” is by shooting at them with a water gel pellet. The garden defender has a webcam that continuously scans your garden. When an “unwanted guest is detected”, the garden defender with aim and shoot.

Features

  • Detect unwanted guests: OpenCV and a deep learning algorithm “YOLO” was used for object detection.
  • Aim and shoot: When an unwanted guest is detected will aim and shoot
  • Garden surveillance - large field of view: Robot will continuously move web cam left and right to maximise the field of view when an unwanted guest not detected.

Please, watch our video:

Garden_Defender

Documentation

For code documentation go to: https://ernestoflores27.github.io/Garden_Defender/html/index.html

Build

For full building instructions go to: Full build guide

Installation

Required packages:

Installing Raspberry Pi OS:

  1. Download package.
  2. Install Raspberry Pi OS on your PC.
  3. Insert SD card into your PC.
  4. Open Raspberry Pi Imager.
  5. In Operating system select: Raspberry Pi OS (32-bit)
  6. In Storage select your SD card.
  7. Select setting and add your WIFI name (SSID) and password.
  8. Finally, click on Write.

Installing Cmake on RPI:

1.-Open terminal.

2.-Installation:

cd
sudo apt-get install cmake

3.-Verification:

cmake --version

Installing Pigpio on RPI:

1.-Open terminal.

2.-Installation:

cd
sudo apt-get install pigpio

3.- Verification:

pigpio --version

Installing PCA9685 on RPI:

1.Follow the installation as shown here: https://github.com/vanvught/rpidmx512/tree/master/lib-pca9685

Installing OpenCV on RPI:

1.-Open terminal

2.-Download:

wget https://github.com/sol-prog/raspberry-pi-opencv/releases/download/opencv4rpi2.1/opencv-4.1.0-armhf.tar.bz2

3.-Extract:

tar xvf opencv-4.1.0-armhf.tar.bz2

4.-Move folder:

sudo mv opencv-4.1.0 /opt

5.-Remove folder:

rm opencv-4.1.0-armhf.tar.bz2

6.-Install requisites:

sudo apt install libtiff-dev zlib1g-dev
sudo apt install libjpeg-dev libpng-dev
sudo apt install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev

7.-Add OpenCV to the system library path:

cd ~
echo 'export LD_LIBRARY_PATH=/opt/opencv-4.1.0/lib:$LD_LIBRARY_PATH' >> .bashrc. .bashrc

8.-Clone config file:

cd ~
echo 'export LD_LIBRARY_PATH=/opt/opencv-4.1.0/lib:$LD_LIBRARY_PATH' >> .bashrc. .bashrc

Clone this repo using

git clone https://github.com/Ernestoflores27/Garden_Defender.git

Build using cmake

cd Garden_Defender
make

Run

sudo Garden_Defender/build/garden_defender

Social Media