Close
0%
0%

Vending Machine for Birds

Simple, inexpensive bird feeder that dispenses peanuts in exchange for dropping stuff in a hole. A vending machine for clever birds.

Similar projects worth following
An inexpensive, simple bird feeder that dispenses a nut for dropping stuff in a hole and can be built from analog components and discarded or scrap objects. Pest-resistant, runs on 5V, one moving part. Lots of improvement and customization possibilities. MAIN FEATURES - portable - waterproof/weatherproof - battery/solar or mains powered - keep-alive for USB power banks - accessible components and materials - highly customizable - optional external monitoring and control This is not a new idea, just a new design. I have a page here listing some of the similar projects I have come across in the past few years. https://hackaday.io/page/38619-bird-litter-for-food-projects See it in action: https://www.youtube.com/@VendingMachineForBirds More info on the analog and digital versions: Analog VMFB: https://hackaday.io/page/296098-vending-machine-for-birds-analog-version Digital VMFB: https://hackaday.io/page/296141-vending-machine-for-birds-digital-ve

A vending machine for birds that rewards them with food when they drop something in a hole. Electronics and enclosure materials cost <100 USD/EUR. I've designed a PCB and PVC pipe enclosure and dispenser (described below). The circuit is not complex, but I think a custom PCB makes it easier for people who are not electronics hobbyists to build this. I've made a few different enclosures out of scrap for this, but will share the PVC pipe enclosure details since it's sturdy, waterproof, and the materials can all be found at the hardware store.

There were two main inspirations for me to start and  document this project

  • Hans Forsberg - designed his own machine and was the first person I learned of that had birds (magpies) bringing items to deposit on thier own
  • Josh Klein - makes his Crowbox designs freely available and supports people who want to build it

I would like to thank PCBWay for helping me get the PCB made.

MAIN FEATURES

  • portable
  • waterproof/weatherproof
  • saves power until a warm body is present
  • battery or mains powered
  • one moving part
  • accessible components and materials
  • rodents can't break in and get the food
  • cheap to build
  • customizable

ELECTRONICS, SENSORS, AND POWER

The circuit is all analog, using four NE555 timers and one LM358 dual op amp. The sensors are all made using IR phototransistors and IR LEDs. The PCB has headers broken out so you can monitor and control it with a microcontroller or SBC. It runs on 5-6VDC, but be sure to use 5V if you are planning to power a USB device (like a camera) with the vending machine's USB ports. If you use a USB cable to power the vending machine, be sure it can deliver enough current. I found that some 10-year-old 2-meter USB 2.0 cables were resulting in a voltage drop from 5 to 4.5-4.8 volts on the vending machine power rail.  Cables that didn't work so well had a resistance >1Ω. Ones that did had a resistance of <0.5Ω. NE555's should get at least 4.5 and Raspberry Pis need at least 4.7V. If things are not working as expected, use a multimeter to check the rail voltage - it should be around 4.9V. Shorter cables are less lossy and take up less space inside the enclosure. 

Power consumption at 5V is as follows:

Without RPi Zero W

  • Idle with Powerbank Keep-Alive and TImer enabled: 18mA
  • Timer uses 8mA
  • Powerbank Keep-Alive uses 4mA
  • ^With both of these disabed it uses 6 mA
  • IR LEDs on: 320mA
  • IR LEDs and motor on: 510mA

With RPi Zero W and wide-angle camera module

  • Idle with Powerbank Keep-Alive and TImer enabled: 220mA
  • IR LEDs on: 520mA
  • IR LEDs and motor on: 820mA

So with the Rpi and camera you could get about 2 days out of a 20,000 mAh power bank. With just the vending machine you could get about 10 days.

Modules

  • Powerbank Keep-Alive: 555 sinks current every 7-22 seconds for 0.7-2.2 seconds to keep USB power banks on while sensors are in standby - the powerbank keep-alive can be disabled.
  • IR LED ON/OFF: 555 keeps the IR LEDs used by the sensors on for 22 seconds after the last PIR trigger
  • Op Amps: LM358 used as comparators to adjust the threshold of the sensors and send signals when they are triggered
  • Motor Controller: 555 turns on the dispenser vibration motor when the deposit sensors are triggered, tuns it off when the dispense sensor is triggered
  • Timed Dispense: 555 dispenses food every 10-100min - timed dispense can be disabled
  • Daytimer: Phototransistor that puts the timer in reset while it's dark outside - brightness threshold can be adjusted or disabled (Rev. B)
  • PIR Sensor: Sends a signal to turn on the sensor IR LEDs
  • Deposit/Dispense Sensors: IR phototransistors and IR LEDs used as proximity sensors to monitor the deposit and dispense chutes
  • Hopper Level Sensor: IR phototransistor and IR LED to detect when the food level gets low (Rev. B)
  • Monitoring/Control: lines for monitoring and triggering events with an external controller (Rev. B)

PCB, BOM AND GERBERS

Kicad Files (Github): https://github.com/src1138/VMFB
Gerbers, PCB and...

Read more »

VMFB-MC_09-24-52.mp4

Quick deposit - this bird knows exactly what it's doing.

MPEG-4 Video - 425.13 kB - 08/30/2024 at 13:33

Download

VMFB-MC_09-28-52.mp4

Jackdaw bringing two bottlecaps.

MPEG-4 Video - 1022.72 kB - 08/26/2024 at 12:46

Download

VMFB-MC_11-49-08.mp4

Persistent jackdaw sinking three bottlecaps - the first two failed to trigger the sensor - something I need to investigate.

MPEG-4 Video - 2.11 MB - 08/25/2024 at 13:37

Download

VMFB-MC_13-23-17.mp4

Jackdaw landing on the platform with a cap already in its beak.

MPEG-4 Video - 1.81 MB - 08/25/2024 at 13:28

Download

VMFB-MC_17-03-10.mp4

Jackdaw taking a cigarette butt from the cup near the platform and sinking it.

MPEG-4 Video - 2.87 MB - 08/20/2024 at 21:55

Download

View all 39 files

  • Magpies on the edge

    Stephen Chasey12/30/2025 at 01:07 0 comments

    I moved the dispense opening close to the deposit opening and modified it so peanuts would not spill out onto the platform. The goal was to force the magpies to walk on the platform instead of just using the rim. This way they would be more likely to sink some accidental depostis.

    Unfortunately they are pretty adamant to not walk on the platform if it can be avoided. They would rather touch it with their wings than their feet. Something to work on...

  • More Changes More Problems

    Stephen Chasey12/20/2025 at 22:54 0 comments

    I redesigned the entire interior of the feeder to make it smaller, easier to build, cheaper and somewhat ironically more reliable. I've already had a few problems that I hope I've fixed.

    The place I get peanuts changed suppliers or something and the peanuts are a bit bigger now. I had to cut away a bit of the baffle over the dispense opening once I found an entire hopper of peanuts jammed above it thanks to a few finger-sized peanuts that got stuck.

    I want to change the design yet again to put the deposit hole in front of where the nuts get dispensed. I think this will increase the likelyhood of accidental deposits and the chance that the birds see the result (getting a nut) so they can reason it out. 

    I initially moved the deposit chute away from the dispense opening so dispensed nuts would not find their way into the deposit chute. This happened once when I was still on shelled peanuts and pigeons. The dispense cup had a few peanuts in it and the ones coming out were bouncing off them into the deposit chute causing more peanuts to come out. 

    The next design will not dispense nuts onto the platform - the nuts will stay witiin the enclosure and it will have a larger dispense opening (50x100mm) facing forward so birds can see and reach in easily. The deposit opening will be in front of thiis opening at its center.

    This change is more about getting results from the birds than any mechanical or material efficiency. I've noticed that while jackdaws walk around on the platform and accidentally deposit sometimes, magpies typically stick ot the rim of the platform and seem to avoid walking on it. Hopefully this change will lure them closer and increase the chance they associate deposit with dispense.


    UPDATE

    Since I can rotate the dispense opening on my current design I can take a bit of a shortcut and just lower the dispense baffles so the nuts stay within the dispenser.

    Then I can rotate the opening closer to the deposit hole. The birds will take a good look inside to make sure they didn't miss anything. Moving dispense and deposit closer together will require the magpies to walk on the platform to get to the nuts, and have a higher chance of accidentally depositing and figuring out the cause and effect.

  • Baffle angle and clearance

    Stephen Chasey11/27/2025 at 14:51 0 comments

    I've been having more dispenser jams with the new design and the reason turn out to be the increased baffle angle. I made it steeper thinking it would make sure the peanuts would roll off of it onto the vibration platform. The side effect is more lateral force on the peanuts. Peanuts in the shell are relatively light (compared to shelled nuts) and have a rough, irregular exterior - even a little lateral force is enough to jam them up.

    So I'll be going from ~30° incline back to a ~15° incline to fix this. Otherwise, everything is working well.


    UPDATE

    The angle of the baffle is somewhere between 20° and 30°, about the minimum for unshelled peanuts to reliably roll off of it so none get left behind. On the old baffle, there would be a few peanuts sitting on it once the hopper was "empty". Instead of reducing the angle I cut a couple square cm from it and raised it about one cm to leave more clearance for the nuts to pass by.

    This seems to have fixed it - no more jams within the dispenser and quick, reliable dispensing of 1-2 nuts per dispense.


    UPDATE 2

    The angle of the feeder also matters. Since I simplified the mounting system, it is possible for the feeder to be mounted not quite vertical. In this case it was leaning a few degrees away from vertical making it more difficult for peanuts to reach the dispense opening. Adjusting this reduced the dispense time and increased reliability (no jams).


  • Incremental Improvements

    Stephen Chasey11/19/2025 at 13:51 0 comments

    Testing the new design has exposed some issues I want to fix in the short term. Rather than go straight to migrating to another platform I'm going to make the following changes first.

    New PCB

    • Add a dual channel DAC to replace the two pots and enable automated and remote sensor calibration - the DAC is cheaper than one pot and brings more functionality.
    • Improve the header arrangement to make it easier to work with.
    • Use connector sockets to group wires instead of having a bunch of separate wires - will make connections more robust and easier to connect. Maybe use locking headers.

    Mechanical

    • Enlarge the dispense opening - a huge (finger-sized) peanut jammed yesterday and took me 30 mins to unjam remotely
    • Check the pitch of the dispense baffle - I think it is too steep now and encourages jams

    I also want to look into some simplification.

    • Make enough internal space to use a 110mmx50mm 90° fitting instead of a 110x110mm 90° fitting with a 50mm adapter. The sliced-pipe approach to baffles also lets me create spaces within the enclosure to mount electronics. This will reduce size and remove a part from the BOM.
    • Try to eliminate the baffle in the dispense pathway. It's mainly for blocking light from entering the enclosure

    Previously I was focused on getting the birds to cooperate. Now that I know they will I am getting more focused on improving reliability, simplification and optimizing the BOM.

  • Redeployed

    Stephen Chasey11/10/2025 at 21:17 0 comments

    After a couple more tweaks, I turned it on and left it in timed dispense mode. The magpies and jackdaws remember it as a food source (even with a slightly different enclosure) and are visiting it already.

    I extended the dispense pathway tube to allow for a better fit for the mounting bracket and cleaned up the hose clamp mess by removing two of them. - now three hose clamps secure the mounting bracket and two of those also secure the platform. The fourth one below them secures the deposit assembly.

    The mounting setup is improved a bit as well. You can mount it on a wall or fence with just one screw. Three adjustable feet provide additional support and levelling.

    There are of course a couple more tweaks to the enclosure I want to make, but this is pretty close to final form as far as 110mm PVC goes. So it's open for business. I hope to make some progress with these birds in the coming weeks.

  • New Enclosure and Mechanicals

    Stephen Chasey10/21/2025 at 20:29 0 comments

    So I made the following improvements to the enclosure and internals.

    • The feeder is now 86cm (34in) tall (down from over a meter on the previous version)
    • Fewer parts and materials (and shorter wires) required to build
    • PIR sensor moved to camera arm
    • Dispense path is more difficult to jam
    • Deposit pathway is shorter and easier to mount the sensor on
    • Better way of placing internal baffles

    I've tested it, but have left it turned off for now. I'll first turn it on and let it run on a day I can work from home to monitor it. It took a bit of tweaking to get everything to fit while keeping it simple.

    Here's what it looks like now vs what it looked like before.

    Now

    Before

    I tried using one of those pole mounts for lights and cameras, but in reverse. I got this for 11 EUR on Amazon.

    It works prety well, but the feeder still needs a secondary point of support below the mount. I used a leftover bit of 110mm PVC pipe for this, but will hopefully think of a better way soon. If you are looking for hose clamps, sorry, I'm using all of them right now.

    The enclosure is now basically 4 sections. Here they are, and the parts they're made of.

    1. The deposit assembly.

    2. The dispense platform

    3. The electronics

    I was too lazy to disassemble the camera arm - it consists of:

    • 110mm to 50mm adapter
    • 50mm 90° elbow joint
    • ~10cm length of 50mm PVC pipe
    • ~3cm 200° arc of 50mm PVC pipe to secure the PIR lens
    • 50mm PVC end cap
    • small piece of transparency to protect the camera lens

    4. The hopper and dispenser

  • Mechanical and enclosure improvements

    Stephen Chasey10/15/2025 at 14:01 0 comments

    Have just worked out the kinks with the new enclosure and improvements.

    • The feeder is now less than 3ft tall
    • Fewer parts and materials (and shorter wires) required to build
    • PIR sensor moved to camera arm
    • Dispense path is more difficult to jam
    • Deposit pathway is shorter and easier to mount the sensor on
    • Better way of placing internal baffles

    It's still using a RaspberryPi Zero W v1.1 to run the show. After field testing these improvements I'll resume working on porting this to an ESP32.

    Will include some pics of the enclosure parts and assembly in next log update.

  • Back to it

    Stephen Chasey10/06/2025 at 14:50 0 comments

    Summer was busier than I expected, and I had no time for this project. Now things are getting back to normal and I'm almost done with the mechanical and enclosure improvements I wanted to make. I expect to have it back on the balcony in a week or so.

    On another note, while I was on vacation I was introduced to a site called AllAnimalApp. It has all kinds of resources for animal care, medical attention, rescues, shelters, pet-friendly facilities and more. Very useful if you have questions, are travelling with a pet or have found an animal that needs help.

  • Getting close to Stage 2

    Stephen Chasey06/26/2025 at 14:53 1 comment

    I think I can stop providing food on the platform after this week. There have been several accidental deposits daily for the last week or so and the birds are starting to add it up.

  • Jackdaws and Magpies

    Stephen Chasey06/23/2025 at 21:51 0 comments

    The first visitors were magpies, but now a group of jackdaws are visiting as well. For a week or so it looked like the jackdaws were taking posession of my balcony. Lately I have seen them tolerating each other, sometimes appearing to cooperate a little.

View all 149 project logs

Enjoy this project?

Share

Discussions

soni wrote 02/05/2025 at 19:23 point

A nie masz problemów z wrzucaniem kamieni?

  Are you sure? yes | no

Stephen Chasey wrote 02/05/2025 at 22:20 point

Not yet. So far, with the exception of yesterday's apple, the birds just deposit the bottle caps and cigarette butts I leave for them. The deposit sensor and motion detection are only active when the PIR sensor is triggered by something on or in front of the vending machine.

  Are you sure? yes | no

bobricius wrote 01/29/2025 at 18:41 point

How you train birds for this ?

  Are you sure? yes | no

Stephen Chasey wrote 01/30/2025 at 14:46 point

It's done in stages. First to attract the birds and get them to associate the machine with food. Once they are visiting, I put bottlecaps and cigarette butts on the platform so the birds will accidentally knock them in the hole when they come for food. Eventually they understand that when something goes in the hole, a peanut comes out.

Conditioning Stages

0 - Small amount of food in the area you will mount the vending machine to attract birds (~1 week)
1 - Food Provided, Timed Dispense, Deposit Provided (1-2 weeks)
2 - No Food Provided, Timed Dispense, Deposit Provided (2-3 weeks)
3 - No Food Provided, No Timed Dispense, Deposit Provided on the Platform (3-4 weeks)
4 - No Food Provided, No Timed Dispense, Deposit Provided Near The Platform (TBD)
5 - No Food Provided, No Timed Dispense, No Deposit Provided (GOAL!)


  Are you sure? yes | no

rafununu wrote 12/07/2024 at 13:13 point

I don't know where you live but here birds cannot own credit cards, no more cash either :)

  Are you sure? yes | no

Stephen Chasey wrote 04/22/2023 at 10:24 point

A shortcut to useful logs:

Dispenser Detail: https://hackaday.io/project/184754-vending-machine-for-birds/log/216908-dispenser-new-vs-old

Some things I learned during this project so far: https://hackaday.io/project/184754-vending-machine-for-birds/log/213051-some-things-ive-learned-so-far

PVC Enclosure Detail: https://hackaday.io/project/184754-vending-machine-for-birds/log/210037-pvc-enclosure-complete-and-mounted

Pics of my first two enclosures: https://hackaday.io/project/184754-vending-machine-for-birds/log/209466-new-enclosure-all-pvc

Similar projects: https://hackaday.io/project/184754-vending-machine-for-birds/log/207933-other-bird-litter-for-food-projects

  Are you sure? yes | no

John Opsahl wrote 09/23/2022 at 04:35 point

This project is way cool. Do you have a video of a bird dispensing an item and receiving a peanut? 

  Are you sure? yes | no

Stephen Chasey wrote 10/19/2022 at 14:52 point

Yes, there are a couple of videos in the files section.

  Are you sure? yes | no

Stephen Chasey wrote 08/07/2022 at 06:58 point

It could be adapted to dispense a peanut for each commit :)

  Are you sure? yes | no

fdufnews wrote 08/05/2022 at 14:22 point

Nerdfeeder

When I read the title, I first thought of a system to feed a pool of programmers

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates