Smart-WiFi-Fish-Feeder

Going away for a few days, but worried about feeding your fish? This DIY Smart Wi-Fi Fish Feeder solves the problem!
Fish don’t take vacations, but sometimes we do. This DIY Smart Wi-Fi Fish Feeder makes sure your pets get fed even while you’re away. It’s made from cardboard, runs on an ESP32, and connects to Telegram so you can trigger feedings remotely.
This feeder is unique because:
- Wireless control (ESP32 + WiFi)
- Telegram bot interface (feed from anywhere, multiple devices/accounts)
- Countdown and scheduled feeding mode
- Authorized access for multiple users
- No 3D printing needed (all cardboard DIY)
GitHub Repository Link: Link
Supplies

- ESP32 board (USB Type-C version recommended)
- SG90 servo motor
- Cardboard sheets
- Hot glue gun + sticks
- Jumper wires (3x male-to-female cables)
- Plastic bottle (for food container) or cardboard + thick paper alternative
- Tape (optional, for reinforcement)
- Tools: scissors, cutter, soldering iron (if you want to melt bottle holes), ruler, marker
Build the Stand



- Cut a cardboard base plate. Make it wide enough so the feeder doesn’t topple. It is recommended to add some weight under the base (stones, bolts, or anything heavy) to keep it stable.
- Build a hollow vertical shaft. Keep it hollow so you can store jumper wires neatly inside.
- Add an internal support piece of cardboard inside the shaft so it doesn’t collapse inward, but leave space above for wires.
- Glue the shaft to the base plate.
The Drawer Carriage for ESP32 + Servo



I recommend making a drawer-style carriage so the electronics aren’t permanently glued.
- Cut a cardboard piece that slides into a slot in the stand like a drawer.
- Mount the ESP32 and SG90 servo on this carriage.
- The servo arm should stick out where the food container will be attached.
- Slide the carriage into the stand. Now you can pull it out later for maintenance or rewiring.
This design allows components to be swapped or reused later for other projects or maintenance. It also prevents damage caused by glue or other fixed attachments.
Food Container

For the food container, you can choose between two main options:
- Plastic bottle → Make a hole directly in the side. Holes can be made with a soldering iron or a sharp cutter.
- Cardboard + thick paper → Make a cylinder and cut holes. (This is my version.) It is recommended to reinforce the thick paper with sticks around the refill door (like a door frame) to improve durability (see image).
The holes are for dispensing food, so make them depending on your fish species or quantity, and how much you want to feed. Attach the container securely to the servo arm.
Wiring

Use jumper wires to connect the servo to the ESP32: plug the female ends into the servo cables and the male ends into the ESP32 pins.
- Servo VCC (red) → ESP32 VIN (works if powered by USB; for higher reliability, you might need to use an external 5V supply with common ground)
- Servo GND (brown) → ESP32 GND
- Servo Signal (orange) → ESP32 GPIO 13 (this pin can be changed in code if needed)
Create a Telegram Bot

Before uploading the code, you’ll need to set up a Telegram bot and link it with your ESP32. Here’s how:
- Open the Telegram app and search for BotFather (it’s the official Telegram bot for creating bots).
- Start a chat with BotFather and type `/start` then `/newbot`.
- BotFather will ask you for a name and then a username (the username must end with bot, e.g., FishFeederBot).
- Copy the bot token that BotFather gives you. You’ll need to paste this into the code later:
5. Get your Telegram user ID (needed for authorization):
- Search for @userinfobot.
- Send `/start` and it will reply with your numeric user ID.
- Add it to the `authorizedUsers[]` array in the code:
6. (Optional) Add multiple user IDs to let friends/family also control the feeder.
Code and Set Up
To get started, first open the GitHub repository where the Arduino code for the FishFeeder project is stored. Then, download and install the Arduino IDE by following this installation guide. Once the IDE is set up, copy the FishFeeder.ino file from the repository and paste it into a new Arduino sketch. Before you upload the code, you’ll need to install a few libraries and edit some parts of the code to match your setup.
The only libraries you need to install manually are:
- UniversalTelegramBot (by Brian Lough) → enables communication between your ESP32 and Telegram
- ESP32Servo (by Kevin Harrington, John K. Bennett) → allows control of servo motors on the ESP32
Note: WiFi.h, WiFiClientSecure.h, and time.h comes with the ESP32 board package automatically, so you don’t need to install those separately.
You’ll also need to add your own details inside the code:
(Make sure you’ve already created your Telegram bot in Step 5.)
The code is already well-commented, so just follow the notes inside.
To install the libraries, go to Sketch > Include Library > Manage Libraries… in the Arduino IDE, then search for and install each one. After installing, select the correct board (ESP32) and port, then click Upload to compile and send the code to your ESP32. If everything is set up correctly, the FishFeeder should be ready to use.
Available Commands:
- /start & /help → Shows all available commands.
- /feed1 to /feed5 → Dispenses 1–5 portions of food immediately.
- /countdown <seconds> [portions] Example: /countdown 30 2 → Waits 30 seconds, then feeds 2 portions. (Max 3600 seconds, 1–5 portions allowed)
- /schedule HH:MM [portions] Example: /schedule 08:30 3 → Feeds 3 portions every day at 08:30.
- /status → Shows WiFi info, total portions fed, active countdown, and schedule details.
Important Notes:
- The code is set for UTC+7 time zone by default:
If you live in another time zone, update `25200` (seconds offset).
- Example: UTC+1 → `3600`, UTC–5 → `-18000`.
- The servo is connected to GPIO 13.
- Servo power is from ESP32 VIN (okay for USB power, but for reliability, use external 5V with common ground).
Downloads
Test and Adjust
- Power on the ESP32 and wait for it to connect to WiFi.
- Open your Telegram bot and send `/feed1`. The servo should rotate once and drop food.
- Adjust the hole size or rotation angle depending on your portion size.
- Test countdown and schedule commands.
Tips and Recommendations
- Always add weight to the base plate for stability.
- Keep the electronics in a removable drawer for easier maintenance or upgrading.
- A plastic bottle is more durable than a cardboard one for the food container, but both work.
- Customize the holes in the food holder to your needs (portion control).
- Keep the ESP32 and wiring away from water or splashes (consider a plastic protection cover).
- Test your fish feeder thoroughly to check its reliability before using it to feed your fish remotely.
Limitations
Since this build relies on cardboard, it’s less durable than plastic or 3D-printed designs. The stand also has a fixed height, which means you may need to adjust the dimensions for your own setup. On the electronics side, the ESP32’s WiFi range is limited, scheduled feeding requires a stable WiFi connection to work reliably, and the servo may need an external 5V power supply if the board resets during feeding. Finally, the project hasn’t yet been tested long-term, so reliability over extended use is still uncertain.
Conclusion
This is a beginner-friendly build, and I’m already considering ways to improve it. But for now, it does its job of feeding fish quite well.
Note: This is only a prototype. It works well in my setup, but results may vary depending on your container design, servo quality, or WiFi stability. There is no guarantee it will work perfectly for every build. Feel free to edit, remix, or modify this project — it is licensed under the MIT License.
Happy tinkering!
Rainier P.S.