Train Wild Birds to Exchange Litter for Food!

16,756

330

51

Introduction: Train Wild Birds to Exchange Litter for Food!

About: A few words about me:On my sixth birthday, my parents gave me an electric building kit. This started a lifelong passion for electronics, robotics and Artificial Intelligence (AI). Today, I am very experience…

I have trained wild magpies in my garden to trade litter for food !

The whole project relies on mechanical design, electronics, software and the great opportunity to create a machine with parts from my 3D-printer. I have worked with this project to and from for several years, but now in recent months the project has had an exciting development, and as I write in the title... Now the magpies work as garbage collectors, payed with food!


The food dispenser, must be: Fully autonomous,remote AND reliable

I work everyday with industrial applications of artificial intelligence (AI)... so the whole rig for the magpie project must be:

- Autonomous- Reliable- Flexible- Completely remote controlled- Document and log data and video.

I spent remarkably much time creating the actual food dispenser.

After testing with several Thingiverse designs of pet feeders, often based on a rotating feeder screw, I left these techniques. The dispenser must never get stuck and I want to be able to feed out individual peanuts. I looked at industrial solutions and got hooked on vibrating feeders. The base of the feeder is a fantastic vibration feeder from thingiverse. https://www.thingiverse.com/thing:2118961

Choose ABS or PETG for the four 'dog-bone' parts, PLA does not last long.

To this design I have added a number of extensions and funnels, I upload these as STL files. But, these are quick and dirty designs, you have to attach the parts on your own with small sheet-metal sheets, or in another way. Sorry for this, but when I build I am often experimenting and usually don't know exactly what the solution will look like... My parts to extend the vibro feeder can be found here:https://www.thingiverse.com/thing:4601125

One of these funnel parts has a 5mm socket for IR-LED and photodiode. with this arrangement I can run the dispenser with increasing intensity until I detect a peanut, Then stop the vibrating motor.

The vibrating motor is a simple 4.5 v DC motor. I made an unbalanced flywheel to this motor, included here https://www.thingiverse.com/thing:4601125 as STL The BirdBox is controlled by a Raspberry Pi 4 with an add-on board. The add-on board includes a DC motor controller.

There is also two arduinos in the design. For the raspberry, there is a python program that is controlling the logic of the feeder. I use the VNC feature together with AnyDesk to have full access to the BirdBox from 'remote'. The python code incorporates a simple GUI where I can see and log the progress and status of the BirdBox.

Supplies

Raspberry Pi 4

Wideangle picam

Arduino , preferable with 3.3 v logic.
Adafruit fetaher (arduino)

Step 1: The Food Dispenser, Must Be: Fully Autonomous,remote AND Reliable

I work everyday with industrial applications of artificial intelligence (AI)... so the whole rig for the magpie project must be: - Autonomous- Reliable- Flexible- Completely remote controlled- Document and log data and video.

I spent remarkably much time creating the actual food dispenser. After testing with several Thingiverse designs of pet feeders, often based on a rotating feeder screw, I left these techniques. The dispenser must never get stuck and I want to be able to feed out individual peanuts. I looked at industrial solutions and got hooked on vibrating feeders. The base of the feeder is a fantastic vibration feeder from thingiverse. https://www.thingiverse.com/thing:2118961 Choose ABS or PETG for the four 'dog-bone' parts, PLA does not last long. To this design I have added a number of extensions and funnels, I upload these as STL files. But, these are quick and dirty designs, you have to attach the parts on your own with small sheet-metal sheets, or in another way. Sorry for this, but when I build I am often experimenting and usually don't know exactly what the solution will look like... My parts to extend the vibro feeder can be found here:https://www.thingiverse.com/thing:4601125 One of these funnel parts has a 5mm socket for IR-LED and photodiode. with this arrangement I can run the dispenser with increasing intensity until I detect a peanut, Then stop the vibrating motor. The vibrating motor is a simple 4.5 v DC motor. I made an unbalanced flywheel to this motor, included herehttps://www.thingiverse.com/thing:4601125 as STL The BirdBox is controlled by a Raspberry Pi 4 with an add-on board. The add-on board includes a DC motor controller. There is also two arduinos in the design. For the raspberry, there is a python program that is controlling the logic of the feeder. I use the VNC feature together with AnyDesk to have full access to the BirdBox from 'remote'. The python code incorporates a simple GUI where I can see and log the progress and status of the BirdBox.

The project has been running for several years. The video-clips you see on this page is the result of stubborn work and several steps. Step 1 is to make the birds interested and familiar with the feeder. I recommend anyone interested in setting up similar experiments to start with that. You need to feed the birds regularly to get your 'site' included in their 'patrol-scheme'. That is why I start to publish designs necessary for this initial phase. The feeder, and some sort of experiment site, like the general food-bowl included in the STL files.


Step 2: Detecting and Classifying the Bottlecaps

The bottle-caps are detected and 'accepted' with a dedicated 3D-printed metal-detector based on some arduino code. I have created a simple GUI for the raspberry, with this GUI, Anydesk, and a wide angle Picam attached to the Raspberry monitoring the experiments. This has been very valuable since I have had to run the experiments fully autonomous, setting up an experiment, going to work, and then follow up the result later that day. I will describe the electronics and software later on this page... History of the project, and how I trained the magpies.

Today. 2020-10-17, I uploaded a YouTube video describing how I trained the birds !

Step 3: Next Steps...

I'd love to share this project and my experiences with everyone interested. What could come out from similar experiments when a large community get engaged? I work intense right now to prepare my project files etc for sharing...more to come.

The next planned step step involves an attempt to get the birds to collect 'fallen-fruit' in my garden. Are apples to heavy ? In the longer run, I think it would be possible to train for almost anything. Bottle-caps was relatively easy to 'classify' with a metal-detector. Other items, such as cigarette-butts, 'candy-paper', slugs etc will require a more general method for classifying. Fortunately I spend my days with applied AI and machine-learning.In my profession, we build smart sensors based on small & fast neural-networks such as mobile-net and YOLO. It is fully feasible to run such networks on small platforms such as the RPI 4. This could be the foundation of a general classifying method for a system like the BirdBox.

Step 4:

Step 5:

Be the First to Share

    Recommendations

    • Furniture Contest

      Furniture Contest
    • Box Challenge

      Box Challenge
    • Toys & Games Contest

      Toys & Games Contest

    51 Comments

    0
    MTKapp27
    MTKapp27

    Question 8 months ago

    Is this in anyway related to the http://www.thecrowbox.com/
    ? This seems like a beefed up version.
    Do you have an instructable for the dedicated RaspberryPi IP live stream camera?

    1
    hfor62
    hfor62

    Answer 8 months ago

    Regarding the IP camera raspberry, i have just 'copy-pasted' code from one of theese heros out there on the web. Iäll try to share the code with you...s soon as i come back from a (corona-safe) business trip.

    The code is bugging out for some yet unknown reason after 3 to 7 hours, still its a valuable tool for me since i can scroll back in time and see what happened.

    My contribution to the IP-camera is that i finally managed to set up a working microphone solution...I tried several small USB-microphones but the sound ended up lika an old 1930:s radio quality...

    Finally i dismantled a USB-gaming microphone, carefully adopted the bits and pieces for my 3D printed 'nose' on an standard enclosure...still a lot of hum and hizzz, but after testing several 5V power supplies , i finally found a 5V 2 AMP power supply that is 'silent enough' to make the mic-sound acceptable...the videos is so much better with sound ,right ?


    Hans

    1
    hfor62
    hfor62

    Answer 8 months ago

    Hi there, no i have no connection with 'thecrowbox' but we seems to share a similar vsion

    14
    sir--kris
    sir--kris

    8 months ago

    Awesone....very nice...but...what about the first birds training? How Do you teach birds to chose that object? ...to put that specified object to that specified hole?

    0
    hfor62
    hfor62

    Reply 8 months ago

    i'm preparing a video-clip explaining how i trained the birds...i'll let you know when i post it !

    0
    sir--kris
    sir--kris

    Reply 8 months ago

    thank youuuu...I'm very interested in

    1
    glomms
    glomms

    8 months ago

    So cool, you should be nominated for the Nobel Peace Prize! Please follow up on how you trained these birds. Best idea I have seen in a long time.

    0
    hfor62
    hfor62

    Reply 8 months ago

    i'm preparing a video-clip explaining how i trained the birds...i'll let you know when i post it !

    1
    frederickvanlingen
    frederickvanlingen

    Question 8 months ago on Step 4

    I love your idea!!! How did you train the birds? Or do they just figure it out?

    0
    hfor62
    hfor62

    Reply 8 months ago

    i'm preparing a video-clip explaining how i trained the birds...i'll let you know when i post it !

    12
    Microbe
    Microbe

    Question 8 months ago on Step 3

    It would be great to know how you trained the birds. The electronics I could fudge my way through, but I have no idea how to get birds to do that.

    0
    hfor62
    hfor62

    Reply 8 months ago

    i'm preparing a video-clip explaining how i trained the birds...i'll let you know when i post it !

    16
    davidgibbs
    davidgibbs

    8 months ago

    This bird is really clever. He trained a man to build a machine that would supply him with food whenever he wanted. Brillant.

    0
    hfor62
    hfor62

    Reply 8 months ago

    Yep...that the truth...and with the joy of experimenting with this project lets call it a win-win situation...

    1
    shalnachywyt
    shalnachywyt

    Reply 8 months ago

    And we think animals are dumb... :)

    0
    parzival23
    parzival23

    Reply 8 months ago

    Haha

    1
    Nestordane
    Nestordane

    8 months ago

    What if the machine runs out of nuts? Then the bird will not be payed for its hard work ...?
    But a very amusing project :-)

    0
    hfor62
    hfor62

    Reply 8 months ago

    Yes, this might be a problem, i have prepared a 'lid' with the text "Out of service" , that would be controlled by a RC servo (seriously!), but so far, i simply don't let the machine run out of nuts.

    Since there is not that large amount of bottle-caps added by beer drinking neighbors, so i can control the process quite well by the number of bottle-caps i hide in my garden (and som in my neighbors gardens)...

    8
    seawarrior181
    seawarrior181

    8 months ago

    Simply brilliant. Please tell us more about how you trained the birds.

    0
    hfor62
    hfor62

    Reply 8 months ago

    i'm preparing a video-clip explaining how i trained the birds...i'll let you know when i post it !