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.

Public Chat
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. Rodent proof, runs on 5-6V, one moving part (vibration motor). No 3D printing or laser cutting required, just some basic hand tools. Lots of improvement and customization possibilities. Lots of possibilities for the enclosure.

MAIN FEATURES

- portable
- saves power until a warm body is present
- battery/solar or mains powered
- keep-alive for USB power banks
- one moving part
- accessible components and materials
- weatherproof
- rodents can't break in and get the food
- cheap to build
- highly customizable - can be built as an outside platform or into an operant conditioning box
- optional external monitoring and control

This is not a new idea. 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-other-bird-litter-for-food-proje

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
  • 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 BOM (PCBWay): https://www.pcbway.com/project/shareproject/Vending_Machine_for_Birds_11f2a4da.html...

Read more »

20231029_175433.mp4

Brief functional demo with the Rev B V 1.1 board from PCBWay and improved dispenser.

MPEG-4 Video - 2.79 MB - 10/29/2023 at 19:47

Download

20230601_233103~2.mp4

Brief functional demo with the new board from PCBWay

MPEG-4 Video - 27.06 MB - 06/04/2023 at 12:53

Download

Vending Machine For Birds_16-29-47.mp4

Jackdaws are starting to use the bottlecap magazine.

MPEG-4 Video - 922.07 kB - 05/25/2023 at 14:31

Download

vlc-record-2023-05-02-16h26m38s-Vending Machine For Birds_16-20-56.mp4-.mp4

Showing the improved dispenser performance since changing the baffles and eccentric load on the motor.

MPEG-4 Video - 1.50 MB - 05/02/2023 at 14:29

Download

11-21-10.mp4

Another pigeon using the bottlecap magazine.

MPEG-4 Video - 19.70 MB - 02/23/2023 at 01:30

Download

View all 21 files

  • PCBWay 6th Project Design Contest

    Stephen Chasey5 days ago 0 comments

    A while back I submitted the analog version of this project to the PCBWay 6th Project Design Contest, and I actually got a prize!

    PCBWay has been very supportive of this project since the beginning and I am excited that the first PCB I made with Kicad got some recognition.

    Now to finish assembling and testing the peanuts-in-the-shell enclosure for the microcontroller version.

  • Code is ready (functional anyways)

    Stephen Chasey02/23/2024 at 15:13 0 comments

    After a month of occasionally working on moving all the main logic to one python script and debugging I think it's ready. It's all interrupt- and timer-driven, just like the analog version. It took a little work to make sure it worked well with both op amps and comparators, especially since I did not really design the circuit to work with comparators (no feedback to reduce hysteresis) and did not include capacitors to absorb the initial blip you sometimes get with phototransistors.

    In the analog version, I had the camera recording while the sensor IR LEDs were on instead of using motion detection. For this version I'm still just enabling and disabling motion detection to trigger recording.

    I also optimized the status overlay for motioneye so it's more informative.

    https://github.com/src1138/VMFB-MC

    The code works, but is as a friend of mine described it, "janky". There is still room for improvement, but for now it's usable and appears to work consistently.

    • You can enable and disable the powerbank keep-alive and timed dispense from the web interface.
    • You can trigger a manual dispense event from the web interface.
    • The video overlay indicates the state of PIR, deposit, dispense, feed level, sensor IR LEDs and the dispense motor. 
    • The video overlay also shows the count of how many times PIR, deposit, dispense, timed dispense and manual dispense were triggered that day.  
    • You can easily use other types of sensors or switches in place of the PIR and phototransistors if your situation calls for it.

    Here is a screenshot. The numbers are the result of testing and debugging. The sensor IR LEDs are on (SIR is red). The peanut level is low and the timer is enabled.

    I will share some better screenshots and a short video soon.

    I found a better way to mount a camera in the enclosure so it gets a good shot of the platform without being in the way or using a side-mounted arm. 

    Finally I found a better solution for rodent-proofing that should allow me to make the enclosure a little smaller without making it easy for rodents to get in there and have a feast. I have not had any rodent issues since I started this project, but this is a pervasive problem with bird feeders and I want to mitigate it as much as possible.

    I expect to have another complete prototype based on the VMFB-MC with the above improvements and dispensing peanuts in the shell ready in the next 3 weeks. Since the peanuts will be in the shell, pigeons will not be able to eat them, but the jackdaws, magpies and crows that come by my balcony love them. Hopefully this will keep me from running afoul of the HOA for feeding pigeons.

    I think these changes, along with the event logging and dashboard, will make this a more practical solution for students and researchers wanting to experiment with behavioral conditioning and collect data automatically. The VMFB can be adapted to use with other animals like rats or mice and apply to different use cases.

  • VMFB-MC PCB Populated

    Stephen Chasey01/07/2024 at 02:59 0 comments

    I found time to populate the board and am working on the code to make it work with an RPi Zero W and motioneyeos. Hope to be able to demonstrate it soon.

    From top left to bottom:

    Dispense Sensor, Empty Sensor (for peanut level)

    Deposit Sensor

    Main Board

  • VMFB-MC PCB Received

    Stephen Chasey01/03/2024 at 18:56 0 comments

    Fabricated, shipped and received in less than a week - and over the New Year holiday!

    Quality looks great as usual (PCBWay) - looking forward to populating and testing it.

    For anyone insterested, here's the PCBWay share project link: https://www.pcbway.com/project/shareproject/W586910ASV7_VMFB_MC_RA_V1_0_20231227_ecb23676.html

    The all-analog VMFB and the VMFB-MC PCBs side-by-side to show how much smaller it is without all the 555's :) The main board is now about the same size as a Raspberry Pi Zero.

  • Update and smaller PCB footprint/BOM

    Stephen Chasey12/15/2023 at 18:08 0 comments

    It's been a little over a month since the student in Warsaw deployed one of these and despite freezing temps and lots of snow the thing has been working fine. It does get clogged with snow build-up though, so a small resistive heater on the plarform is a good idea if you are doing this when there is a lot of snow.

    I experimented with dispenser designs that could reliably dispense unshelled peanuts. The one I landed on is just a simplified version of the shelled peanut dispenser. One baffle at a 10-15 degree angle, one vibrating plate with an opening on one side. It works pretty well, and would allow me to deploy it where feeding pigeons is prohibited since pigeons can't eat unshelled peanuts and can't figure put how to open them. The larger openings makes keeping it rodent-proof a challenge. The dispense tube went from 32mm to 50mm. A rat or small squirrel could get in there and cause problems. I'll have to think of a solution for that.

    In an effort to make this a more useful research tool I designed a new PCB that relies on external GPIO to work. Sadly, no 555's in this one, but the BOM is smaller (44 components including headers) and so is the footprint (6.5x6.8cm including sensors). This should make it easier to build and install, and you can use prety much any microcontroller, development board, ot SBC to control and monitor it.

    It's not fully baked yet - I will create a version tag after I get one made and teseted.

    https://github.com/src1138/VMFB-MC

    Current Schematic

    Current PCB

    Board Dimensions: 65x68mm

    Front

    Back

    BOM

    Component Count: 44

    Ref Qnty Value
    D1, D2, D3, D4, D5, D6, D8 7 IR LED
    D7 1 1N4001
    J1, J2, J3, J6, J7, J8, J10 7 Conn_01x04_Pin
    J4 1 Conn_01x02_Pin
    J5 1 Conn_01x03_Pin
    J9 1 Conn_01x05_Pin
    Q1, Q2, Q3, Q4, Q5, Q6, Q9 7 SFH313FA-2/3
    Q7, Q8 2 TIP120
    R1, R2, R4, R5, R6, R7 6 150R
    R3 1 1K
    R8, R9, R10, R11, R12, R13, R14 7 10K
    RV1, RV2 2 100K
    U1 1 LM393

    Total BOM cost for all electronic components including a Raspberry Pi Zero W, 8GB micro-SD card, a wide-angle camera module, PIR sensor, a motor and a terminal strip (to make the vibration motor) cost €59.62 at Mouser (not  the cheapest place, but while I'm in the Dallas area for the holidays delivery is next day). Jumper wires (36x F/F) are not included in this BOM, but cost around €6 in most cases. The PCB will cost about €7 per board at PCBWay.

    Here is the Mouser cart (minus some non-informative columns).

    Mfr. NoManufacturerDescriptionOrder Qty.Price (EUR)Ext.: (EUR)
    TIP120STMicroelectronicsDarlington Transistors NPN Power Darlington20.7441.49
    SFH 313 FA-2/3ams OSRAMPhototransistors PHOTOTRANSISTOR70.6424.49
    LM393PTexas InstrumentsAnalog Comparators Dual Differential10.4280.43
    1N4001Diotec SemiconductorRectifiers Diode, DO-41, 50V, 1A10.2140.21
    15400594F3590Wurth ElektronikInfrared Emitters WL-TIRC IR THT Blue 5mm 940nm70.42.8
    61304011121Wurth ElektronikHeaders & Wire Housings WR-PHD 2.54mm Hdr 40 P Single Str Gold11.421.42
    MF1/4LCT52R151JKOA SpeerMetal Film Resistors - Through Hole 1/4 WATT 150 OHM 5>#/td###60.1010.61
    MF1/4LCT52R102JKOA SpeerMetal Film Resistors - Through Hole 1/4 WATT 1K OHM 5>#/td###10.1010.1
    MF1/4LCT52R103JKOA SpeerMetal Film Resistors - Through Hole 1/4 WATT 10K OHM 5>#/td###70.1010.71
    PT10WV10-104A2020-1CRPMAmphenolTrimmer Resistors - Through Hole 100K 20% 10mm POT CREAM COLOR SHAFT20.8861.77
    114992065Seeed StudioCamera Accessories Camera Cable for Raspberry Pi Zero12.32.3
    SC0065Raspberry PiSingle Board Computers Raspberry Pi Zero WH (With Pre-soldered GPIO Header)114.8814.88
    U054M5StackInfrared Detectors An M5StickC compatible human body induction sensor13.263.26
    PPN7PA12C1MinebeaMitsumiAC, DC & Servo Motors DC Brush Motor, Flat, 11605RPM, 5VDC12.72.7
    39100-1802MolexBarrier Terminal Blocks TERM STRIP 8MM HIGH PROF 2 CIR WHT10.7350.74
    114110130Seeed StudioCameras & Camera Modules OV5647-160 FOV IR Camera module for Raspberry Pi 3B+4B, suitable for large or night...
    Read more »

  • Shipped one

    Stephen Chasey11/08/2023 at 13:47 0 comments

    I received my packaging materials today, so I packed up and shipped one to Warsaw for the student I mentioned a couple of updates ago.

    This is what they will get:

    I had to break it down a little for shipping (I included mounting hardware):

    So it would fit in a 100x25x35cm box (weight 7kg):

    I used soooo much bubble wrap - I hope it arrives in good condition.


    UPDATE

    They received it in good condition. Hopefully setup will go ok. I really want this to be easy to setup and use, so this is a good test.


    UPDATE

    After fixing a few connections that came loose in shipping, it seems to work and is mounted. Now it's up to the birds. Kudos to the student for some excellent troubleshooting and fixing.

  • More efficient remote monitoring

    Stephen Chasey11/07/2023 at 16:01 0 comments

    I have been experimenting with ESP32 and RPi camera modules to record video and pictures as well as log events in log files. While cameras typically demand 100-150 mA,, the boards themselves can make due with ~80mA and can be put to sleep to consume less power when nothing is happening.

    Since the ESP32 is less power-hungry than an RPi I will use one to make a simple event logger that is accessible over wifi and bluetooth so experimenters will have an easy way to monitor activity without video. The parts to do this with an ESP32 cost about 10EUR.

    This would also make it more practical to run the vending machine off of batteries/solar and allow remote log collection via the internet, internal network, or when in proximity of bluetooth.


    UPDATE

    After looking more into it I could use an ESP32 and provide the ability to monitor, get logs, do some simple graphing, configure and control the vending machine via wifi or bluetooth using just a few additional parts. I could even integrate one of the ESP32 CAM modules without more wires. Even with an ESP32 dev board and an ESP32 CAM board, all the electronic components (there would be a lot less of them) would cost ~25 EUR.

    This would be a big shift away for the current all-analog approach, but since ESP32 boards are pretty inexpensive, have radios, have lots of GPIO and are not too difficult to program I think this would make this project much more functional and more attractive to people that just want to use the thing without spending an hour or so soldering.

  • Rev B V 1.1 PCB, improved dispenser, simplified enclosure,

    Stephen Chasey10/29/2023 at 20:07 0 comments

    I offered to build a vending machine for a university student who wants to use it for a study. I had to think about optimizing for shipping, simple setup and mounting, and for reliable operation by someone not familiar with the electronics and mechanisms.

    Rev B V 1.1 PCB

    Finally - works as intended with no bodges! I'm so happy about this. You can find it at PCBWay here: https://www.pcbway.com/project/shareproject/Vending_Machine_for_Birds_11f2a4da.html

    The Kicad files are on GitHub: https://github.com/src1138/VMFB

    Improved Dispenser

    To give the vibration platform a little slack to vibrate in and keep it from slowly rotating and tangling or pulling on wires. I cut 3 small legs into the PVC pipe slice that supports them and matching notches in the platform. This way, you don't need to manually adjust anything and it will work reliably.

    Here is a short video showing the improved dispenser at work. It's quieter and faster than before.

    https://cdn.hackaday.io/files/1847547904515136/20231029_175433.mp4

    Improved Baffle

    The baffle used to be horizontal, so some peanuts would just sit there as the vending machine peanut level ran low. I used a dremel to slice a piece of PVC pipe at a slight angle so it would have a downward slope. The slight vibration that reaches the baffle from the dispenser is enough to make sure everything rolls off down to the dispenser.

    Simplified enclosure

    The student will use an external camera, so I didn't put a camera arm on this one. I did simplify it a bit - slightly more compact with fewer parts. The deposit sensor monitors a 45° opening instead of a vertical opening, so rain and dripping water will not pass by the sensors while objects will. Any water that does get in will drain out the bottom.

    They will also be using mains power outside, so I put a plug on it with a safety box. The lower half comes off if you loosen a hose clamp so you can look inside, swap batteries or troubleshoot.

    Mounting

    I've found that when mounting on vertical objects like railing support or fence posts, hose clamps work great.

    I plan to ship this in the next few days. Will be a challenge to pack and pad to insure it arrives in the same condition it leaves in.

  • Enclosure details - finally

    Stephen Chasey09/28/2023 at 20:18 0 comments

    I've been pretty lax on details for the enclosures and dispenser assemblies I've made, so I've finally documented the PVC pipe enclosure and dispenser in the project details here: https://hackaday.io/project/184754-vending-machine-for-birds/details

  • Camera and monitoring complete - for now

    Stephen Chasey09/18/2023 at 11:10 0 comments

    I managed to enable/disable the camera based on a schedule, so I think I can wrap this part up. Power consumption while the sensors are idle and the camera is disabled is ~110mA. With the camera enabled it draws ~185mA. Streaming adds another ~35mA (~220mA with camera enabled and streaming).

    To recap what's there so far:

    Monitors

    • PIR - state and # of times it was triggered today
    • Sensor IR - state (on or off)
    • Timer - state (on or off)
    • Feed - state (ok or low)
    • Deposit - state (ok or jammed) and # of times it was triggered today
    • Dispense - state (ok or jammed) and # of times it was triggered today

    Controls

    • manual start and stop of recording
    • manual dispensing of feed
    • manual snapshot of still images

    I removed the manual turning on of the sensors, as this is not super useful by itself, at least with my use case. I also removed the buttons to manually enable and disable the camera, as there is already a place in the UI to do this.

    Logs

    • All monitored events are logged with datetime stamps
    • Vending machine logs are rotated daily

    Recording

    • records while the sensors are on (meaning a bird is triggering the PIR)

    Power Saving

    • camera is enabled at 6:00am and disabled at 6:00pm (on/off times are configurable) to save power overnight

    Updated scripts are on GitHub. I also added a VMFB_timer.sh script you could use instead of the 555-based timer on the PCB. 

    So now I will add some documentation to GitHub on how to use these scripts with motioneye/motioneyeos and the PVC enclosure build.

    I am feeling like I've hit the "feature-complete" milestone on this project - it's doing everything I want it to. 

    • Works as a vending machine for birds
    • Runs sustainably off solar power
    • Optional remote monitoring and control 

    Now I just need to get it back outside somewhere.

View all 101 project logs

Enjoy this project?

Share

Discussions

l.ennyburkdoll wrote 05/15/2023 at 06:11 point

That project is best for birds.

https://www.pfmlogin.org/

  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