How to Make a Smart Agricultural Pest Detection and Repellent System Using Artificial Intelligence and Computer Vision

AI-Powered Solar Smart Farm Protection System

Project Category

Agriculture / Smart Farming / Artificial Intelligence


1. Introduction

Birds such as quelea, weaver birds, and crows, together with monkeys and baboons, destroy thousands of tonnes of crops every year. Farmers traditionally use scarecrows, dogs, and watchmen, but these methods are costly and often ineffective.

The Computer Vision Bird and Monkey Repellent System uses Artificial Intelligence (AI), Computer Vision, Solar Energy, and Ultrasonic Technology to automatically detect pests and scare them away before crop damage occurs.


System Overview

https://images.openai.com/static-rsc-4/UfZjo1Kugu_NfxjMxS3NrTP_oX10cCwWs3aurt-morjfnsa21U4b5przULuuAsiuoL_Lnp-AMt1YRLtE0sjRyFI5LwG2TAe9iVPMKhpAxOlvE2cREk57tYQNa7Fm0y2mveia5btaOU3E-lWtRzHmxKVTDeSrMLo6uK09CvaEQ7fy-FQWmbUPab_eZEhL3OvY?purpose=fullsize
https://images.openai.com/static-rsc-4/m0o-hzYoqKP0nWimAzRKMZLFrOgAzD42RSKdaULH1wawnGq_ehMRjlAFVnBP_iGAIOnanoypVFiPS6IokSpw0h4b29o85kHEoG9U7YZVGgK-OC1381lAX_nWi84wuej01fjyC1GO1FHiNNf1xqqSwK-jNWCEAgXN0q3qheSo7EJJXlR5j8yBLjJX3Fiy63fw?purpose=fullsize
https://images.openai.com/static-rsc-4/8mSoP932omD5I9rFTv81ETnYJqZWKYNS0hfgDqehTQKyzxyJ927lEBQKymMvl3_kq0x2I8QOlM5SbsVw9pJwPDeoNn6RlHh4WdzTJTFX3YKneIXDyJXHgkE0CUZJznx4gfh7sVH-SMKEyAwwBRUCDBLaOH6Ojr5cJidd2dnF1_CULvCPDsJQIK5S4dYfpqfH?purpose=fullsize

5

The system continuously monitors the farm using an ESP32-CAM. Once a bird or monkey is detected, ultrasonic sound, flashing lights, and alarms are activated automatically.


2. Objectives

Main Objective

To develop an intelligent farm protection system capable of detecting and repelling birds and monkeys automatically.

Specific Objectives

  • Detect birds and monkeys using AI.
  • Distinguish pests from humans and livestock.
  • Activate ultrasonic deterrents.
  • Send GSM alerts to farmers.
  • Operate entirely on solar energy.

3. Materials Required

ComponentQuantity
ESP32-CAM1
Arduino Uno1
Solar Panel (20W)1
Battery (12V)1
Charge Controller1
GSM Module (SIM800L)1
Ultrasonic Speaker2
PIR Motion Sensor1
LED Floodlights2
Relay Module2
Buzzer1
Mounting Pole1

4. AI Detection System

How Computer Vision Works

https://images.openai.com/static-rsc-4/WfaoR01hkXvSBlg_hbap2ei5l9YctURCETHldkHl-OK8LVo1-FwWkQdAVn5tc-1VJSo5rnVW_LVtjEfKE68wwGjtEv0n_538EKJ39mKsymYaAmnyNjl9Iy7ZgiSUvhpOkLJhWYo02Xb0y52oqT1hL4KBh0mDBgLXo4aLPLxhkAkx0bsUkpLvNH9k7s7SBzG7?purpose=fullsize
https://images.openai.com/static-rsc-4/uyMffPeCFq7erfsFrcbdrP7RzUpzCr-Xai9l4bCJB080EbbkMCWMNeeCUJRsfGgWeNBHnLvdbtk3jlJbJGRVtdVgE8CE5xZFK6-OofRMpy8yWc915jGk38OwwNxbn8mKvZwSVZyUMsSeeSGhMlGNqh5p6PdxxTTpXLdDfQgbkIhmLE6yiWZoBJsW02bGDoAR?purpose=fullsize
https://images.openai.com/static-rsc-4/EJ7yB5XbUCrxBDECV1KU6RJ7jvVrjwQI6lmz7gpz3MERvDr4QLt09l7QwwSM9aRpdei0gO-oqOtMjKoYwyjQAC6HbB6smEUPW41g60_iSCfbaqExPLPkvbA4GQmHHBZ3dGheNZv9vMxC9aZst0tctyLNfDgLj82qq7IcUPdud8mUL5ohxeNsgO5uOZ1St-1-?purpose=fullsize

6

Step 1: Image Capture

The ESP32-CAM captures images every second.

Step 2: Image Analysis

The AI model analyzes:

  • Shape
  • Size
  • Movement
  • Color patterns

Step 3: Object Recognition

The system identifies:

Detected ObjectAction
MonkeyActivate Repellent
BaboonActivate Repellent
Quelea BirdActivate Repellent
Weaver BirdActivate Repellent
HumanIgnore
CowIgnore
GoatIgnore

Step 4: Alert Generation

An SMS is sent to the farmer indicating the detected pest.


5. Ultrasonic Repellent Technology

https://images.openai.com/static-rsc-4/IapmT-NCh4x_85KsoRJIMuKXqF_Ls3x86cP5JN9_OKmG2nVM9zvhm68Xd2691H8ItoVYUXisOyI-FyhXTjr6AolL5fKefJEektLNeJlQjrMavM_2oTAKrB1YUZPDDguUvUK4ckMLzbVkz3zGGU9Ql2jCV0xt_h7Cu-DqYgqurcoYbKDkuwwGY28KM9sis8UH?purpose=fullsize
https://images.openai.com/static-rsc-4/l9v01pGL4MBk3Q921u3lmzhcnxwOjfDbc2qXWgzh00y0y8jGnqOVDh3-x5P3VdFxY_nncDEbVE53Dx6QYOko2Wdeh_N_5moveBjY1otafTq-akVmTb57-PnD3HZtUyYro-OmvW6uu5H1XnIJzB_Fy37vnuSXUje3t8O3h57IFRJF0bZyWNp1iB-KFjCWcc6b?purpose=fullsize
https://images.openai.com/static-rsc-4/8Ix83F3ANoGD6yLhTQrowFKoUFGrDAaLsqnXRzmGUUH52mJszwsHQrsqZJ_gJSKJKC9CvcIyKqg7Xguw7ooEAUKb0UdvekYdut2ACuVDwKlA8nKeVLipI1u31pXnq2nBhjP7lC5VzAUpRJPrCCiuY56E758WDFnhzhia0BFqLAsN8SLNSwtxYCdS-IXUWfpi?purpose=fullsize

5

The system emits ultrasonic frequencies that animals dislike.

Frequency Settings

AnimalFrequency
Birds20–25 kHz
Monkeys30–40 kHz
Baboons35–45 kHz

Additional Deterrents

  • Flashing LED lights
  • Random alarm sounds
  • Motion-triggered activation

This prevents animals from becoming accustomed to the deterrent.


6. Solar Power Section

Power Supply

https://images.openai.com/static-rsc-4/mucDrRykhlAV0f8NckCiQ7BLuX32Ni96kaXNo4w1d0MwRyOJcsXnJkme1UzY7g3dNgbz0M2qdJFxsCk504Z3ptWUAXx0VP9RHhXK2ILBJA6qCm9m5IMeqanepMLifhXxXRj9EORNXiNYmMg-8UIqweEUe4OTLMaQOw3IkkDxLfJqnxlRaJ_xRFOb8zbQbGh7?purpose=fullsize
https://images.openai.com/static-rsc-4/Y6PHQRrfNfEtFirGM1NyofX39Uuu5vBcF_w4jVDJYAaWPANIwnqzdNcy2KA5wbqILtD4t_ZyL1oCtaue0kwjG1tit81Vo_FICyaSjJh4XIx9gkZ1QCQjPQg66KOoikRX8Ho8VlkQDXLGFt-NcfEVeti-r81xc5COPIxdXUILfYz9B9yfxQzKa-dbd_9vnA_a?purpose=fullsize
https://images.openai.com/static-rsc-4/__X7KAO_JN9QAiihcd5SIcPRfMYzV0VKdqjX96ptfY7pcvH6lSMlxhtPXCJw49uKzPuxDpNMm_5gnBZ4DalI0CszF3VHmQncfqKX0FCfOpjgkoE7ZS24prK53sKZyPDJmTgDFtjlfSMCMYIr28NKqX9PXp_Uu7szURyDp7sna_qVJ75j3kQOPyUSzU_IHN6D?purpose=fullsize

5

Components

  • Solar panel
  • Battery
  • Charge controller

Advantages

✔ Operates day and night

✔ No electricity bills

✔ Suitable for remote farms

✔ Environmentally friendly

✔ Low maintenance


7. System Block Diagram

                SOLAR PANEL


CHARGE CONTROLLER


BATTERY


ESP32-CAM

┌─────────────┼─────────────┐
▼ ▼ ▼
AI MODEL GSM MODULE SD CARD


OBJECT IDENTIFICATION

┌──────┼────────┬─────────┐
▼ ▼ ▼ ▼
LEDs BUZZER ULTRASONIC SMS


BIRDS & MONKEYS
REPELLED

8. Experimental Procedure

Farm A (Control)

Traditional scarecrow.

Farm B (Experimental)

Computer Vision Repellent System.

Duration

30 days.

Parameters Measured

ParameterFarm AFarm B
Bird VisitsRecordRecord
Monkey VisitsRecordRecord
Crop Damage (%)RecordRecord
Yield (kg)RecordRecord

9. Expected Results

ParameterBeforeAfter
Bird Damage35%5%
Monkey Damage28%3%
Labor CostsHighLow
Yield100 kg145 kg
SecurityPoorExcellent

10. Innovation and Uniqueness

Unlike ordinary scarecrows and alarms, this project combines:

  • Artificial Intelligence (AI)
  • Computer Vision
  • Internet of Things (IoT)
  • GSM Communication
  • Solar Energy
  • Precision Agriculture
  • Wildlife Management

This makes it a highly competitive project for KSEF Regional and National competitions.


11. Future Improvements

  • Drone-assisted farm patrol
  • Mobile App Monitoring
  • GPS Pest Mapping
  • Thermal Night Vision Cameras
  • Cloud-Based Analytics
  • Weather Prediction Integration
  • AI Yield Forecasting

Conclusion

The Computer Vision Bird and Monkey Repellent System provides a modern, environmentally friendly, and intelligent solution to crop destruction by birds and monkeys. By combining AI image recognition, ultrasonic deterrents, GSM alerts, and solar power, the system improves crop protection, reduces losses, and increases farm productivity while demonstrating cutting-edge agricultural technology.

  • mbeva

    Dominic Mbeva is a science teacher, experienced researcher, innovator, and creative technologist with expertise in STEM education, digital media, and scientific research. As a Kenya Science and Engineering Fair (KSEF) advisor and projects manager, he mentors young scientists, guiding them in developing award-winning innovations. He is also an IC Technorat, leading advancements in science and technology. Beyond education, Dominic is a skilled photographer and video editor, using visual storytelling to make science more engaging. His philosophy, “If you take care of minutes, hours will take care of themselves,” reflects his belief in consistent effort, strategic thinking, and innovation to drive success in both research and creativity.

    Related Posts

    How to Build a Solar Smart Livestock Watering System with Automatic Refilling, Water Level Monitoring, Animal Drinking Records, and Solar Power

    KSEF Agriculture Project Abstract Livestock require a constant supply of clean water for proper growth, milk production, reproduction, and disease prevention. Many farmers face challenges such as water shortages, overflowing…

    Read more

    HOW TO MAKE HYBRID AI-GSM SOLAR DESALINATION AND SMART WATER PURIFICATION PLANT

    A Climate-Smart Water Solution for Rural Communities Access to safe drinking water remains one of the greatest challenges in many rural and arid regions. Water sources are often contaminated by…

    Read more

    Leave a Reply

    Your email address will not be published. Required fields are marked *