All posts

A pet food dispenser you control over the internet

Going away for a day or two while your dog or cat stays at home? Then it’s handy to be able to give them some food now and then from a distance. Here’s how to make one yourself.

A food dispenser on the wall: a black printed box with a red funnel for the kibble on top.
The food dispenser on the wall.

What you need

  • A 5V stepper motor with a ULN2003 driver
  • A NodeMCU board (ESP8266)
  • A few jumper wires

Software

The dispenser is driven by a small microcontroller with Wi-Fi. Another board works too, such as an ESP32 or an Arduino with an Ethernet shield. I wrote the firmware in PlatformIO, but any other development environment will do.

To connect the dispenser to your Wi-Fi, change these lines in main.cpp:

const char* ssid     = "SSID";
const char* password = "Password";

Once the firmware is on the board, the microcontroller listens on its IP address for a request to /feedCat. The move parameter sets how far the flap opens, and so how much food comes out. In my case a request looks like this:

http://192.168.2.55/feedCat?move=70

How far the flap needs to open takes a bit of trial and error: it depends on the size of the kibble and how much you want to give.

Enclosure

Exploded 3D design of the food dispenser: the red funnel, the black lid, the base with the flap and a separate wall bracket.
The 3D design, with the wall bracket on the right.

I printed the enclosure in black and red PLA, but other materials work too. The STL files are in the download at the end of this post.

The parts are screwed together, into threaded inserts that I melted into the plastic with a soldering iron. I also made a wall bracket, so you can easily lift the dispenser off the wall to refill it.

The food dispenser from above, with the red funnel full of brown kibble.
Filled with kibble.

Electronics

Connect the NodeMCU to the stepper motor driver like this:

  • D1 → IN1
  • D2 → IN2
  • D5 → IN3
  • D6 → IN4
  • VU → 5V +
  • GND → 5V −
Wiring diagram: the NodeMCU board with four wires to the ULN2003 driver, which connects to the stepper motor.
The wiring diagram.

Video and download

Got an idea of your own?

Tell me what you’d like to make. A sketch or a few sentences is enough to get started.