Build a Wi-Fi Pet Feeder
Share
A scheduled pet feeder works by having a servo motor rotate a gate or paddle at set times, releasing a measured amount of food from a hopper above a bowl. The part that makes it reliable rather than approximate is the clock: a WiFi-connected microcontroller synchronizes its time over the internet using NTP (Network Time Protocol) rather than relying on its own onboard timer, which drifts by minutes over a few days and would eventually feed your pet at the wrong hour. Add a servo, a WiFi microcontroller, and a container to hold the food, and the mechanical half of the job is done — the code just has to open the gate on schedule and close it again.
How does a WiFi pet feeder know what time it is?
A standalone microcontroller keeps time by counting clock ticks from the moment it powers on, and that count has no idea what the actual wall-clock time is unless something tells it. An ESP32 or ESP8266 solves this by connecting to your home WiFi and requesting the current time from an NTP server the moment it boots, then keeping a synced clock afterward. This is why the board needs WiFi in the first place — not just for remote control, but because NTP is what turns "run 4,000,000 clock cycles" into "feed at 8:00 AM." Without it, every power cut or firmware restart would silently reset the schedule to whatever the internal timer thinks is midnight.
What parts does an automatic pet feeder need?
The electronics side is short: a WiFi-capable microcontroller, a servo motor to move the gate, a stable 5V power source, and wiring to connect them. Feeding this project's description into Compoden's AI build assistant returned a six-part tray: an ESP32-C3 Super Mini Development Board as the controller, an SG90 9g Micro Servo Motor to actuate the gate, a 5V 2A Micro-USB Power Adapter for mains power, an SYB-170 Mini Breadboard and jumper wires for prototyping the circuit, and a Bluesky Mini 5V 3A UBEC to give the servo its own clean 5V rail so it doesn't brown out the board when it draws current.
Notably absent: a hopper. When asked directly whether a food container was available, the assistant answered plainly — "no, we don't have a food hopper or pet feeder container in the catalog yet," after searching for both "food hopper dispenser" and "pet feeder" and finding nothing that holds kibble. Its suggestion, and the standard maker approach for this build, is to repurpose something you already have: an upright plastic bottle or jar with the mouth facing down, or a container with a hole cut in the bottom, mounted so the servo's paddle sits under the opening and blocks or clears it on command. This is genuinely the right call for a first build — a purpose-built hopper is a 3D-printed or hand-built part, not a stocked electronics component, and no electronics retailer carrying servos and microcontrollers is likely to carry pet-feeder hoppers either.
How much food does one servo rotation actually dispense?
This is the part code alone cannot answer. A servo told to sweep from 0 to 90 degrees moves a fixed angle every time, but how much food that releases depends entirely on the mechanical design underneath it: how wide the gate opening is, how steep the chute is, how free-flowing your kibble is, and how long the gate stays open before closing again. A wider opening or a longer pause dispenses more; a narrower slot or a quick open-close cycle dispenses less. There is no universal constant here — you calibrate by testing with your actual container and your actual food, weighing a few dispensed portions, and adjusting the open angle or the dwell time in the firmware until one cycle matches the portion you want. Treat the first week of running the feeder as a calibration period, not a finished product.
Can you control it remotely, not just on a schedule?
Yes — that's the point of putting a WiFi microcontroller in the design instead of a basic timer circuit. Once the board is on your network, the same code that checks the clock for a scheduled feed can also run a small web server or listen for a command from a phone, letting you trigger an extra portion on demand from wherever you are. Whether that lands in the version you build depends on how much of the firmware you extend past the schedule check — the core connectivity is already there once WiFi and NTP are working, so remote triggering is an addition to the same codebase rather than a separate project.
Watch it built live
We gave Compoden's AI build assistant this exact prompt: "I want to build a WiFi-connected automatic pet feeder that dispenses food on a schedule using a servo motor."
It replied in part: "This build creates an automatic pet feeder that connects to your home WiFi. It uses a small motor to dispense food on a set schedule, which you can control over the internet." It picked the ESP32-C3 Super Mini Development Board specifically because it "provides the necessary Wi-Fi connection and enough control pins to operate the motor," and flagged the SG90 servo's roughly 700mA draw under load as the reason a separate UBEC was added — powering the servo straight off the microcontroller's rail "might cause voltage dips if powered directly from the microcontroller's main supply."
When we followed up asking directly about a food container, it was upfront rather than forcing a mismatched part into the tray: "So no, I'm not going to force one of those into your build. Good news: the hopper is the one part of this build that's genuinely better DIY anyway." It suggested a repurposed PET bottle or Tupperware-style container, with the SG90 metering flow through a cut opening.
Watch the firmware get generated
Separately, we asked Compoden's PWA firmware tool: "I'm building a WiFi automatic pet feeder with an ESP32 and a servo motor that opens a food gate. Write firmware that connects to WiFi and dispenses food at a scheduled time using NTP for the clock."
The tool matched its own four-part list (an ESP32-WROOM-32 as the controller, the SG90 servo, a 5V 2A adapter, and jumper wires) and generated firmware that includes WiFi.h, ESP32Servo.h, NTPClient.h, and WiFiUdp.h, with the servo signal wired to GPIO4. It set default dispense times of 8:00 AM and 6:00 PM, adjustable through named constants (DISPENSE_HOUR_1, DISPENSE_MINUTE_1, and so on), and swings the servo from 0 to 90 degrees to open the gate before returning it to 0. It also included an honest caveat: "this code has not been checked against a board. Your build has parts in it, but no board I can compile for — so I could not verify the pins." That's worth taking seriously before wiring anything up — confirm the GPIO4 assignment against whichever specific ESP32 board you actually buy.
Get everything in this build
These are the exact parts and prices Compoden's AI assistant matched for this build, captured live from the storefront. The hopper or food container is not a stocked part — you supply that yourself, as described above.
| Part | Role | Price | Buy |
|---|---|---|---|
| ESP32-C3 Super Mini Development Board | Microcontroller with WiFi | Rs.290 | Add to cart |
| SG90 9g Micro Servo Motor | Food gate actuator | Rs.120 | Add to cart |
| 5V 2A Micro-USB Power Adapter | Power supply | Rs.140 | Add to cart |
| SYB-170 Mini Breadboard | Prototyping | Rs.20 | Add to cart |
| Male-to-Male Breadboard Jumper Wires (20 cm, 24 AWG) | Wiring | Rs.40 | Add to cart |
| Bluesky Mini 5V 3A UBEC | Servo power regulation | Rs.240 | Add to cart |
| Total | Rs.850 | Add all to cart | |
Built and Backed by Compoden
Compoden matches every part in this list against live stock and pricing before it reaches this page, so what you see above is what ships, not a catalog approximation. The AI build assistant also holds back from inventing a part it does not carry — as it did here by declining to substitute an unrelated product for a food hopper — which is the kind of restraint that matters more once you are the one paying for what arrives. Parts ship across India, and the same build description that generated this tray also generates the wiring and firmware you would need to bring it to life.
FAQ
Do I need an ESP32, or will an ESP8266 work too?
Either works, since both have built-in WiFi and can run NTP and servo libraries. The build captured here used an ESP32-C3 for the parts tray and an ESP32-WROOM-32 for the firmware demo; an ESP8266 board is a viable substitute as long as you confirm its GPIO pin numbering against the firmware before flashing.
Does Compoden sell a food hopper for this build?
No. Compoden's catalog does not carry a purpose-built pet-feeder hopper, and the AI build assistant says so directly rather than substituting an unrelated part. The standard workaround is a repurposed plastic bottle or container with a hole cut for the servo-controlled opening.
How do I set the feeding schedule?
The generated firmware exposes the feeding times as named constants you edit directly in the code before uploading, rather than through an app. Because the board also has WiFi, you can extend the same firmware with a small web page or app trigger for on-demand feeding, not just fixed times.
Why does the servo need its own power regulator?
The SG90 servo can draw close to 700mA when moving, and pulling that directly from the microcontroller's power rail can cause voltage dips that reset or destabilize the board. A small UBEC gives the servo a separate, stable 5V supply so the two loads don't interfere with each other.