Skip to content
MCU Atlas

Automatic pet feeder: serve kibble on a schedule with an ESP32

An ESP32, a stepper and a 3D-printed auger serve measured pet meals on a schedule you set from your phone — no app, no cloud, same dose every time.

Difficulty:BeginnerSource available

What it is

A build-it-yourself pet feeder: an ESP32-DevKitC drives a NEMA-17 stepper turning a 3D-printed auger, serving measured meals on a schedule you set from a web page the feeder itself serves — no app, no cloud, no subscription. Our merged single-board design, inspired by two open-source feeders (MIT and GPL-3.0, linked below).

What you need

  • ESP32-DevKitC (ESP32-WROOM-32) linked — the controller: clock, schedule, settings page, motor
  • NEMA-17 stepper (200 steps/rev) + DRV8825 driver linked — the drive pair; the A4988 is pin-compatible
  • Power supply set: 5 V ≥2 A + 8–12 V 1 A (or 12 V + buck) unlinked — no catalog page; a dual-rail build
  • 100 µF electrolytic capacitor unlinked — required across the motor rail, not decorative
  • PETG filament, ~150–250 g unlinked — printed hopper, auger and mount (design sourced separately)
  • Micro servo SG90 (variant only) linked — the simpler gate-style build without the stepper driver
  • ESP32-CAM (optional upgrade) linked — pet-detection gate, a standalone second device

How hard

Beginner with one honest step up: the logic wiring is a handful of wires, but the DRV8825's own 8–12 V motor rail with its 100 µF capacitor is the one place careless wiring costs a part. The pure-servo gate variant drops the driver and is a true first-actuator build. An afternoon to first kibble; a weekend printed, calibrated and mounted.

Photos

Wiring the auger drive: ESP32 to DRV8825 to NEMA-17, with the SG90 gate-servo option and the 12 V power rail. Pins per the verified build packet. Hand-authored by MCU Atlas — not a maker image.
How kibble gets dosed: a typical hopper-and-auger design. Grams-per-turn is what you calibrate with a kitchen scale. Hand-authored by MCU Atlas as a generic 'typical design' — neither source repo ships printable geometry.

Photos: MCU Atlas (original diagram)

Key Facts

  • Single-board design: schedule, web interface, clock and calibration all live on the ESP32 alone — no Raspberry Pi, no laptop, no cloud (our merged design, inspired by both source projects)
  • Dosing by counted revolutions: a NEMA-17 at 200 full steps per turn makes "how much food" a number of auger turns, not a hope
  • NTP network clock plus on-chip preferences storage: the schedule survives power cuts and Wi-Fi outages, and feed times match your phone's clock
  • Settings served from the chip: a web page on your own Wi-Fi — feed times, portions, a feed-now button — with a once-per-minute fed latch
  • Calibration is yours: five weighed test feeds fit a grams-per-turn line (±5 g-class); the reference build's ±4 g is its author's stated target on his hardware
  • Printables honesty: neither source repo ships printable hopper or auger geometry — sourcing a printable design is its own step (150–250 g PETG)
  • Sources: PierceBrandies/PetFeeder (MIT, 34★ as of 2026-11-15) and smart2pet/SmartPET-Feeder (GPL-3.0, 34★ as of 2026-11-15), quiet since 2024 and 2023 — all four dependency libraries verified maintained in 2026
  • Dual-rail power: 5 V logic and 8–12 V motor rails with a 100 µF capacitor across VMOT — never feed 12 V into the board's 5 V pin
  • Upgrade path: an optional ESP32-CAM as a standalone second device can gate feeding on pet detection (recognition runs on your computer, not the camera chip)
  • A feeder is not a sitter: it cannot sense a blocked bowl, an empty hopper or a sick pet — check it, especially in the first week

About This Project

Set dinner from your phone: an ESP32, a stepper motor and a 3D-printed auger become a pet feeder that serves measured meals on a schedule — no app to rot, no cloud subscription, no "someone is home by six" ever again. Kibble sits in a hopper above a vertical tube; inside the tube an auger — a spiral screw — is turned by a NEMA-17 stepper motor. Turn the auger and it carries a fixed volume of kibble down into the bowl; turn it N times and you get N doses. Because a stepper moves in exact, countable revolutions — 200 full steps per turn on the standard motor this page uses — "how much food" becomes "how many turns": a number, not a hope. This is the classic first-actuator project, with a payoff every pet owner already wants.

One chip does everything

The ESP32 does everything else, and it does it alone, which is the point of this design. The clock comes from the network — the ESP32 syncs its time over NTP, so the schedule stays true without any real-time chip. The schedule lives on the chip: feed times and portion sizes are saved to the ESP32's non-volatile preferences storage, so a power cut doesn't eat the cat's dinner settings. The interface is a web page the ESP32 itself serves on your Wi-Fi — open it from your phone or laptop on the same network, set times and portions, done. When the clock matches a feed time, the firmware fires the auger for the right number of turns — once, with a "fed" latch so the same minute can't fire twice. The dose comes from calibration: you weigh a few test feeds with a kitchen scale, the firmware learns grams-per-turn, and every meal after that is repeatable.

There is no cloud service, no companion app, and no subscription. If your Wi-Fi is down at dinner time, the feeder still feeds — the schedule is on the device.

Why build this — and what this page is (and isn't)

If you've never moved something with code, this is the place to start: an actuator you can hear working, a result measured in grams, and a payoff every day at breakfast. The parts are commodity — a dev board, a stepper and driver that have been the standard pairing for a decade, and printable mechanicals. And unlike the commercial feeders it replaces, this one is yours: the schedule logic is twenty lines you can read, and nothing phones home.

Now the honest part, because this page is built on two open-source projects and owes them credit, not exaggeration. PierceBrandies/PetFeeder (MIT, 34 stars as of 2026-11-15) is an ESP32-CAM feeder with a genuinely nice beginner feature — Wi-Fi setup through a captive portal, no hardcoded passwords — and an ambitious trick: it recognizes your pet with a camera and only feeds the right animal. But its brain is a Python program on your computer: the camera detection and the wait-between-feeds timer run on a laptop, not on the device. smart2pet/SmartPET-Feeder (GPL-3.0, 34 stars as of 2026-11-15) gets dosing seriously right — it calibrates grams to auger turns instead of guessing — but its web schedule, touchscreen interface and database all live on a Raspberry Pi, with the ESP32 reduced to a USB-attached motor slave.

Neither one, on its own, is "set the schedule from your phone and the ESP32 handles the rest." That single-board design is this page's merged build — the auger-and-calibrate approach of SmartPET-Feeder, the Wi-Fi provisioning style of PetFeeder, and the scheduling moved onto the ESP32 itself — inspired by both projects and credited to both. Treat them as design references we learned from, not firmware to copy; the freshness section below explains exactly why.

Skills you'll learn

Driving a stepper motor — the DRV8825 driver, its step and direction pins, its microstepping pins, and why the motor gets its own power rail with a capacitor across it. Motors as measurement — why a stepper's counted revolutions turn "dispense some food" into "dispense 40 grams" while a plain servo can't do that without help. Serving a web interface from a microcontroller — a settings page the ESP32 hosts itself, Wi-Fi provisioning through a captive portal, and NTP time sync. And calibration with a kitchen scale — the weigh-it, plot-it, fit-a-line procedure that underlies every dosing system from this feeder to a pill counter.

Difficulty, time and cost

Beginner-friendly with one honest step up. The electronics are a handful of wires, but the DRV8825 wants its own 8–12 V motor supply and a decoupling capacitor — the one place in this build where careless wiring costs a part rather than a rerun. A simpler pure-servo variant (the gate-style dump door in the parts list) drops the driver entirely and is a true first-actuator build. Time: an afternoon to first kibble on the bench; a weekend including printing, calibrating and mounting. Cost: a dev board, stepper, driver and power supply put the core build in the same range as one commercial feeder — and this one won't ask for a subscription.

The parts you'll need

The controller is an ESP32-DevKitC (ESP32-WROOM-32): it keeps the clock, serves the settings page, stores the schedule and drives the motor. The drive is a NEMA-17 stepper (200 steps per revolution) — any length works; this is the standard RepRap-class motor — paired with a DRV8825 stepper driver breakout, the power stage between the ESP32's 3.3 V logic and the motor (the reference build uses the pin-compatible A4988; the swap is a one-line change the library supports). A micro servo (SG90) is needed only for the simpler gate-style variant. Power comes as a set: 5 V at 2 A or more for the board, and 8–12 V at 1 A for the motor rail — or one 12 V supply plus a buck converter to 5 V. A 100 µF electrolytic capacitor goes across the motor supply; stepper spikes without it can reset or damage the driver. Budget 150–250 g of PETG filament for the printed hopper, auger and mount. An ESP32-CAM (AI-Thinker) is an optional second device for the pet-detection upgrade — never part of the feeder's wiring.

Soldering is limited to header pins if that. The tools that matter: wire strippers, a USB cable for flashing, access to a 3D printer (yours, a friend's, or a printing service) for the mechanicals, and — non-negotiable for the calibration step — a kitchen scale that reads in grams.

The printed parts — an honest warning

Here is the part no source page will tell you: neither project this page is built on ships usable printable geometry. PetFeeder has no printed parts at all — its servo simply sweeps whatever dispenser you attach. SmartPET-Feeder includes one monolithic 6.3 MB model file that is not print-ready: no separated parts, no documented auger diameter or pitch, and its own README's advice is essentially "find a motor that fits, or remodel it." Any page that claims you can print the included parts from either repo is wrong.

So sourcing the mechanicals is its own step, and this page treats it honestly: search the printable-model sites for a hopper-and-auger feeder design (they are a well-populated genre), and check three things before you commit filament — the auger fits standard NEMA-17 shaft coupling, the tube diameter suits your kibble's largest piece, and the model is published as separated, printable parts rather than one sculpture. The architecture you are looking for is generic and shown in the diagram: a hopper feeding a vertical auger tube ending over the bowl. Naming and linking a specific vetted printable design would need its own source check — this page deliberately does not guess one.

Wiring

The wiring follows the reference build's pin map (it ships an A4988 with the DRV8825 variant already prepared as a commented option — the pins are identical). On the logic side: DRV8825 DIR to GPIO5, STEP to GPIO4, SLEEP to GPIO2 tied to the board's RESET so the driver wakes with the ESP32, and the three microstep pins MODE0, MODE1 and MODE2 to GPIO10, 11 and 12 — all three LOW means full-step, which is what the 200-steps-per-revolution math on this page assumes. One practical note: GPIO10 and 11 are the WROOM-32 module's internal flash pins and are not broken out on a stock DevKitC — for full-step operation the MODE pins may simply be left unconnected, because the DRV8825's internal pull-downs hold them LOW for you.

On the power side: VMOT to the 8–12 V motor supply with the 100 µF capacitor across VMOT and GND as close to the board as you can solder it, driver VDD to 3V3, and the motor supply's ground connected to the ESP32's ground — common ground, or nothing works reliably. The NEMA-17's two coils go to the driver's A and B output pairs; if the auger turns the wrong way, swap one coil pair or just invert DIR in firmware. The board runs from the 5 V supply (or the buck converter's output) — never feed 12 V into the board's 5 V pin. The servo variant, if you chose the SG90 path, takes its signal on GPIO14, powered from 5 V with a common ground. The full step-by-step wiring is in the build tutorial below.

Firmware: one chip, one clock, one settings page

The firmware on this page is a clean-room description of a merged design — inspired by both projects, copying neither's code (SmartPET-Feeder is GPL-3.0; we credit and link it rather than reproduce it). The shape of it: provision Wi-Fi the PetFeeder way with a captive portal on first boot (the WiFiManager library's pattern) — the board appears as its own access point, you pick your home network from your phone, and no passwords are hardcoded into the sketch. Get the time from the network: sync the clock via NTP so feed times mean what your phone means by them. Serve the settings page: a small web page the ESP32 hosts — feed times, portion sizes, a feed-now button — with everything saved to on-chip preferences so it survives reboots and power cuts. And feed on schedule: when the clock's hour-and-minute matches a feed time, convert the portion's grams to auger turns using your stored calibration and rotate the stepper that many turns. Fire once, set the latch, don't fire again on the same minute — a deliberate fix for the duplicate-feed bug found in the reference build's scheduler when vetting it.

Every library this build depends on was checked alive and maintained as of publication: the stepper library (laurb9/StepperDriver, MIT — registry version 1.6.0, updated 2026-07-18), the servo library (madhephaestus/ESP32Servo, updated 2026-07-22 — use v3.0 or newer on the current ESP32 Arduino core), the Wi-Fi provisioning library (tzapu/WiFiManager, MIT, updated 2026-02-25), and, for the camera upgrade only, the ESP32-CAM wrapper library (yoursunny/esp32cam, ISC, updated 2026-07-26). None of the firmware needs deprecated ESP32 APIs.

Calibrate with a kitchen scale

This is the step that separates a feeder from a kibble fountain, and it's the smartest idea worth stealing from the GPL-licensed reference build — which does it with a trained neural network. You don't need one for pet-food accuracy. Dispense at fixed turn counts: run five test feeds — say 2, 5, 10, 20 and 40 auger turns — into the bowl, and weigh each one in grams. Fit a line: grams-per-turn is close enough to linear for kibble, so two coefficients — a base and a slope — are all the firmware stores. Expect scatter, honestly: kibble pieces are big relative to an auger groove, so individual feeds scatter by around a serving's worth of pieces; across meals it averages out. This page's method is scale-and-eyeball — call it ±5-gram-class.

For context: the reference build's author set a ±4 g acceptance target for his motor-and-auger combination and trained a small network against 15 calibration feeds to chase it — and the model file deliberately isn't published, because the grams-to-turns mapping is specific to your motor, your auger and your kibble. That's the deepest lesson in this section: every auger dosing system is calibrated by its owner, on its own hardware. His target is his; your scale is yours.

Freshness: old repos, evergreen parts

Both source projects are honest, working designs but neither is actively maintained: SmartPET-Feeder was last updated January 2023 and PetFeeder in May 2024 (repo activity checked 2026-11-15). That's fine — the underlying parts (ESP32, NEMA-17, DRV8825, servo, NTP) are evergreen — but it means we verified every library the builds depend on is still alive (see the firmware section's dates), and no deprecated ESP32 core APIs are required. Treat the two upstream repos as design references, not copy-paste firmware: SmartPET-Feeder's Pi-side code ships at least two real bugs we found in review — an undefined variable in its feed-history logger, and a broken duplicate-feed guard that can double-fire the same minute — and its dosing model must be retrained for your motor anyway. PetFeeder's firmware has a minor known quirk too — its web handler attempts a second response after the first, which the web library harmlessly drops.

Evergreen design, quiet upstreams, verified dependencies: that combination is exactly why this page describes its own merged firmware instead of pointing you at a two-year-old clone. One scope note: firmware repos that jailbreak closed commercial feeders (Petlibro, PetKit and similar) were deliberately excluded from this page's sources — this is a build-it page, not an unlock-one page.

Honest limits

The mechanicals are not in the box: neither source repo ships printable hopper or auger parts you can actually print, and sourcing a printable design is a separate, deliberate step on your side — this page does not pretend otherwise. The single-board schedule is this page's design: neither source repo schedules from the ESP32 alone — PetFeeder times from a Python thread on a computer, SmartPET-Feeder from a Raspberry Pi — and our merged firmware is inspired by both and credited to both. Accuracy figures belong to their owners: ±4 g is the SmartPET author's stated acceptance target on his hardware with his trained model; our kitchen-scale linear method is ±5 g-class on yours — neither number transfers to your kibble. Both repos are small and quiet: 34 stars each as of 2026-11-15, last touched 2024 and 2023 — nothing here is battle-tested by thousands; the parts and libraries are the battle-tested layer. GPL-3.0 is real: SmartPET-Feeder's license lets you run and modify its code freely, but if you distribute a derivative, share it under the same terms — this page's firmware description is deliberately independent so you aren't bound by it. And a feeder is not a sitter: this device dispenses on schedule; it does not know if the pet is sick, the bowl is blocked, or the hopper is empty beyond what you add. Check it, especially in the first week.

Going further: feed only the right animal

The upgrade path is PetFeeder's best idea: add an ESP32-CAM as a second device watching the bowl, and only dispense when the right animal is in frame. In that project the camera board serves snapshots over Wi-Fi, while a small Python program on your computer — a YOLOv8 object detector — recognizes cats, dogs and birds in the frames and sends the feed command when it sees yours. Be clear-eyed about the split: the recognition does not run on the camera chip; it runs on a computer you leave on. That's a fair trade for a first vision project — detection quality you couldn't yet get on the camera board itself — and it is the natural next step after this build: same skills, one more device, and the multicat household's actual problem solved.

License and credits

This page's merged design is inspired by two open-source projects: PierceBrandies/PetFeeder (MIT) and smart2pet/SmartPET-Feeder (GPL-3.0), both linked in the sources below with star counts as of 2026-11-15. The firmware description is clean-room — no code from either project is reproduced here. Libraries credited: tzapu/WiFiManager (MIT), laurb9/StepperDriver (MIT), madhephaestus/ESP32Servo (license not stated by its author) and yoursunny/esp32cam (ISC, camera upgrade only). MCU Atlas is an independent resource and is not affiliated with any of these makers.

Automatic pet feeder: serve kibble on a schedule with an ESP32

How to Build It

Wire an ESP32 to a DRV8825 and a NEMA-17 auger drive, flash the merged single-board firmware, calibrate grams-per-turn with a kitchen scale — and set dinner from your phone.

Parts Needed

  • ESP32-DevKitC (ESP32-WROOM-32)
  • NEMA-17 stepper motor (200 steps/rev)
  • DRV8825 stepper driver breakout (A4988 pin-compatible)
  • Power supply set: 5 V at 2 A or more for the board, 8–12 V at 1 A for the motor (or one 12 V supply + buck converter)
  • 100 µF electrolytic capacitor
  • PETG filament (~150–250 g) for the printed hopper, auger and mount
  • A kitchen scale that reads in grams (calibration)
  • Optional: SG90 micro servo for the gate variant; ESP32-CAM for the pet-detection upgrade

Steps

  1. 1

    Source or print the mechanicals

    Neither source repo ships usable printable geometry — PetFeeder has none, and SmartPET-Feeder's one 6.3 MB model file is not print-ready. Search the printable-model sites for a hopper-and-auger feeder design (a well-populated genre) and check three things before you commit filament: the auger fits standard NEMA-17 shaft coupling, the tube diameter suits your kibble's largest piece, and the model is published as separated, printable parts rather than one sculpture. Budget 150–250 g of PETG for the hopper, auger tube and mount.

    Cutaway diagram of a typical hopper-and-auger pet feeder: kibble funnel feeds a vertical auger tube driven by a NEMA-17 stepper, dosing kibble into the bowl below
  2. 2

    Wire the driver's logic side (power off)

    Work with power off. DRV8825 DIR to GPIO5, STEP to GPIO4, SLEEP to GPIO2 — tie SLEEP to the board's RESET so the driver wakes with the ESP32. The three microstep pins MODE0, MODE1 and MODE2 go to GPIO10, 11 and 12: all three LOW means full-step, which is what the 200-steps-per-revolution dosing math assumes. Practical note: GPIO10 and 11 are the WROOM-32 module's internal flash pins and are not broken out on a stock DevKitC — for full-step operation you may leave the MODE pins unconnected and let the DRV8825's internal pull-downs hold them LOW. Driver VDD goes to 3V3.

    Wiring diagram: ESP32 DevKit to DRV8825 stepper driver to NEMA-17 auger motor, with SG90 gate-servo option and 12 V PSU with buck converter and 100 µF capacitor
  3. 3

    Wire the power side

    VMOT to the 8–12 V motor supply, with the 100 µF electrolytic capacitor across VMOT and GND as close to the driver as you can solder it — stepper spikes without it can reset or damage the driver. Connect the motor supply's ground to the ESP32's ground: common ground, or nothing works reliably. The board itself runs from the 5 V supply (or the buck converter's output if you chose one 12 V supply) — never feed 12 V into the board's 5 V pin.

  4. 4

    Connect the motor

    The NEMA-17's two coils go to the driver's A and B output pairs. If the auger turns the wrong way when you test, swap one coil pair — or just invert DIR in firmware and save the rewiring.

  5. 5

    Provision Wi-Fi and flash the firmware

    On first boot the board appears as its own access point — the captive-portal pattern from the WiFiManager library — so you pick your home network from your phone and no password is hardcoded into the sketch. The firmware then syncs its clock over NTP and serves its own settings page. It is a clean-room merged design inspired by both source projects (no GPL code reproduced): Wi-Fi provisioning the PetFeeder way, auger dosing the SmartPET-Feeder way, and the scheduling moved onto the ESP32 itself. Every dependency was verified maintained at publication: StepperDriver (MIT, v1.6.0), WiFiManager (MIT), ESP32Servo (use v3.0 or newer), and esp32cam (ISC) if you add the camera.

  6. 6

    Set the schedule from your phone

    Open the feeder's page from any browser on your Wi-Fi: feed times, portion sizes and a feed-now button, all saved to on-chip preferences so a power cut doesn't eat the settings. When the clock matches a feed time, the firmware converts the portion's grams to auger turns using your stored calibration and fires once per minute — the fed latch is a deliberate fix for the duplicate-feed bug found in the reference build's scheduler.

  7. 7

    Calibrate with a kitchen scale

    Run five test feeds — say 2, 5, 10, 20 and 40 auger turns — into the bowl and weigh each one in grams. Grams-per-turn is close enough to linear for kibble: fit a line (a base and a slope) and store the two coefficients. Expect scatter — kibble pieces are big relative to an auger groove — which averages out across meals; this method is ±5-gram-class. The reference build's ±4 g was its author's acceptance target on his hardware; every auger dosing system is calibrated by its owner.

  8. 8

    Mount it and watch the first week

    Mount the feeder over the bowl, fill the hopper and let the schedule run — but check it, especially in the first week: the feeder cannot sense a blocked bowl, an empty hopper or a sick pet. When it is boring and reliable, the upgrade path is PetFeeder's best idea: an ESP32-CAM as a standalone second device watching the bowl, gating feeds on pet detection (the recognition runs on your computer, not the camera chip).

Bill of Materials

Parts list

8 parts · 7 linked

Heads up: some Buy links are affiliate links. If you buy through one, MCU Atlas may earn a small commission at no extra cost to you. It never changes which parts we list. How this works

Download CSV

Related Projects

Expanded ESP32-CAM webcam server
Illustration
ESP32
A friendlier, feature-rich version of Espressif's camera example for the ESP32-CAM: more settings, a better web UI and what a webcam actually needs.
Beginner·Code
2 parts listed
LIA: an open-source Meshtastic GPS tracker for your pet's collar
Illustration
ESP32ESP32-S3
A custom ESP32-S3 + SX1262 + GNSS collar board that runs Meshtastic and reports your dog's position over LoRa as direct messages, with no cellular service.
Advanced
8 parts listed
TamaFi: Wi-Fi-eating virtual pet on ESP32-S3
Illustration
ESP32ESP32-S3
TamaFi is a Tamagotchi-style virtual pet on an ESP32-S3 and colour TFT that stays healthy by eating nearby Wi-Fi networks instead of food.
Intermediate·Code
4 parts listed