Oh, Deer!
Using a Raspberry Pi and computer vision, a DIY device detects deer and plays a dog bark sound to scare them off, protecting valued clovers.
Gardening is challenging enough for those of us that do not have a green thumb, so we certainly do not need any other difficulties standing in our way. I can say with total confidence that there is no positive correlation between good soldering skills and the ability to grow a thriving tomato plant. So when we finally do see those green shoots grow up into a healthy garden, the last thing we want is to find that the local wildlife has made a dinner of it.
GitHub user robotrapta lives in a heavily-wooded area of Washington state and is trying to get a nice layer of woodsorrel clovers to grow as ground cover. However, robotrapta shares those woods with a substantial population of deer, and as it turns out, deer happen to find woodsorrel clovers irresistible. Just as soon as they start sprouting, the deer come along and chow down on the tender clovers.
One of the more effective ways to scare deer off is to own a dog. But that is a big commitment — owning a dog can be a whole lot of work. That is not a job that robotrapta wanted to take on, but as a self-described geek, robotrapta decided to build a technological solution to the problem. The basic idea was to use computer vision to watch for animals, then when one was recognized, play a dog bark sound over a loudspeaker. A dog without a dog. Pretty clever, huh?
The system uses a Raspberry Pi 4 single-board computer for processing, and a Raspberry Pi Camera Module to snap pictures. The components were placed in a weather-resistant case and mounted on a tree. Being a geek, robotrapta naturally already had cables for power-over-Ethernet run to that tree (for a Wi-Fi access point), so the entire device could be powered by that line.
The software works by continually snapping a stream of images, and first running them through a simple motion detection algorithm. When a large enough motion event is detected, the frame is then analyzed by a computer vision machine learning model from Groundlight. If this model predicts that an animal is the cause of the motion, it will then trigger the loudspeaker to play the sound of a dog barking.
This should be enough to set a deer to flight, but the system has only been in use for a few days and no deer have come by (camera shy, maybe?), so it is not proven yet. robotrapta is hoping to have some videos of deer thinking twice about their meal choice in the near future, however, so stay tuned. Let's just hope that they do not learn that the bark is worse than the bite.
Source code and installation instructions are available on GitHub under a permissive MIT license, so go grab them if you have some pests you need to get rid of. It looks like a simple and inexpensive build.
R&D, creativity, and building the next big thing you never knew you wanted are my specialties.