Tuesday, June 22, 2010

The Relocation of Robin

For those of you not familiar with American robins, the male bird is territorial. When he sees his reflection, he thinks it’s another robin and he tries to fight. The result is hours of “trying to run off” the other bird. Of coarse his reflection doesn’t leave.

Figure 1: An American Robin

A robin has been pooping all over a hand railing in front of my house. The robin has also been thumping on the window trying to fight his reflection. (Nickname: Evil Robin) My first attempt to remedy the pooping was to tape trash bags over the windows so he wouldn’t see his reflection. After a week, I took down the trash bags figuring he had moved on. He had not. So, I taped the trash bags to the window for another week. He found the back porch window to attack. Also, he had started eating mulberries, which made is poop stain the railing with spots of purple. A rubber snake was placed on the railing in the hopes of scaring away the robin. He pooped on the rubber snake.

Figure 2: The Robin Poop on the Railing

My next ideas were to either buy an owl decoy or build one out of cardboard. These ideas were scratch in favor of trapping the robin and relocate him to a distant location.

Being a new homeowner, the demands of the house seem to take several hours a day. Coming from apartment life, this has been a difficult change. So, the idea was to complete the trap quickly and easily. Building the trap, assembling the circuit on a solderless breadboard, and writing the ATTiny13 code took about 3 evenings.

Figure 3: The actual robin doing the pooping (image taken though a window screen)

Two words are needed to see how the trap was put together: cardboard and packaging tape. The cardboard box was originally used to hold several dozen-egg cartons. A mirror is placed in the back of the box to allow the robin to see his reflection. The lid flaps on the cardboard box were removed and replaced with a single piece of cardboard to act as the “flap”. The flap needed a little more strength near the edge. So, strengthening ribs were created out of cardboard and taped onto the edge of the flap. The flap is held open by a solenoid attached to a wood dowel. The wood dowel is taped permanently to the egg box.

Figure 4: Various parts of the trap

Figure 5: Solderless breadboard on the side of the cardboard box

The ATtiny13 microcontroller acts as a comparator for the analog voltage output of the Sharp sensor inside of the trap.

Figure 6: The sharp distance sensor in the trap

When the microcontroller determines the voltage from the sensor is above the set value, the output to the solenoid is changed from a high to a low. This turns off the solenoid (by turning off the n-channel FET) that is holding open the gate of the trap. Gravity then takes over and the lid closes. Two magnets from a “shaking powered flashlight” are used to help keep the door shut. Two pairs of pliers are taped in the bottom of the trap to allow the magnets to keep the corners of the door closed.

Figure 7: Robin trap schematic (a PDF is at the bottom of the post)

The sensor outputs an analog voltage based on the distance to a reflective object. The operational distance of the sensor is from 10cm to 80cm. The object we are looking for in this case is the robin.

The solenoid typically is powered when the circuit is turned on. The flap is opened on the trap and it is align so the solenoid keeps the trap open. When an object is detected by the distance sensor, the flap is released from the solenoid and the robin is trapped.

Figure 8: The solenoid on the wood dowel

Did it work?

The trap was set on the front porch, near where the robin likes to sit on the railing for about a week. (When it wasn’t raining) Apparently, the trap was visibly so frightening to the robin, he never came back. So, did the trap work? Yes, it took care of the robin problem; No, it didn’t catch him. Maybe I should have gone with the 4 feet tall cardboard owl।


Source code for the Attiny13

Hex file for the Attiny13


  1. Well, that sounds like mission accomplished to me!

    Whatever works~ as I always say.

  2. Do you have plans for this scare-robin that exclude the non-functional parts (the microprocessor, breadboard, magnets and solenoid)?


  3. this is illegal. robins are a protected species. nice write up though.

  4. Actually, the American Robin is classified as a "least concern" species, meaning that there is no threat to it.
    I like the idea for the robin trap, even if it didn't work the way it was intended to. :)

  5. Very cool writeup and Wikipedia confirms Jonny Mnemonic's above comment: http://en.wikipedia.org/wiki/American_Robin#Conservation_status

  6. Robbins? Bah. Try scaring away pidgeons. Horrible rats with wings...

  7. I have the same exact problem, railing and all. I went to home depot and bought some bird netting and hung that on 4 nails at each corner of the window about an inch from the window. The robin has attacked the window twice since I put it up. It really confuses him, he walks around on the railing looking at the netting. You can hardly see the netting from 10 feet away. I tried all the other stuff you suggested, except for your EPIC trap... :o)

  8. I tried something like this on http://weedbutter.com and the robin went away.

  9. Very amusing, but I miss the musical soundtrack of your "better" mousetrap! Although "This Old Man"'s concern is laudable, the point of this project was to safely keep the Robin from harm ... including that brought on by himself.

  10. even if robins were protected i doubt trapping and re releasing would be illegal.

  11. Actually, they are protected. Not under the Endangered Species Act: under the Migratory Bird Treaty Act.

    Believe it or not, it is, in fact, illegal to trap and relocate robins.

  12. barawn is correct. It is even illegal to move the feathers, nests, eggs, etc left behind by a robin.

  13. It's also illegal to jaywalk.

  14. pellet gun. problem solved.

  15. Gun! Every new homeowner should have at least one.

  16. "It's also illegal to jaywalk."

    Yes, but I don't know anywhere that punishes jaywalking with 6 months in jail and a multi-thousand dollar fine.

    Obviously it's a rarely enforced law, but it might not be the smartest thing to advertise flaunting it on the Web.

  17. "this is illegal. robins are a protected species. nice write up though. "
    Well he's not harming it, and I've never heard of them being protected.

    "and Wikipedia confirms Jonny Mnemonic's "
    Wait, someone uses Wikipedia to confirm facts.. *groans*

  18. @Swat

    So long as the "facts" within the Wikipedia article are cited by a reputable source, I see no problem.

    IMO some of these laws are a bit ridiculous, especially in their severity.

  19. Clever project. And no birds were harmed either. However in light of the stupidity of the laws. If I had this problem I would start feeding the stray cats in my neighbor hood. Sorry Mr fish and wild life but a stray cat killed the bird. Bad kitty have some more tuna.