Inspiration
We all know turrets as a military weapon, but they can be fun and incredibly cool little devices when built at a small scale. However, we thought of how we could use a turret in a useful but non-harmful way.
What it does
PestPal uses computer vision from a normal and an IR camera to detect pests in fields, such as coyotes, rabbits, and other small, moving animals. The animal is then followed by the turret, shining a laser pointer at the pest in an attempt to annoy it into leaving. In a real-world application, a stronger but non-harmful laser would be used (class 3B instead of the current class 3R).
How we built it
Most of the code is run on a Raspberry Pi 4B, which is connected to a 4-ch stepper motor driver and the two cameras (webcam and USB infrared camera). Although this driver is an arduino shield, it is the only one we had on-hand and thus had to use an Arduino to ensure smooth operation and pull the enable pin low. The laser is driven through a NPN transistor and is a simple laser pointer we modified. Additionally, we created a circuit using a LD2410 24Ghz sensor and a MOSFET, which detects the signature of any living object to turn on a 1W LED whenever it is pulled high, indicating that it has detected something.
Challenges we ran into
We ran into several issues driving the stepper motors, mostly due to dead controllers. We spent several hours debugging to isolate the issue and come to the realization that the driver sub-modules on the board were faulty. Thankfully, we had replacements. Our second biggest hurdle came with the software implementation, primarily in using both camera feeds from the IR and RGB cameras to produce useful results, and then mapping that into a coordinate system for positioning the stepper motors. Although we had more ambitious plans in terms of software, such as including a web dashboard for detection alerts, we didn't have sufficient time to implement them.
Accomplishments that we're proud of
I believe the fact that we got a full turret built in 36 hours is an accomplishment we are very proud of, considering the challenges in the hardware connections and the designs we made and 3D printed during the duration of the hackathon.
What we learned
We learned a lot, especially in terms of hardware. This was our first time dealing with stepper motors, and a lot of the components were used since they were borrowed from a friend. We had to research and learn as we went along, and ended up reading more pages of documentation than I can count
What's next for PestPal
Our next goals are to further optimize the code and parameters/calibration for better detection, since the logic for this application will be inherently complex. We hope to refine it for better tracking and accuracy, along with using a more effective deterrent than our current laser. It would also be nice to 3D print the body of the turret fully, since the base is currently made with cardboard.
Built With
- arduino
- opencv
- python
- raspberry-pi
- tensorflow

Log in or sign up for Devpost to join the conversation.