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.
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
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.
Electronics
Connect the NodeMCU to the stepper motor driver like this:
- D1 → IN1
- D2 → IN2
- D5 → IN3
- D6 → IN4
- VU → 5V +
- GND → 5V −