Automatic Cat Feeder
Project by Patrick Zhu
Project by Patrick Zhu
Overview
Front view of the automatic cat feeder, without power on, and without the cat food.
This project automatically feeds my cat once a day. On the LCD screen display, it records the number of days since my cat has wet food. On the day when I feed my cat with wet food, the number displayed on the LCD screen will reset to 0, and on the same day, the amount of cat food dispensed will be lower.
Detailed Pictures of the Automatic Cat Feeder with Captions
All of the electrical components except for the servo motor are sticked on the top of the box of the automatic cat feeder. The wires are plugged into the Arduino. It connects to my computer for power.
All of the electrical components on the top of the box of the automatic cat feeder. Important components include LCD screen, RTC(real time clock) module, the button.
The sideview of the structure of the automatic cat feeder.
The structure of the panel of rotation that is connected to the servo motor.
Videos of the Automatic Cat Feeder
In this video, I showed that how this machine normally works. Since it is designed to operate only once a day on a specific time, I set the time to be several seconds after it is initiated to have better presentation of its functionality. When the machine is turned on, the panel will rotate so there will be a gap for the cat food to drop.
In this video, I showed that how this machine works when the button is pressed. When the button is pressed, which means that I feed my cat with wet food on that day, the number of days since my cat had his last wet food will reset to 0, and the time for the cat food to drop on that day will be shorter so that he gets less cat food on that day because he already has his wet food.
Process Image and Review
Figuring out the electrical parts of the machine, wiring up the RTC module, the LCD screen, and the arduino
Installing the panel to the overall structure, it took around 2 hours to do the laser cutting and installing.
Laser cutting the required material in the laser cutting lab
Designing the physical structure of the Automatic Cat Feeder, it took roughly around 5 hours.
The hardest parts in the process include programming the real time clock module in arduino, measuring and designing the rotation panel so that it can fit with the servo motor, and putting things together using acrylic cement.
Firstly, when I was programming the real time clock module to control the drop of cat food, which is the movement of the servo motor. I faced some challenges with setting the exact time for triggering the servo motor. The DS3231 RTC module was straightforward to program for basic timekeeping, but integrating it to accurately control the servo required some fine-tuning. I had to look up the instruction to get all the functions working correctly. Ensuring the servo motor moved at the precise time required careful handling of delays and checking the RTC module’s second, minute, and hour values.
The next challenge was designing and measuring the rotation panel so it would align perfectly with the servo motor. I had to work within the small tolerances of the servo motor’s screw holes, which made the measurements especially challenging. Using calipers, I measured the distance between the screw holes as precisely as possible, but even minor miscalculations threw off the alignment. Each test iteration meant re-measuring, adjusting the design, and re-cutting the panel until the motor fit correctly. This process was time-consuming, requiring patience and precision, as even a slight misalignment could cause the panel to rotate unevenly or fail to operate. After five rounds of testing and refining, I finally achieved an alignment that allowed smooth, consistent rotation, which was a huge relief and an important step forward in the project.
Finally, assembling everything with acrylic cement was tricky. Acrylic cement is highly effective but unforgiving; once set, adjustments are challenging. I had to be precise with alignment to avoid issues with stability. Overall, while the construction process was challenging, it was rewarding to see the different elements come together into a functional automated feeder.
Discussion
Reflecting on the feedback from the in-class critique has given me a lot to think about regarding improvements and next steps. A few classmates highlighted the positive aspects of the design, such as the clear container, which makes it easy to see if the food is full, low, or if the cat has eaten. I deliberately chose to use acrylic for my design so that it will be clear to see the inside structure, so it is really encouraging to see it recognized. One comment noted, “The colors and the name of the cat are cute!” I wanted to add a playful element to this mechanical structure, and it’s gratifying that this choice made the feeder more engaging. Although the colors of the machine is constrained by the materials available. Another person appreciated the time-controlled dispensing, saying, “I like that you really implemented the time aspect as I think it makes it more interesting and more complex as well as more useful.” I felt that automating the timing would add value by catering to consistent feeding routines, and I am glad this complexity added to the overall appeal.
There were also helpful critiques that highlighted areas for improvement. One comment suggested that “granular cat food may fall all at once/hard to control,” which is something I noticed during testing but hadn’t fully resolved. A potential solution could be a rotating or adjustable-sized opening that dispenses food in controlled amounts. Also, a spiral structure might be able to resolve the issue but I was not able to test this idea. Another point I hadn’t considered much was that “the hole on the bottom sheet that moves is partly cut out of the piece, which might make that panel unstable when the weight of cat food is on it.” The added weight could indeed make the feeder less reliable, so I will look into reinforcing the panel or adjusting the cutout.
From a personal perspective, I am proud of the overall outcome. The feeder largely met my initial goals, especially the automation aspect, which was a technical challenge I enjoyed tackling. However, I see areas for improvement, like the dispensing mechanism and wire management. Through this project, I learned that I tend to focus on functional mechanics first and aesthetics second, which sometimes leads to practical but unfinished-looking prototypes. Given the chance to redo certain aspects, I would start earlier on designing components for durability, especially for parts under load like the rotating panel. I would also work on a cleaner wiring layout from the beginning to streamline the final setup.
For future iterations, I would like to enclose all electronic components within the machine’s body, both for aesthetic reasons and to protect them from potential interference or damage (especially given cats’ natural curiosity). This would make the feeder look cleaner and more polished, while also addressing concerns about wires potentially tempting the cat to play or chew on them. Creating an interior compartment for the electronics would allow me to maintain a minimal, streamlined design. Additionally, I plan to experiment with different structural setups to improve stability and functionality. Testing alternative configurations, such as different panel shapes or angled surfaces, could help control the flow of granular food more effectively, ensuring it dispenses in manageable amounts rather than all at once. These structural tests could also reveal better ways to prevent food from bouncing out or spilling onto the floor if the bowl moves. With these improvements, I believe the feeder could become a more practical and visually appealing solution for me looking for an automated, safe, and reliable feeding option.
Technical Information
/*
Project Title: Automated Cat Feeding System Description: This code is designed to control an automated pet feeding reminder system. It keeps track of the days since the pet was last fed wet food and displays this information on an LCD screen. If the button connected to pin 7 is pressed, it resets the counter to 0 days since the last feeding. The system includes a DS3231 Real Time Clock (RTC) module to maintain the time, and a servo motor connected to pin 3 that can be activated at a specific time to dispense the cat food. Every day, at 12:33:10, the servo motor is triggered to turn, based on whether the pet has been fed wet food. The servo motor remains turned for a duration, after which it returns to its original position. The `hasCan` flag indicates whether the pet has been fed or not.
Pin Mapping:
- DS3231 RTC: Communicates via I2C protocol (SDA/SCL pins)
- Button: Connected to digital pin 7, used to reset the feeding day counter
- Servo Motor: Connected to digital pin 3, used to simulate the release of food
- LCD Screen: Connected via I2C protocol at address 0x27, used to display the days since the last feeding
*/
#include <DS3231.h>
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C screen(0x27, 16, 2);
int startDay = 1; // Starting day (as per RTC initial setup)
const int buttonPin = 7; // Button is connected to pin 7
int buttonState = 0; // Variable to store button state
byte frowny[] = {
B00000,
B11011,
B11011,
B00000,
B00000,
B01110,
B10001,
B00000
};
DS3231 myRTC;
Servo myServo;
int servoPin = 3;
bool hasCan = false;
void setup() {
screen.init();
screen.backlight();
screen.home();
Wire.begin();
Serial.begin(9600);
pinMode(buttonPin, INPUT); // Set button pin as input
myServo.attach(servoPin);
myServo.write(180);
// Set initial time and date in RTC
myRTC.setHour(12);
myRTC.setMinute(33);
myRTC.setSecond(0);
myRTC.setDate(2); // Set the initial day
myRTC.setMonth(10);
myRTC.setYear(2024);
Serial.println("RTC Initialized. Current time:");
}
void loop() {
bool h12;
bool PM_time;
int hour = myRTC.getHour(h12, PM_time);
int minute = myRTC.getMinute();
int second = myRTC.getSecond();
int currentDay = myRTC.getDate(); // Get the current day from RTC
// Read the button state
buttonState = digitalRead(buttonPin);
// If button is pressed, reset daysSinceStart to 0
if (buttonState == HIGH) {
startDay = currentDay;
Serial.println("Button pressed: daysSinceStart reset to 0");
hasCan=true;
}
int daysSinceStart = currentDay - startDay; // Calculate days since start
if (daysSinceStart < 0) daysSinceStart += 30; // month rollover
// Display the message
screen.setCursor(0, 0);
screen.print(daysSinceStart);
screen.print(" days since he");
screen.setCursor(0, 1);
screen.print(" had wet food");
// Print the current time
Serial.print(hour);
Serial.print(":");
if (minute < 10) Serial.print("0");
Serial.print(minute);
Serial.print(":");
if (second < 10) Serial.print("0");
Serial.println(second);
// Trigger servo at specific time
if (hour == 12 && minute == 33 && second == 10 && hasCan==false) {
myServo.write(100);
Serial.println("Servo turns and hasCan=false");
delay(3000);
myServo.write(180);
Serial.println("Servo returns");
}
if (hour == 12 && minute == 33 && second == 10 && hasCan==true) {
myServo.write(100);
Serial.println("Servo turns and hasCan=true");
delay(1000);
myServo.write(180);
Serial.println("Servo returns");
hasCan=false;
}
delay(1000);
}