Amidst the coronavirus crisis, people around the world are turning to home-gardening as a soothing, family friendly hobby that also eases concerns over food security as lock downs slow the harvesting and distribution of some crops. As a result, fruit and vegetable seed sales are rising up to 300% in many parts of the world.

However, one of the more unpleasant aspects of gardening is dealing with pests. Whether they come by ground or sky, a reliable food source is their highest priority and they won’t hesitate to tear up a lawn and chew on some crops. The US Department of Agriculture estimated that at least 20% of US crops are lost to pests each year, a number that jumps up to 50% in developing countries. In spite of our current pest-repelling techniques, we’re losing a significant amount of food on a global scale in a time when we need it most.

Conventional solutions rely on big, ugly fences that ruin the aesthetic of any home garden and can’t be scaled up to industrial farms. So, we prototyped a security system that detects and deters user-selected pests in a garden or farm. The technology is extremely affordable and simple enough to be used by anyone from hobbyists to industrial farmers. This is how it works:

The unit itself is made out of nothing more than a camera and buzzer. Our code detects uses a haar cascade, a machine learning object detection algorithm, to identify various rodents, squirrels, birds, and more. When it detects one of those, it uses serial communication to tell an arduino to trigger the alarm system, which results in the arduino's buzzer making a loud enough sound to scare any small animal. Our dependencies were open CV for facial recognition, numpy for data manipulation, pyserial for serial communication, and Tkinter for a stable and elegant UI display.

One of the biggest challenges we faced was trying to get the machine learning object detection algorithm to work, and how to get it to communicate with the arduino. Additionally, the integration of the GUI and the code of the algorithm was also a hard problem for us to solve. If we had more time, we would have attempted to make the arduino mimic the noise of each animal's natural predators to scare them away with even greater success.

Built With

Share this project:

Updates