106 comments

[ 5.2 ms ] story [ 195 ms ] thread
Hi HN! I commented about this project of mine a month ago [0] and decided to write a more in depth blog post about it.

Feel free to ask any questions :)

[0] https://news.ycombinator.com/item?id=31024099

Are you going to add a second camera?
Interesting question! The geometry of my balcony kind of restricts the number of places that observe the pigeons without spying on my neighbors. Therefore I’m not sure where else I could put another camera.

I’m thinking about a auto-aiming gun for the next iteration, though.

One in each corner of the window of the balcony?

Just add two microphones and try to integrate the sound and video for extra style points?

I wanted to add video recording in the future to gain some lol-points. But to be honest, the still images of the pigeons + my imagination had me jumping like a child in excitement already ;)
A motion activated sprinkler could work too. Or buy a motion detector and have it activate plant water sprayers (the kind used for automatic watering of potted plants).
A cheap solenoid will work with garden watering systems and connections. I made an irrigation system that I added to Home Assistant and it’s great.

https://www.bunnings.co.nz/pope-25mm-solenoid-valve-with-flo...

You can get attachments that allow all sorts of jets, drips and spray patterns.

It would probably plug in nicely in place of the water gun. However drilling through the wall and messing with the plumbing isn’t for everyone.

Also works great for keeping kids off your lawn
So how do you aim the water gun? I see no servo motors? Or is it more like a wide spray nozzle?
I don’t aim it at all at the moment. The pigeons mostly land directly behind the railings, as documented by their… presents ;)
What happens when you sit on the balcony?
I love this project! In the spirit of sharing ideas, I would have probably done this full analog. I’d set up a rudimentary analog break beam detector (like what they use to detect if a garage door is cleared to close) beaming across the balcony, and if so, trigger the relay to shoot the gun!
I'm curious, can you share a scan of that police leaflet please?
If you want the low-tech solution, here is a recipe that definitely resolved it for me:

- One big spoon of cinnamon

- One big spoon of chilli peppers

- Half a bottle of cheap, cleaning vinegar

Spray it in all the places that the pigeons want to land. I am doing that once a week and it is enough to keep them away. If you clean your whole balcony with it, you might be able to go through most of the spring - when I think they really get annoying because they are looking for a place to make a nest.

This is interesting, I was under the impression that chili peppers specifically evolved (spiciness) to be edible by birds but not mammals. Maybe that's an adaptation specific to tropical birds?
Adding on: Though there is no consensus, I believe that is now the less-popular theory for the origin of spiciness. It seems instead to be a form of pesticide and fungicide.

Evidence for this is that pepper varieties tend to be spicier in wetter environments, where the biological resources spent on producing capsaicin to fight fungus are more valuable than preserving them in case of drought.

Source: https://sitn.hms.harvard.edu/flash/2012/issue131b/

Another low tech solution:

feed them occasionally on your balcony… birds are smart and they will not poo in their food plate.

Cooked pasta works well, nothing will be left when they leave.

Hard disagree, or our pigeons are especially daft. (To be fair, ours are wild Mourning Doves), but they crap all over the food and water receptacles we have out for a variety of birds.
I was under the impression that birds have no sphincter so they can't control when they poop. Is this not true?
Wouldn't it then always slowly leak out rather than become one big glop?
Some birds do, some don't.

Source: my pet duck didn't have a sphincter.

Pro tip: don't get a pet duck

This is cool alright, but can I program a Rasberry Pi to spray it?
No water? Just mix in vinegar?
Consider using background subtraction for this: https://docs.opencv.org/4.x/d1/dc5/tutorial_background_subtr...

Will make things a little more robust (and overengineered!).

I’m curious, could you somehow make the background model adaptive by averaging a rolling window of camera frames to use as the background model in this?
This is pretty much what I’m doing. Except that I’m using an exponential moving average so I don’t have to mess with windowing.
> [Spikes] 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.

They can also be horrifically cruel. I've seen a pigeon die after getting impaled on those kinds of spikes and it was a traumatic experience for me, let alone the poor bird. I really appreciate your attempts to solve this problem without resorting to inflicting pain, or worse.

I don't often comment on usernames but I feel like you're just trying to make sure you don't lose your other eye.
Would you believe, I actually forgot my username while making that comment?!
Sounds like you’re still working through the trauma unconsciously.
(comment deleted)
I use these plastic spikes. [1] Not even sure if you can call them spikes, moreso just protrusions. They aren't sharp at all so they don't impale the pigeon, only stop it from roosting. They work really well because the pigeons just aren't comfortable sitting on them.

I agree with you about sharp metal spikes. Those are really terrible and I feel bad for any bird that gets injured by those.

[1] https://www.amazon.com/Bird-X-Plastic-Polycarbonate-Spikes-A...

These spikes are in a nook above the office at work. They help hold the bird nest there perfectly, and actually seem to make nesting easier. I could see them keeping away large birds, but for their intended use case, they just made it easier for nests to be put where they otherwise might not stay.

That said, I don't mind it, watching the birds is fun.

That's pretty funny. For me, they work pretty good against the pigeons. Honestly, if it were sparrows or some other type of bird making a nest in them, I don't know if I would care too much. Pigeons are pretty large and make big poops.
“After a quick burst of manic energy during exam phase…”

It’s amazing what humans are capable of achieving while avoiding doing something else.

I call it productive procrastination

Amazing phenomenon.

(comment deleted)
This phenomenon is the only reason my house is clean.
I've been daydreaming about something like this for my squirrel problem. The damn things nearly leave me without nectarines unless I install a cumbersome, unsightly net over the tree.
Squirrels eat nectarines/peaches? Maybe I should hit wikipedia more often and check out things that "everyone knows"
Squirrels are just tree rats. They'll eat anything. I'm more sueprised that nets are effective than their choice of food.
Could one invest in hawks, owls or snakes?
Hawks and owls require multi-year effort in Falconry licensing (at least in the US).

First 2 years under a sponsor--you can get a very specific hawk or falcon (which hawk or falcon is geographically dependent) After 2 years & sponsor approving it-- you are now a general falconer. Have fun with other raptors, including owls. OTOH.... Wild Owls: excellent pest control.

Not sure this will work but for our birdseed we've had good luck with that super hot pepper oil. Less than a teaspoon of it in a (1/2 gallon?) sized container of birdseed, shaken for 30s-1m to get it distributed has kept the squirrels and raccoons off of it. Couple times and they don't even bother.

Doesn't bother the birds, but mammal tongues light right up.

I can't currently link to it but this reminded me of that Mark Rober series of videos about squirrels.
This is funny. I've tried to make pigeons come into my terrace to feed them and allow them to nest with no success at all. Yet other people struggle to keep them out of their balconies :D
Why would you want this? They'll crap everywhere. If you have neighbours they may not appreciate it either.
I always felt curiosity about pigeons, specially homing pigeons and pigeon racing. Where I live, there is not much interest in pigeon racing, but there are quite a few pigeons and doves. Considering I have no neighbours nearby and there is plenty of space here in the outside, I tried to attract them but I failed so far.
Have you tried providing food? All you need is raw seeds, no salt!

There are all kinds of small and big birds that visit our balcony, especially in what passes for winter these days.

Yes, I left seeds, bread and other stuff pigeons and other small birds may eat, and also provided some kind of shelter, but the only visits we have here -no matter if I provide food or not- are seagulls, which I'm not interested in.
Maybe seagulls drive everything else away. Can't think of anything else, provided there are trees and bushes around.
If you’re not already, try using nutritious food formulated specifically for pigeons or doves.

Seed-heavy diets, even if formulated for pigeons, are very fatty and may not make them feel great after eating. And bread is basically junk food for birds! So if you try a more nutritious blend of food made for them specifically, they may really enjoy it and come back for more.

Plus I imagine gulls won’t bother with their tiny food.

Do you do the same with city rats? Both are carriers of a huge amount of diseases.
I once found pigeon nest behind my window with 3 eggs in it. I didn't have the heart to destroy the nest. Little did I know about what filth I will have to clean up once they take off. Also, they left behind some very tiny beetles that I battled with for few weeks to come. They were so tiny they managed to squeeze in through the window's sealing.

This year I found an egg again. I threw it away.

Surprisingly little excrement before hatching, compared to what comes after. And even that is less ugly than what happens when the magpie gets the chick before it gets too big. My current approach is allowing them to breed but sterilizing the eggs with a quick round of cooking. I feel sorry for them when they are close to giving up (how much conflict between hope and growing doubt fits into a pigeon head?), but just removing the eggs will lead to a another attempt and sometimes I'm away for long enough to allow them to get from zero to hatching

(that's how I learned about the magpie situation, was away long enough to have an entire laying-hatching sequence after leaving when freshly sterilized, I suspect they gave up early, magpie discovered and took the abandoned eggs, remembered the spot and came back to the chicks after the next breeding attempt - pure speculation but the schedule would just fit my absence)

I built something similar using the same internals of a battery operated water gun. I 3d printed a 360 turret enclosure, stuck it on a stepper motor. However mine was manually controlled via my phone. I used it to break up cat fights in the middle of the night
That is absolutely ridiculous. I love it.
I've been looking at some automated way to scare coyotes out of my yard almost every night at 3am. It drives the dog nuts.
Ouch! I hope they aren't howling too. Coyotes howling is one of nature's crazier sounds. The first time I heard it, from a distance, I was all kinds of confused. "Is there a mad hobos-on-meth tea party going on over the next hill? Are they coming for me? Will it be fun?"
Hmm... This is actually not a bad idea. Like seriously, some people will pay for it IMO. It might actually be a viable product.
You can just buy off the shelf a ordinary lawn sprinkler controlled by a motion sensor. Though maybe the total amount of water might be undesirable on a balcony.

I found them quite effective at supplementing a fence to keep deer out of areas they shouldn't be in.

Any particular motion sensor? Low voltage?
The ones I use and have seen use PIR, and are battery powered. The batteries last a long time esp. if it isn't triggered often.

The biggest limitation I've found is that it takes a bit of soldering iron adventure if you want to have a remote disable switch. :)

(comment deleted)
Deer devouring flowers. Off the shelf solution. Motion activated sprayers attached to hose. Worked great, but.

1. Looked like crap. Scifi minitowers in my yard. Hoses stretched here and there. 2. Randomly activating at night. Not loud but quite audible, and disturbing. 3. Occasionally zapped people, skunks, cats.

So I sold them to a friend (they aren't cheap)

The most effective solution I found for pigeons (although I haven't built this so can't compare...) is feeding them at regular times. It doesn't even have to be a lot. They're smart enough to know I come out around 0830 to give them some seed, and then they fly away for the rest of the day because no more food is coming. Sometimes when new babies appear, it takes a couple of weeks for them to copy the pattern though.
If you live in an urban area, please don't do this. Pigeons are pests. They carry diseases. Their shit is toxic and can cause serious respiratory issues.
Did something similar. My wife was upset about the flying rats defecating on her flower pots on the terrace. Those birds are stationary (generally) and slow so I managed to iterate a solution that (a) used a 3w green laser mounted on a webcam with servos and (b) later used a static laser with a mirror that was mounted on a set of servos. I used a stationary 4k webcam. I mapped the whole terrace so I didn't need to use stereoscopic vision. When a bird was detected (i sampled images at 1fps and built a custom model for pigeons, it was generally ok at avoiding other birds, but not perfect), i'd triagulate its position and light it up for 100ms. I used a similar contraption as the OP to cut the power. The pigeons would react by flying away, even when hit from behind or underneath. I used a series of experiments before settling on 3w. 1w was not enough.

It solved the problem for good. Its not a perfect solution, obviously: i had to implement a master override which stopped it when terrace doors were open, also it only fired at horizon or below since I didnt want to accidentally light up a plane (there is an airport 5km from where I live). We dont have kids, and rarelh entertain guests, so I didnt need to implement additional safety Measures. Lastly, it was running on a pretty beefy pc and was consuming around 60w constantly.

We fixed the problem for good by moving out. If i had to do it again, I'd try with water pistols, way safer than laser.

That’s an awesome setup. Curious how do you triangulate using the video from a camera.
That was done on the cheap; there is a finite number of spots the pidgeons used to occupy. Pigeons also have a relatively fixed height when stationary. The camera was in a fixed position. I mapped the area the camera was observing manually: railing, base of the terrace, etc. I was contemplating using two cameras but the cheap setup worked nearly flawlessly when it comes to triangulation.
If you aren't moving your position and you have a topographic map of your territory, and you have a line-of-sight weapon that doesn't need wind or range adjustments... then you don't really need to know where your target is in 3 coordinates, you only need 2.

I would expect that ambient lighting changes are harder to compensate for when selecting targets.

It is, however, terribly irresponsible to do this, since temporary reflectors like water puddles or a misplaced water glass can be inadvertently weaponized.

For small areas, an overhead water sprinkler would be much, much safer and not need aiming at all.

Yeah, I agree - this was an unsafe system. We lived in a secluded space, and that surely helped prevent accidents, but i'd not set it up like this again even if I lived alone.

As others suggested, a water cannon would be safer (not entirely sure about a sprinkler - in my experience with pidgeons they do seem able to get used to all but most unpleasant defences). Also, an auto-firing high pressure, precise water cannon would be a cool side project :->

3w laser sounds terrifying in itself. Firing it autonomously even more so. Have you made some calculation of how long would direct eye-hit need to last to cause blindness, and how long for a bounced light from bright diffuse object? My guess would be way less than 100ms for direct hit, but I am not sure even diffused reflection would be safe at such power levels.
Nope, I assumed any exposure to the light would cause blindness. The way it operated was it would stop if anyone was at the terrace (as indicated by the door lock being in a closed position, something one could do only from the inside). But yeah, it was a product of frustration, not rational thinking. I'd certainly consider it stupid if someone else described it to me now.
You better not be anywhere near a residential neighborhood. Posts like this remind of of the annoying necessity of regulating what can be sold to retail consumers.
I hope that at least one person pauses to consider the pigeons' close relation to us on the family tree of life, the fact that they have feelings and personalities and can experience joy and pain.
That doesn't mean humans can't hate them for shitting everywhere, however. These solutions discussed here aren't fatal or invasive. The birds don't die and they're free to leave.
Do you shit?
Yup, but not everywhere
You don't shit plastic into the landfills and exhaust into the air and microplastics into the river and literal poop into the ocean?
At a very high end hotel with a very large veranda, they ran what looked like clear fishing line horizontally.
I use tie wraps spaced about 10-15 cm apart. Works 100%.
When do you get a house with a garden and mount this on a radio controlled car chasing cats, asking for a friend?