Build an Automated Pet Feeder with Raspberry Pi: Camera Monitoring, Scheduled Dispensing, and Notifications
- Raspberry Pi Zero 2 W or Raspberry Pi 4
- Raspberry Pi Camera Module
- NEMA 17 stepper motor and A4988 driver
- Food-grade plastic storage container with lid
- DS3231 real-time clock module
- Load cell and HX711 amplifier module
- 5V/3A USB-C power supply for Raspberry Pi
- Momentary pushbutton for manual override
- Jumper wires and breadboard kit
- Pet food storage funnel or plastic auger tube
- 12V power supply for stepper motor
Automated pet feeders you can buy off the shelf tend to fail in one of two ways: cheap ones jam constantly and have no way to tell you they've jammed, and expensive ones lock you into a proprietary app with no local control and a cloud dependency for a feature as basic as "feed the cat at 6am." This build puts a Raspberry Pi in charge instead, which buys you a camera snapshot confirming the food actually left the hopper, portion control you can verify rather than just trust, a notification when it happens (or when it fails to), and a schedule that keeps working even without an internet connection.
Mechanical Design: Auger vs Rotating Tray Dispensing
Two mechanisms dominate DIY feeder builds, and they fail differently. An auger — a stepper-driven screw running through a tube from the hopper to the bowl — gives good portion repeatability by counting motor steps, but jams if kibble bridges above the screw or if a piece gets wedged between the auger and tube wall. A rotating tray with a cutout gives less precise portions but jams far less often, since there's no screw to bind. For dry kibble of fairly uniform size, an auger is worth the extra build complexity for the portion control it gives you; for mixed kibble sizes or anything with occasional large chunks, a rotating tray is the more forgiving choice. This build describes the auger approach, with jam handling built in, since it's the mechanism most people actually want for its portion accuracy.
Wiring the Dispensing Motor
Drive the auger with a NEMA 17 stepper through an A4988 driver, wired the same way you'd wire any stepper project: STEP and DIR pins to two GPIO pins on the Pi, driver logic power from the Pi's 3.3V rail, and motor power from a separate 12V supply shared with the driver's VMOT pin — never try to run the stepper motor current through the Pi's own 5V rail. Mount the stepper to a 3D-printed or laser-cut bracket aligned to the auger shaft with a simple shaft coupler, and keep the auger tube's inner diameter sized with a bit of clearance around the screw so kibble has somewhere to go rather than wedging.
Setting Up the Camera for Feeding Confirmation
A Pi Camera Module mounted with a clear view of the bowl, triggered to take a snapshot a few seconds after each dispense cycle completes, gives you the single most useful piece of feedback in this whole build: visual proof the food actually came out, rather than trusting that the motor turning means the bowl got fed. Using `picamera2` to grab a single still frame on demand is lightweight enough to run from a cron-triggered Python script without needing a persistent video stream running in the background.
Scheduling Feeds Reliably
A basic cron job calling your feed script at fixed times works for the common case, but add a DS3231 real-time clock module rather than relying on the Pi's system clock alone — a Pi Zero 2 W with no battery-backed RTC and no internet connection at boot will come up with the wrong time, and a feeding schedule built on the wrong time is the kind of failure that's invisible until a pet goes hungry. The DS3231 keeps accurate time across reboots and power loss on its own coin cell, and your feed script should read from it directly rather than trusting the OS clock blindly.
Portion Control: Timed vs Load-Cell Verified
The simplest portion control just runs the stepper a fixed number of steps per feeding, calibrated once by weighing what a known step count dispenses. That's good enough for most builds. Adding a load cell and HX711 under the bowl lets you verify the actual dispensed weight after each cycle and log it, which catches the case where a partial jam let through less food than intended — the stepper completed its steps, but a bridging clog meant less kibble than expected actually fell. If you want that verification, mount the load cell per the wiring in this site's load cell and HX711 guide and treat the dispensed-weight reading as your trigger for a jam alert rather than motor completion alone.
MechanismPortion accuracyJam frequencyBuild complexity Auger (stepper-driven screw)High, step-count repeatableModerate — bridging kibble can wedgeHigher — needs aligned shaft coupling Rotating tray with cutoutLower, volume-basedLow — few pinch pointsLower — simpler mechanism Gravity gate (timed flap)Lowest, flow-rate dependentLow, but inconsistent with damp foodLowestSending Notifications
A lightweight notification service like ntfy, self-hosted or using the public instance, is the simplest way to push a feeding confirmation (with the camera snapshot attached) to your phone without building a dedicated app. Have the feed script POST the snapshot image and a short status line after every cycle, and send a distinctly different, more urgent notification if the jam-detection logic below trips, so a failed feeding doesn't quietly blend in with routine successful ones in your notification history.
Handling Jams and Fail-Safes
Detect a jam by comparing expected outcome against actual: if you're using a load cell, a dispensed weight far below the calibrated expectation after a full cycle is your jam signal; without one, a stepper drawing current but visibly not advancing (if your driver board exposes a fault pin) or a photo showing an empty bowl after a cycle that should have filled it both work as fallback indicators. On a detected jam, stop the auger, trigger the urgent notification, and don't retry automatically more than once or twice — a jammed auger that keeps getting commanded to turn is how you strip a motor coupling or grind kibble into dust rather than fixing anything. Always include a manual override pushbutton wired to a GPIO input so a visible jam can be cleared and a test dispense triggered by hand without needing to SSH into the Pi.
Safety and Reliability Notes
Keep all wiring and the Pi itself sealed away from the food path and any spilled water or wet food residue — route cabling up and away from the hopper and bowl area rather than across it. Use a hopper with a tight-fitting lid to keep moisture and pests out between feedings, and clean the auger tube and bowl on a normal schedule the same as you would a manual feeder, since this build doesn't eliminate that maintenance. Finally, build in a hard ceiling on daily dispensing in software — a stuck-on relay, a repeated cron misfire, or a bug that re-triggers a feed cycle is a real failure mode for any automated feeder, and a simple daily-total check that refuses to dispense further once a sane maximum is reached is cheap insurance against overfeeding.
Once running, this setup quietly does the one thing a pet feeder actually needs to do well — feed on schedule, prove it worked, and tell you loudly when it didn't — without a subscription or a cloud outage standing between you and your pet's dinner.