← Projects
3d-printing intermediate 20 days ago ◑ 51 views ◯ 6 min read

Build a 3D-Printed Automatic Pet Feeder with ESP32 Scheduling

Build time: One weekend (6-8 hours of assembly plus roughly 10 hours of print time)
Tools needed: 3D printer with a 0.4mm nozzle, soldering iron and solder, small Phillips and hex driver set, hot glue gun, digital calipers, wire strippers, M3 heat-set insert tool (or a soldering iron tip)
pet feederesp32augerautomatic feedingpetgload cellrtc3d printing project
Parts List

An automatic pet feeder is one of the better beginner-to-intermediate 3D printing projects on this site: it combines a mechanical design problem (moving a measured volume of dry food without jamming), an electronics problem (scheduling and driving a motor reliably), and a firmware problem (keeping accurate time without a dependable network connection) in a single build that's genuinely useful once it's done. This project walks through a hopper-and-auger feeder driven by a NEMA 17 stepper and an ESP32, with an optional load cell for verifying portion weight rather than trusting auger rotation alone.

Design Overview: Why an Auger Beats a Rotating Tray

Most DIY feeder designs fall into two camps: a rotating tray with pie-slice compartments, or a screw auger that pushes food out of a hopper through a chute. Trays are simple to print but only hold a fixed number of pre-measured meals and jam easily with irregularly shaped kibble. An auger — essentially a 3D printed screw thread inside a tube — meters food continuously from a much larger hopper, scales naturally to any portion size by running the motor for a calculated number of steps, and self-clears far better than a tray mechanism because the screw geometry keeps pushing stuck kibble forward instead of grinding it in place.

The trade-off is print complexity: the auger itself needs to be printed with the flights (the raised screw threads) accurately sized to your kibble, with enough clearance that food doesn't bridge and jam between the auger and the tube wall, but not so much clearance that food just falls through without being pushed.

Printing the Hopper, Auger, and Housing

Print the auger vertically, flights up, in PETG rather than PLA. PLA is fine for the hopper and outer housing, but the auger and chute see repeated abrasion from dry kibble and occasional humidity from the kitchen or utility room, and PETG tolerates both far better over months of daily use. A layer height of 0.2mm with 4 perimeters and at least 25% infill on the auger keeps the flights from snapping off at the root where they meet the center shaft — this is the single most common failure point on feeder builds posted online, and it's a print-strength problem, not a design problem.

Electronics: Wiring the ESP32, Stepper Driver, and RTC

The ESP32 handles WiFi, the web dashboard, and NTP time sync; the DS3231 RTC keeps accurate time through power outages and WiFi dropouts (the ESP32's internal RTC drifts badly and resets completely on power loss, which is exactly when you don't want your feeder forgetting its schedule). The TMC2208 driver runs the NEMA 17 in quiet, smooth microstepping mode, which matters more here than in a 3D printer — a feeder sitting on a kitchen counter grinding away at 2am in full-step mode will wake the house up.

SignalESP32 PinConnects To
I2C SDAGPIO 21DS3231 SDA
I2C SCLGPIO 22DS3231 SCL
Stepper STEPGPIO 25TMC2208 STEP
Stepper DIRGPIO 26TMC2208 DIR
Stepper ENGPIO 27TMC2208 EN (active low)
Load Cell DT/SCKGPIO 32/33HX711 DT/SCK
Manual Feed ButtonGPIO 4Push button to GND
BuzzerGPIO 15Piezo buzzer +

Run the stepper motor and driver from the 12V supply directly, not from the ESP32's 5V rail — a NEMA 17 under load can pull well over an amp, which will brown out the ESP32 if you try to share a regulator. Feed the ESP32 from its own USB power input or a small buck converter off the same 12V supply.

Firmware: NTP-Synced Scheduling with a Local Web Dashboard

Have the ESP32 sync to an NTP server on boot and whenever WiFi reconnects, and immediately write that time to the DS3231. From then on, read the schedule from the DS3231, not from NTP directly — this way a feeding still fires correctly even if your router is down or the ESP32 loses WiFi overnight. Store the feeding schedule (times and portion sizes) in a small web form served from the ESP32 itself using ESPAsyncWebServer, with the schedule persisted to the ESP32's flash with Preferences.h so it survives a reboot.

Convert a target portion weight into a step count during a one-time calibration routine: run the auger for a fixed number of steps, weigh what comes out, and compute grams-per-step. Store that calibration constant alongside the schedule. If you've added the load cell, use it as a cross-check rather than the primary measurement — run the auger in short bursts until the load cell reading increases by the target amount, which self-corrects for kibble settling and humidity changes that throw off a pure step-count model over time.

Calibrating Portion Size and Catching Jams

Jam detection is what separates a feeder you can trust from one you have to babysit. If you're using the load cell, a feed cycle that runs for more than roughly 1.5x the expected number of steps without the weight increasing as expected should stop the motor, sound the buzzer, and log an alert on the dashboard rather than keep grinding against a jam — repeated stall torque against jammed kibble is exactly what breaks auger flights. Without a load cell, add a simple current-sense check on the motor driver, or at minimum a hard step-count ceiling per feed cycle so a jam can't run the motor indefinitely.

Assembly and Sealing Against Moisture and Pests

Seal the hopper lid with a printed lip-and-gasket joint or a short length of weatherstripping, both to keep humidity out of the kibble and to keep pets from learning they can pop the lid themselves — dogs figure this out faster than you'd expect. Keep the electronics enclosure physically separate from the food path, mounted to the side or underneath rather than directly above the hopper, so condensation or a spilled water bowl nearby doesn't find its way onto exposed header pins.

Safety Notes

Keep the auger-to-chute transition fully enclosed so no paws or fingers can reach a pinch point while the motor is running — this is the main physical safety concern on a build like this. Electrically, this project runs entirely on low-voltage DC (12V and below), so there's no mains wiring involved, but still fuse the 12V input and avoid letting pets chew on exposed wiring; route cabling inside conduit or heat-shrink wherever it isn't enclosed in the housing.

Once it's dialed in, this build is genuinely hands-off — the hardest part is the one-time calibration, not day-to-day operation. Scale the hopper volume up for multi-day unattended feeding, or build two smaller units if you've got pets on different diets or schedules.