Automatic Pet Feeder using Arduino

Today we are building an Arduino based Automatic Pet Feeder which can automatically serve food to your pet timely. It has a DS3231 RTC (Real Time Clock) Module, which used to set time and date on which your pet should be given food. So, by setting up the time according to your pet’s eating schedule, the device drop or fill the food bowl automatically.

Automatic Pet Feeder using Arduino

In this circuit, we are using a 16*2 LCD to display the time using DS3231 RTC Module with Arduino UNO. Also, a servo motor is used to rotate the containers to provide the food and 4*4 matrix keypad to manually set up the time for feeding the Pet. You can set the rotation angle and container opening duration according to the quantity of food you want to serve to your pet. The quantity of food may also depend upon your pet whether it’s a dog, cat or bird.

Material Required

  • Arduino UNO
  • 4*4 Matrix Keypad
  • 16*2 LCD
  • Push Button
  • Servo Motor
  • Resistor
  • Connecting Wires
  • Breadboard

Circuit Diagram

In this Arduino based Cat Feeder, for Getting Time and Date, we have used RTC (Real Time Clock) Module. We have used the 4*4 Matrix Keypad to set the Pet’s eating time manually with the help of 16×2 LCD. The Servo motor rotates the container and drop the food on the time set by the user. The LCD is used for displaying the Date and Time. Complete working can be found in the Video given at the end.

3D-Printed Pet Feeder Model

We have designed this Arduino Pet Feeder container using the 3D-printer. You can also print the same design by downloading the files from here. The material used for printing this model is PLA. It has four Parts as shown in the image below:

Assemble the four parts and connect the Servo Motor as shown in the picture below:

If you are new to 3D printing here is the starting guide. You can download the STL files for this pet feeder here.

DS3231 RTC Module

DS3231 is a RTC (Real Time Clock) module. It is used to maintain the date and time for most of the Electronics projects. This module has its own coin cell power supply using which it maintains the date and time even when the main power is removed or the MCU has gone through a hard reset. So once we set the date and time in this module it will keep track of it always. In our circuit, we are using DS3231 to feed the pet according to the time, set up by the Pet’s owner, like an alarm. As, clock reaches to the set time, it operates the servo motor to open the container gate and the food drops in the Pet’s food bowl.

Note: When using this module for the first time you have to set the date and time. You can also use RTC IC DS1307 for reading the time with Arduino.

Code and Explanation

Automatics Pet Feeder’s Complete Arduino Code is given at the end.

Arduino have default libraries for using the Servo motor and LCD 16*2 with it. But for using DS3231 RTC Module and 4*4 Matrix Keypad with the Arduino, you have to download and install the libraries. The download link for both the libraries is given below:

In the below code, we are defining libraries, “#include <DS3231.h>” for RTC module, “#include <Servo.h>” for Servo Motor, “#include <LiquidCrystal.h>” for 16*2 LCD, and “#include <Keypad.h>” for 4*4 Matrix Keypad.

#include <DS3231.h>
#include <Servo.h>
#include <LiquidCrystal.h>
#include <Keypad.h>

In the below code, we are defining the keymap for the 4*4 matrix keypad and assigning the Arduino pins for the Row and Columns of keypad.

Automatic Pet Feeder using Arduino schematics

char keys[ROWS][COLS] = {
byte rowPins[ROWS] = { 2, 3, 4, 5 };
byte colPins[COLS] = { 6, 7, 8, 9 };

Here, we are creating the keypad by using the command below in the code.

Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

Assigning A4 and A5 Arduino pins to connect with SCL and SDA pins of DS3231. Also, assigning pins to the LCD and initializing the Servo motor.

Read more: Automatic Pet Feeder using Arduino

This Post / Project can also be found using search terms:

  • ardoino kit automatic feeder
  • keypad locks with lcd arduino
  • pet feeder using arduino

Leave a Comment

= 3 + 9

(Spamcheck Enabled)

Read previous post:
Analogue Sensors – Calculate the Nonlinearity Introduced by a Load or Pull Down Resistor
Analogue Sensors – Calculate the Nonlinearity Introduced by a Load or Pull Down Resistor

Have you ever had that terrible feeling that adding a load resistor or 'pull down' to your sensor is messing...

Scroll to top