After many failed attempts at changing their feeding schedule, our cats are starving by 3:00 AM. What this equates to is many meows until we’re awake. I remembered a post I saw on David Bryan’s blog about his Raspberry Pi controlled automatic cat feeder. Inspired by David, I decided to take a crack at building my own. Here’s what I came up with, and what I’ll be covering in this post.

Goal

An automated way to feed the cats both on demand as well as on a schedule.

This cat feeder will be triggered by email. More specifically, Gmail. That’s right, we’re going to set up a Gmail account that our Raspberry Pi will monitor. When an email arrives with the expected subject, the cat feeder will let loose its goods.

I chose this route to avoid overly complicating the project. Feeding the cats on demand is as easy as sending an email, while feeding them on a schedule is as easy as creating an IFTTT applet. So long as the cats don’t figure out the email account and secret subject, this should be a viable solution.

If you find this series of posts interesting, you might also enjoy the automatic cat laser pointer toy series!

Prerequisites

You should have a configured Raspberry Pi ready to go. I used my original Raspberry Pi Model B (26 GPIO pins), an 8gb SD card and the Raspbian distro (highly recommended). This guide was pretty straightforward and got me up and running in no time.

The Parts

I decided to break this post down into distinct parts for readability:

Here in part one we’re introducing what we’re building and the things you’ll need to get it done

we’re introducing what we’re building and the things you’ll need to get it done Part two will cover writing code to interrogate your Gmail account for an email with the subject feed cats

will cover writing code to interrogate your Gmail account for an email with the subject Meanwhile, part three is going to focus on connecting your servo motor to the Raspberry Pi and writing code to make it spin

is going to focus on connecting your servo motor to the Raspberry Pi and writing code to make it spin And lastly, part four will cover my approach at mounting the Pi and servo motor to the dispenser

The Things You’ll Need for the Automatic Cat Feeder

The Tools

Power drill if you plan on attaching the Pi and PVC pipe directly to the dispenser.

Box cutter if you’re using the threaded rods as a fastener, as they’re slightly too large to fit in the servo motor mounting holes.

Hacksaw if you’re going to use the threaded rod from above. It’s a bit too long so we’ll need to shorten it.

[Optional] Building a Custom Stand for the Dispenser

The stand that came with the dispenser didn’t have enough space behind it for the servo motor to be mounted properly. I wasn’t keen on the idea of the servo being up front, especially knowing my cats with wires, so I went the route of building my own.

I chose to build this using copper piping (had to match our boho theme). It didn’t take long to find something on Pinterest that (mostly) fit our needs. This plant holder was re-purposed to be a dry food dispenser stand. The small square in the middle was sized to fit the base of the dispenser firmly, then copper piping was built around it.

I’m not going to go into the specifics of how this was constructed, but here’s a list of additional parts anyway:

Conclusion and Next Steps

So far we talked about what you’ll need to get started. Head over to part two where we cover writing a python script to read your Gmail account using the IMAPClient library.

Ahead of the game? Part three covers rotating the servo motor, and part four is all about connecting the Pi and motor to the dispenser.

Hi, I’m Sam.

I’m a programmer and a DIYer. When I’m not finding things to build I enjoy cooking, hiking, camping and traveling the world with my best friend. Say Hello!