THIS AI CAMERA FEEDER RECOGNIZES YOUR PET AND REFUSES TO FEED THE WRONG ONE

A cheap ESP32 camera module that feeds your pet only when it sees the kind of animal you picked.

by Pierce Brandies

FULL CAD BOM FIRMWARE DOCS

HomeAI

Built withESP32

difficulty
●●●○○
time
a weekend
license
MIT
repo
repo ACTIVE32 stars
1
Jump to section

COMPAREE VERDICT

Pierce Brandies' PetFeeder pairs an ESP32-CAM with a servo and a Flask web app that can feed automatically when it detects the animal you selected. A YOLOv8 model detects a dog, cat or bird; you set portion size and the interval between feeds in the web interface. The MIT licence is clean and the software side is ready to run, but the repository leaves the mechanical side to you. There is no CAD for the housing and no mechanical assembly guide; the README gives wiring diagrams and a short hardware list (ESP32-CAM, a programmer board or FTDI adapter, a digital servo) but no model numbers. The thing most likely to go wrong is the dispenser itself: kibble can bridge, portions vary with servo throw, and the camera needs a clear view. If you are comfortable designing and prototyping a feeding mechanism, this is a weekend project. If you expected step-by-step hardware plans, most of your time will go into mechanical design rather than the code.

GOOD TO KNOW

  • —MIT license, unrestricted use including commercial
  • —Python Flask web app and ESP32-CAM firmware are both in the repo
  • —YOLOv8 model file is included, OpenCV draws the bounding boxes
  • —No parts list — the README names the ESP32-CAM and servo but gives no quantity, model number, or source
  • —No mechanical design files — the feeder housing and dispenser mechanism are not documented
  • —Setup instructions cover software installation but skip camera mounting and servo attachment

Parts to buy

5 items

From our check of the build. Exact quantities and part numbers are in the creator’s BOM.

BUILDS OF THE WEEK

Five open-source builds worth your weekend, every week.

Checked like this one: what’s really in the repo, what it costs, how hard it is. One email, unsubscribe anytime.

Can I build this?

Printnothing required — or your own feeder enclosure if you design one
BuyESP32-CAM module, servo, USB power supply, enclosure material, pet food container
ToolsPython environment, soldering iron, basic hand tools for assembly
Skillsintermediate — Python and Flask setup are straightforward, but mechanical design and reliable kibble dispensing take iteration
Timea weekend if you already have a dispenser design, longer if you are prototyping the mechanism from scratch
Cost$ — an ESP32-CAM board, a programmer board or FTDI adapter and a hobby servo are all inexpensive parts; the rest depends on your enclosure materials. The project does not list prices.
SafetyLow-voltage electronics; the README does not specify a power supply, so power the ESP32-CAM and servo from a supply rated for both. Keep the servo and moving gate out of reach of your pet's paws and tongue, and keep wiring away from food and water.

Build at your own risk. Projects involve tools, electronics and sometimes mains voltage — follow the creator’s safety notes.

Videos

CS50 Final Project - IoT Automatic Pet Feeder Using Object Detection

Pierce's own CS50 demo video, linked from the README, showing the feeder detecting his dog and dispensing food.

More builds like this

All projects

Gallery

opengraph.githubassets.com
radar.comparee.ai
img.youtube.com
img.youtube.com

Start here

Navigation into the creator’s own docs — we don’t rewrite the guide, we route you to the source.

  1. 1.Clone the repository and install Python dependencies (Requirements.txt is provided for the Flask app and OpenCV stack.)
  2. 2.Flash the ESP32-CAM firmware(Arduino sketch is in the repo; you will need the ESP32 board definitions installed.)
  3. 3.Design and build your dispenser mechanism(Not documented — you need a way to mount the camera, attach the servo, and reliably drop a measured portion of food.)
  4. 4.Configure pet type and portion settings in the web app (The interface lets you set animal class (dog, cat, bird), portion size, and minimum interval between feeds.)

Resources

Documentation, files and community threads for this build — we link straight to the original sources and never rehost the creator’s files.

KNOWN ISSUES

  • There is no parts list with model numbers or quantities — you are guessing servo torque and throw distance
  • No mechanical plans means you will design your own hopper, chute, gate, and camera mount from scratch
  • Kibble bridging is real — gravity-fed dispensers jam unless the hopper geometry and gate are sized correctly
  • Servo position to portion size is not calibrated — you will tune it by trial, and it changes if you switch food types
  • Detection confidence only has three presets in the settings page (0.5, 0.65, 0.8); anything finer means editing app.py, and the camera IP is hard-coded in helpers.py.
  • ESP32-CAM has no onboard programming header — you need a USB-to-serial adapter and jumper wires to flash it the first time

What animals does the model recognize?

Dog, cat and bird are the options in the app. The bundled YOLOv8 nano model is the standard COCO model, so other common COCO animals would mean editing the code; pets outside COCO would need a retrained model.

Can it tell my cat apart from the neighbor's cat?

No — it classifies species, not individuals. You would need a different model trained on your specific pet's face or markings.

How is portion size controlled?

You pick Small, Medium or Large in the web interface and the ESP32 runs a matching servo sequence. There is no calibration step, so portion size in grams depends on your dispenser geometry and food type.

Does it work with wet food?

The repository does not say. A servo-driven gate suits dry food; wet food would need a different dispensing mechanism, such as a rotating tray.

What if the camera feed goes dark or the servo jams?

Not addressed in the code. You would add error handling yourself — watchdog timers, feed attempt logging, or a manual override button.

Community builds

No community builds yet — be the first, we feature the best ones.

Discussion1

FROM THE COMPAREE TEAM

The YOLOv8 model classifies dog, cat, or bird — but it does not tell your cat from the neighbor's. Would individual pet recognition be worth the extra training effort, or is species-level filtering good enough for your setup?

CompareeTEAM2mo agoedited

Practical notes from our verification: the Flask app and ESP32 firmware are both in the repo, along with the yolov8n.pt weights file, so the software side is ready to run. The README lists the hardware (ESP32-CAM, an ESP32-CAM MB or FTDI adapter for programming, and a digital servo) and includes two wiring diagrams, one for the camera and servo and one for programming. What it does not include is the mechanical side: there is no hopper design, no servo mounting bracket and no camera placement guide. If you have built gravity feeders before and know how to stop kibble from bridging, this is a weekend. If this is your first dispenser, budget time for mechanical prototyping, because most of the work is getting reliable portions, not tuning the model. Correction (4 October 2026): we re-checked this page line by line against the project's own repository, documentation and videos, and fixed errors in earlier versions.

Pierce Brandies

Pierce Brandies built PetFeeder as his CS50 final project, with a dog named Binnie as the detection test subject and the star of the demo video. The project is MIT-licensed and hosted on GitHub.

GitHub

Star the project on GitHub

DISCLAIMER

  • Comparee is not the author of the projects featured here. All rights to each project belong to its creator — every page links to the original source, and we never host creators’ files.
  • Information is provided without warranty and may become outdated as projects evolve. Prices are indicative bands only — always check the creator’s parts list for current costs.
  • Building and operating any project is at your own responsibility. Protective equipment, safe workshop practice and compliance with local regulations are the builder’s responsibility.