I’ve always been fascinated by crows and their intelligence. Recently, I decided to try befriending them by feeding them from my rooftop. However, my initial attempts didn’t go as planned. Instead of attracting crows, I found that pigeons were eating all the food. I needed a way to ensure that only crows were getting the food, which led me to an idea: what if I used a camera and a bird feeder that only dispensed food when it detected crows? Inspiration
My inspiration came from an XKCD comic about bird detection, suggesting that we now have the technology to identify birds in a relatively straightforward manner. This got me thinking about how I could leverage existing bird identification technology to achieve my goal.
Research Phase
I began by researching bird identification models, only to find that vision-based bird identification isn’t widely available or highly accurate. However, I discovered that birdsong identification is a much more solved problem, thanks to tools like the Merlin app and BirdNET.
- Merlin Bird ID
- BirdNET-Pi GitHub Repository
The Merlin app’s ability to accurately identify birds by their songs gave me hope, but I faced another challenge: my rooftop doesn’t have a reliable internet connection, making cloud-based solutions impractical.
Solution: BirdNET-Pi on Raspberry Pi 4
Fortunately, BirdNET can run locally on a Raspberry Pi 4. I decided to set up BirdNET-Pi and test its capabilities. However, I quickly learned that the system’s performance heavily depends on the quality of the microphone and pre-amp.
After some trial and error and referencing discussions on the BirdNET-Pi GitHub page, I finally got the setup working reliably. BirdNET-Pi could consistently detect finches, crows, sparrows, and swifts day in and day out.
- BirdNET-Pi Microphone Discussions
- BirdNET-Pi Setup Discussions
Feeding the Crows
Crows are carnivores and scavengers, so I decided to use kibble (cat or dog food) as their food source. Automated cat feeders are quite common and work well for dispensing kibble, so I thought about modifying one to dispense food only when crows are detected.
I purchased the PetSafe Healthy Pet Simply Feed and cut out its control mechanics, adding a simple relay instead. The plan was to attach the Raspberry Pi to the relay and write a script that triggers the relay for a few seconds whenever BirdNET-Pi detects a “Corvus” species.
Implementation
- Modify the Feeder: I removed the timer mechanics from the PetSafe feeder and installed a relay that the Raspberry Pi can control.
- Attach the Raspberry Pi: Connected the Raspberry Pi to the relay.
- Write the Script: Developed a script to monitor BirdNET-Pi’s output for any detection of crows (Corvus species) and trigger the relay to dispense food.
- Add Delay: Included a delay in the script to prevent the feeder from dispensing food continuously when crows are present for extended periods.
Conclusion
After setting everything up, I finally had a system that only fed the crows when they were present, preventing pigeons from eating all the food. This project not only helped me achieve my goal of befriending crows but also provided an exciting challenge in combining bird identification technology with automated feeding systems.
Stay tuned for a video of my crow friends in action and a detailed guide on setting up your own crow-feeding system!