Automatic Pet Feeder with Raspberry Pi
Build a WiFi-connected pet feeder that dispenses food on schedule with camera monitoring.
Parts List
- Raspberry Pi Zero W
- PiCamera Module
- SG90 Servo Motor
- 3D Printed Hopper
- RTC Module (DS3231)
- Power Supply
Step-by-Step Instructions
Design Hopper
Design a food hopper using TinkerCAD or Fusion 360 with a wide funnel top and a narrow dispensing slot at the bottom sized for your pet's kibble. 3D print the hopper using food-safe PLA filament at 20% infill, or build a prototype using a plastic bottle cut and shaped with a heat gun. Sand the interior surfaces smooth to prevent kibble from jamming as it flows through the funnel.
Mount Servo
Install the SG90 servo motor at the base of the hopper with its horn connected to a gate or auger that controls the dispensing opening. Wire the servo signal pin to GPIO pin 18 on the Raspberry Pi, VCC to 5V, and GND to ground. Test the servo by sweeping it from 0 to 90 degrees to verify the gate opens fully to release food and closes completely to prevent overfeeding.
Set Up Camera
Connect the PiCamera Module v2 to the Pi's CSI port and position it to view the food bowl area so you can visually confirm dispensing worked. Install the picamera library and write a quick test script to capture a still image and save it to disk. Adjust the camera angle and focus to ensure the bowl is clearly visible in the frame, then integrate snapshot capture into the feeding routine.
Program Schedules
Wire the DS3231 RTC module to the Pi's I2C bus to maintain accurate time even when the Pi loses internet connectivity. Write a Python script that checks the current time against predefined feeding schedule entries and triggers the servo dispense routine at the correct moments. Add a web interface with time pickers for each meal so you can adjust the schedule remotely from your phone without editing code.