Introduction: Internet Enabled Raspberry Pi Pet Feeder
This is a dog feeder powered by a Raspberry Pi.
If you want:
- an easy way to feed your big dog
- keep track of when you feed
- control how much and how often you feed
- and optionally be able to feed remotely through email when you are not around
this is a project for you :)
If you have all the parts around, it should take a couple of weekends to get this done.
Please feel free to modify and share your mods.
Step 1: Parts Needed
- Raspberry Pi 2 Model B
- Breakout board. cobbler and cable for Raspberry Pi
- 16x2 backlit LCD
- 12V high torque DC motor
- Zevro WM100 Cereal Dispenser
- Wireless dongle for Raspberry Pi
- 1/4" D-shaft for dispenser
- 1/4" to 6mm coupler for motor
- Two pushbutton switches
- 12V power supply for DC motor
- Mini USB power supply for Raspberry Pi
- Wood for box
- Jumper cables
- Tube to make the kibbles flow to the bowl (optional)
Step 2: Breadboard Assembly: Switch Controls
The switches provide controls to operate the feeder. There are two pushbutton switches in this design.
One for controlling the feed motor. The other to reset the feed timer.
- First connect the cobbler to the Raspberry Pi using the ribbon cable. Take care to orient the red line on the cable to the corner of the Raspberry Pi
- Place the cobbler on the breadboard
- Connect one terminal of the feed motor switch to pin #6 on the cobbler. The other terminal goes to ground on the cobbler
- Connect one terminal of the reset switch to pin #13 on the cobbler. The other terminal goes to ground on the cobbler.
All the switches are done!
Step 3: Breadboard Assembly: LCD
The LCD panel is programmed to have a clock, a feed countdown timer and status messages while feeding, resetting etc.
Here are the steps to connect the LCD panel to the Raspberry Pi through the breadboard and cobbler.
- Solder header pins to the LCD panel and a small PCB to the other end of the header pins. I used an old PCB and cut it to size. This makes taking the cables out to the breadboard easier
- Place a 10K Ohm potentiometer on the breadboard
- Connect +5V and ground to the left and right legs of the potentiometer
- Connect the following pins from the LCD to the cobbler:
- Pin #1 (VSS) connects to ground (black wire)
- Pin #2 (VDD) connects to +5V (red wire)
- Pin #3 (VE) connects to the middle leg of the potentiometer
- Pin #4 (RS) connects to the cobbler #25
- Pin #5 (RW) goes to ground (black wire)
- Pin #6 (EN) connects to cobbler #24
- Skip LCD Pins #7, #8, #9 and #10
- Pin #11 (D4) connects to cobbler #23
- Pin #12 (D5) connects to cobbler #17
- Pin #13 (D6) connects to cobbler #21
- Pin #14 (D7) connects to cobbler #22
- Pin #15 (LED +) goes to +5V (red wire)
- Pin #16 (LED -) goes to ground (black wire)
There is a very nice detailed write up of the LCD wiring at modmypi.com
We will use the Adafruit library for programming the LCD (more details on that later)
Step 4: Breadboard Assembly: DC Motor
The high torque DC motor is a 12V 3.5 RPM motor with a 6mm D-shaft on it.
It is a simple transistor based circuit with the raspberry PI pin # 19 providing the control signal
Connect as shown in the diagram.
Note that the 12V power supply is a separate power supply just for the motor.
The ground for the 12V power supply and Raspberry Pi's ground will connect together.
Essentially the transistor acts as a switch control by the HIGH on the Raspberry GPIO pin to switch the motor on/off
Step 5: Programming the Raspberry Pi
Here's the basic idea of the pet feeder
- Should be able to press a button and get a measured amount of feed in the bowl
- No overfeeding. Disable the feed button for 8 hours after feeding
- Over-ride the disabled feed button with a reset button
- Accidental press of feed button, while disabled, should pop up friendly message on LCD
- Display a clock and the time left for the next feed as a countdown
- Trigger the feed through an email to a gmail account
- Trigger a query to know when the last feed and next feed can be using email to a gmail account
- Do some fun replies with Chuck Norris jokes and/or numbers trivia :)
- Make the system immune to reboots by starting the program automatically on reboot, saving state to files etc.
Attachments
Step 6: Connecting the Zevro Dispenser to the DC Motor
The Zevro is pretty cool since it takes care of dealing with large kibbles for the dog.
It comes with a mounting kit and a knob. Discard the knob and its attached plastic D-shaft.
- Use the metal 1/4" D-shaft cut to size for your motor position. It might a tiny bit loose on the Zevro side. Nothing that a cut up credit card shim can't fix :)
- Mount the motor securely (I used an L bracket)
- Connect the D-shaft from the Zevro to the motor using a 6mm to 1/4" coupler
- Mount the Zevro to one of your panels
Step 7: Optional - Dispenser Chute
Didn't want to bend down to press the button and didn't want the dog to knock off the clear plastic container with the food. But a high mounted Zevro ends up in kibbles dropping from too high and bouncing off the feeding bowl
Hence the dispenser chute
Essentially a cheap 3" drain pipe and an elbow joint.
Some duct tape to make sure kibbles are directed into the bowl.
Step 8: Box and Paint
Make a small box to put it all together and paint it
Make a hinged door to keep things serviceable, if needed
Operations Manual :)
- Just press the button to feed
- Or send an email with the subject "When" to query when the last feeding was done
- Or send an email with the subject 'Feed" to feed the dog!
Here's a video of the project in action. Enjoy!
Step 9: Adding a Camera
The pet feeder has been working pretty flawlessly for the past several months.
The one thing that is missing is positive confirmation that the dog is actually eating the food once remotely fed.
Raspberry Pi camera to the rescue!
Here's where to get the camera and installation instructions:
https://www.adafruit.com/products/1367
Once physically installed, here's a code snippet you can add to the original code to get your camera integrated into the pet feeder. This code takes a time-stamped picture and saves it to a file. You can take this file and email it if you like.
In the sendmail function in the earlier code simply substitute the "attach=None" argument with "PICFILE" and you should be able to receive the file.
Attachments

Participated in the
Arduino All The Things! Contest
6 People Made This Project!
- shackleton01 made it!
- bmfarris made it!
- Twitchr made it!
- gabrielle.martinfortier made it!
See 2 More
80 Comments
Question 10 months ago
Hey just a quick question how long did this take u to do?
Question 1 year ago
Awesome project! new to Pi and I'm having issues understanding the DC Motor breadboard assembly. I've been going over the diagram and comparing to the breadboard picture and think that I understand, but I don't see anywhere in the picture the 270 and 10k resistors. What am I missing?
Also, is a 330 an okay replacement to the 270?
Question 1 year ago
Hello! I want to start this project and was wondering if I could adapt more than one feeder to the same raspberry, or do you think I would have to setup independent systems?
I'm trying to find a solution to feeding 2 or 3 dogs....
Sorry if this was already discussed in the thread...
Regards from Honduras!!
Answer 1 year ago
The feed motor runs on its own power supply and all the raspberry pi does is act as the switch to the motor. So as long as you have enough signal pins available on the raspberry pi, you should be able to trigger multiple motors on/off.
Reply 1 year ago
Thks for your reply! What about the coding side?
Question 2 years ago
Great Job! But I have one question before I start - Dose this do scheduled feedings for when you are gone over night or are away from the internet?
Answer 2 years ago
Not yet. But that’s a software hack that you can probably put in. I’m going to start working on some v2 software. Will try to incorporate that. What else would you like to see in a v2?
Reply 2 years ago
Hey! I’m planning on making this a fall project. I’d love to see a sound options for when the timer is up and for when food is being dispensed. I intend on training my dog to push the button herself.
Reply 2 years ago
I'm new at the software but that sounds like fun, I may have a go at it as well! Thanks!
2 years ago
Very nice idea and well done. I did notice several things are missing from the parts list:
10K potentiometer, 270 and 10k resistors, npn transistor, in4003 diode, motor bracket. I believe the buttons are momentary contact switches. Not sure, but is the pot used for the brightness of the display? If using an RPi3 or 4, the Wireless dongle isn't needed as wi-fi is on-board.
I'm going to make this with a change that it'll have a kibble reservoir to hold 30-50# food... for a large dog. I'm also going to add sound so that it'll play a recording when the food is about to dispense.
Reply 2 years ago
Yes, the pot is for brightness. The reservoir is a good idea. I incorporated it post the build. It is simply a 5 gallon bucket with a hole in the bottom that is connected with a tube to the zevro and is gravity fed. Good luck and don’t hesitate to ask away
Question 3 years ago
Hi! Where did you get the 12 V power supply for the motor?
Answer 3 years ago
I used a 12V battery from Home Depot
Question 3 years ago
Thanks for this tutorial! I got to the end of the project and am having a ton of issues with Python. I am running v. 2.7 and it came back with imapclient errors, and it did not like the way email.MIMEMultipart and such is coded.
To fix these issues,
- I did a Python update and then used sudo pip3 install imapclient and it stopped giving me some of the errors.
- I rewrote from email.MIMEMultipart import MIMEMultipart to say from email.mime.multipart import MIMEMultipart, and same with MIMEBase and MIMEText
However, it is now having issues with the import Encoders, and it basically seems to having problems with every. single. line. of this python code.
Does anyone have an updated script for this project? Or else does someone know how to fix the Encoders, import os, import sys, and so on? It seems I'm having to go line by line and find a solution to each. Am I missing something? Running a Raspberry Pi B+ I bought though the CanaKit https://www.kmcale.com/evo--gb-black-raspberry--b--32-canakit-pi-case--kit-3-plus--b--starter-premium-edition
thanks!
Question 4 years ago
for the resistors, what wattage, % are they?
Answer 3 years ago
Most at 1/4W, 5%. There is not a lot of load on the system. The heaviest load is the DC motor and even with that the run time is only 20-25 seconds at s time.
Reply 3 years ago
most? what would the rest be then? sorry if this sounds stupid it's just 1) im new to electrical work and 2) i want to actually build this the way you did, so i need to know everything :/ sorry for the trouble.
or if i sent you the parts could you build this for me? i'll pay obviously. i'd rather haev something like this than buy some name brand crap that isn't open source and will break in a year.
Reply 3 years ago
Looking back at the bill of materials all of the resistors are 1/4W, 5%. So you should be good.
Part of the fun is building it. Will help you along.
Question 4 years ago
Hi,
I am a bit new to Python and slowly learning it through this project.
I am writing the code in Python 3.5. I have used the inbuilt imaplib.py instead of imapclient. While compiling, I get an error in the imaplib.py as follows-
data + b' ' +arg
TypeError: can't concat bytes to list
Can you explain the meaning of this and how to solve it?
Thanks.
Answer 3 years ago
There are some changes to the python 3.5 syntax. The original project was based on python 2.7. There are number of online resources on the errors. I usually just search for the error on google and someone would have run into and posted a solution.