TL;DR: I built a wifi-equipped water gun to shoot
the pigeons on my balcony, controlled over the internet by a
python script running openCV reading the camera image of my
old iPhone.
The pigeons in my backyard find particular pleasures in voiding their excrements onto my balcony. Dissatisfied with this situation, I went online to find a solution. I created a handy table to give you an overview of the vast number of effective established ways to get rid if pigeons:
Approach | Why it doesn’t work |
---|---|
Plastic crows | Pigeons get used to them |
Crow stickers | Pigeons get used to them |
Reflective wind mills / CDs / … | Pigeons get used to them |
Sounds of animals (dogs, predators) | Pigeons get used to them |
Dog and cat hair | Pigeons get used to them |
Ultrasonic sounds | Hear me out: Even the people advocating for it admit that pigeons (like humans) are incapable of perceiving ultrasonic sounds. Instead they think that pigeons are wavies and that the mere presence of some imperceptible waves somehow distress the pigeons. You can’t make this stuff up. As might be expected, nobody ever had any success with it. |
Shooting pigeons | While it would certainly help coping with the distress of cleaning their crap, its highly illegal in Germany and even after one of my neighbours apparently tried it (I just saw the police leaflets) the number of pigeons didn’t noticeably decrease. To be fair, some random neighbour with an air rifle is probably no comparison to the olympic pigeon killers of the past. |
Getting a cat | That should actually work if the cat has regular access to the balcony. But I don’t have a cat and it would probably suicide itself in its attempt to hunt pigeons in the fifth floor. |
Spikes | They work IFF you buy the right ones AND put them absolutely everywhere AND are careful to actually mount them correctly AND you don’t plan to use the area covered yourself at all AND you don’t even want to look at its disgraced looks. So it is completely pointless for a balcony. |
Nets | They work if you can tolerate their looks (I don’t) and mount them correctly. In practice they are often mounted incorrectly so you have to remove dead or alive pigeons on a somewhat regular basis. |
Scaring them away by shouting, water gun, clapping, etc. | Pigeons get used to it. Also you typically spend way too little time on the balcony to do keep them away permanently. But what if I outsourced the water gunning to some robotic contraption? |
After a quick burst of manic energy during exam phase, I decided to solve the pigeon problem on my balcony once and for all (and in a humane way). The idea was quite simple: Mount an electric water gun on my balcony, detect pigeons with a web cam and shoot them. Pigeons should not get used to getting sprayed at (at least not while its coldish), I don’t have to disfigure my balcony and I’m not harming the pigeons in any way or even risk killing them. As I approached this project during my exam phase, it should also be quick to implement using things I already have laying around.
I bought a cheap electric water gun from Amazon and tested it out: The range of around 3-4 meters is pathetic, but plenty for my balcony.
Next, I opened it up to figure out how to control it over the internet:
I chose one of my trusty Wemos D1 Mini boards as the brain if the
water gun. They are small, cheap, offer Wifi and have some shields
available for them that ease cabling. In particular I’m using the
relay shield. (Relays are basically electrically operated
switches).
To control the water gun, I inserted a small paper contraption
in the battery department that allows me to break the gun’s
power and added a small hole for the cables:
The microcontroller is powered by a USB power bank which is convenient, as the microcontroller does not drain the gun’s battery (where
recheargable batteries don’t fit (yes, really)), and the guns motor
can draw as much power as it wants without crashing the
microcontroller. Also, it allows me to reprogram the Wemos if I
mess up the wifi config ;)
I decided to use my old iPhone 6S as a camera: Its small, has a
battery, works without any configuration and most importantly: I
had it at hand. After finding a suitable position on my window, I
designed a very simple holding bracket, 3D printed it and glued it
on my balcony window using 3M mounting tape 1.
I use this app
to get a MJPEG stream of its camera. It works good and
I like that it lets you black o