Automated Precision Fish Feeder (with WiFi, REV2)
Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.
Zapisane na tym urządzeniu.
Feed exact portions. Fits rimmed, rimless, and lid+hole enclosures. Set the clock and manage the feeder with WiFi.
- Ocena
- 5 / 5
- Polubienia
- 8
- Pobrania
- 33
- Wydruki
- 1
- Wyświetlenia
- 229
- Oceny
- 1
Aktualizacja u źródła:
Informacje o modelu
- Źródło
- Printables
- Kategoria
- Pets
- Licencja
- Creative Commons — Attribution — Noncommercial — Share Alike
This feeder is ideal when precise portion control is more important than high-capacity storage. It rotates the feeding tray to dispense six pre-measured portions of food. Once it reaches the final slot, reset the tray back to the starting position and refill the tray with more food. The companion app requires WiFi and Internet for full functionality. It provides a graphical user interface to set the schedule, view logs, and change settings. And yes, you can use the new app with the original feeder.
The pictures for this project show a small clamping feeder with a standard tray, and a medium feeding-hole feeder with a tall tray.
Features
Gives out premeasured portions of food. No more guessing how much food will come out.
Works with many types and shapes of foods. See printing instructions for very small foods.
Compatible with many rimless, rimmed, or lid-with-a-hole enclosures.
Compatible with many ESP32 boards.
Optional pushbutton that feeds and resets the tray without opening the app.
I also made some handy software features.
Mobile and desktop-friendly graphical interface. No need to memorize confusing button sequences.
Dashboard shows you past, present, and future at-a-glance.
Improved scheduler with more options.
Fully private, locally hosted app. No cloud services, accounts, or subscriptions.
View logs and assorted metrics. See what happened while you were away.
Revision 2
Revision 2 focuses on making the feeder easier to use and assemble. I remodeled everything from scratch and wrote a (mostly) new app. The biggest improvements are:
Substantially larger electronics box. There is room for full-size ESP32 boards and jumper wires!
Expanded options and settings within the app. I might have gotten carried away while testing.
Improved scheduler.
You can launch the app with a hostname in addition to the IP address.
App Requirements
For full functionality, the app requires WiFi and Internet at startup. Internet is only required to query a time server. After time is synchronized at startup, the feeder can continue running uninterrupted and fully automated without WiFi or Internet. However, without periodic time synchronization the internal clock will gradually drift, ranging from a few seconds to a few minutes after one day. And without WiFi, you will be unable to access the graphical user interface.
Supplies
If you are new to ESP32, I recommend buying boards from a manufacturer that includes excellent documentation and tutorials, like Adafruit or Sparkfun.
Fasteners.
Up to (9) M3x10 mm screws, or up to (9) #4-40x3/8 in screws.
Micro servo.
Capacitor (optional, recommended).
200 - 400 µF, rated for 6 V or higher.
This helps stabilize power for the servo.
Momentary pushbutton (optional).
7 mm, 12 mm, or 16 mm diameter.
The button can manually feed and reset the tray without opening the app.
ESP32 board.
I tested with full-size Elegoo dev boards and mini Adafruit boards (QT Py S2 and S3).
If you buy a standard ESP32 dev board, you can use a simplified flashing method.
I left enough room in the electronics box to use pre-soldered headers and jumper wires.
Make sure there is a 5 V output pin.
USB power supply, 5 V.
1.5 A (7.5 W) or greater recommend.
1.0 A (5 W) is likely the minimum to guarantee safe and reliable operation.
Exceptions for small feeders.
Supplies change for a small feeder because of the smaller electronics box.
Mini-size ESP32 board.
Pre-soldered headers and jumper wires will probably take up too much space.
It is more difficult to fit a pushbutton.
Parts & Files
Choose your fasteners.
Select either metric (M3) or imperial (#4-40).
Choose a mounting style.
The feeding hole version sits on top of a lid or covering and is held in place by gravity.
The clamping version attaches to the side of an aquarium or terrarium. Keep reading to pick the right size.
If you make the clamping version:
Choose a base that fits the rim or brace at the top of the enclosure.
Small fits 2 to 13 mm (1/8 to 1/2 inch).
Medium fits 2 to 26 mm (1/8 to 1 inch).
Large fits 25 to 39 mm (1 to 1.5 inch).
Choose a clamp.
Use the angled clamp for enclosures with a reinforcing rim.
Use the straight clamp for rimless enclosures.
Printing
The anti-backlash spring should be printed in PETG. For everything else, use any convenient, low-warp filament. You may want to add a brim to the electronics box, feeding tray, and spring.
The base and feeding tray should be printed on a smooth and flat surface. If either part is not flat due to bed mesh deviations, warping, or other inconsistencies, small particles of food may slip between the tray and base. If you want to use fish flake or fry food, then you should fully flatten these two parts with sanding.

What is the limit for food size without sanding? It depends. Consider a printer with a bed mesh deviation of 0.4 mm. In a worst-case scenario, low spots on both printed parts could align and create a combined gap of 0.8 mm. If the base warped an additional 0.4 mm, the total gap reaches 1.2 mm. So in this example, food particles 1.5 mm or larger would be fine.
Assembly
To help simplify the project, all screws thread into plastic. Because small plastic threads wear out easily, do not over-tighten screws. Tighten screws by hand until the gap between parts disappears. Do not add extra turns. You can put the slot for the cord on either side of the feeder. However, one side has less room for a button because the servo position is asymmetric.
I put instructions on the printed parts to simplify the process of assembling the servo and feeding tray.
Rotate the servo in the direction of the arrow until it reaches a mechanical stop.

Pull off the servo horn and place the feeding tray onto the base.
Align the circles on the tray and the base. The filled-in starting slot should be close to the opening in the base.

While keeping the circles lined up, press the servo horn onto the servo.
Push the anti-backlash spring into place.

(Optional) Use the screw included with the servo to secure the servo horn.
Slowly tighten this screw to gently squeeze the tray onto the base.
Recommended if you are using small foods.
Wiring
You must connect the three wires on the servo to the ESP32 microcontroller. Everything else is optional. The USB port provides power.
When identifying pin numbers, do not blindly trust the physical printed label. They may or may not match the internal registers (GPIO). It is worth the time to check a pinout guide.
Servo (required).
Middle red wire = Power. Connect to 5 V USB power source.
This pin must support 5 V output, and it can be labeled 5V, VBUS, VUSB, or VIN. If in doubt, check manufacturer documentation.
Do not use the 3.3 V power source for the ESP32 chip.
Black or brown wire = Ground. Connect to common ground labeled GND or just G.
Orange or yellow wire = Signal. Connect to an available GPIO pin capable of pwm output.
Capacitor (optional, recommended).
Short lead with a light color stripe = Ground. Connect to GND between the servo and ESP32.
Long lead = Positive. Connect to 5 V between the servo and ESP32.
Momentary pushbutton (optional).
Connect one lead (does not matter which one) to GND.
Connect the other lead to an available GPIO pin.
For standard panel-mount buttons, be sure to run wires through the mounting hole in the electronics box before you attach both ends.
Here is an example wiring diagram for the Elegoo Devkit. The pushbutton pin number is 15 and the servo pin number is 12. Pinout reference.

Here is an example wiring diagram for an Adafruit QT Py S2/S3 board. The pushbutton pin number is 19 and the servo pin number is 18. Pinout reference.

You can use jumper wires if soldering seems intimidating. Standard jumpers use male and female DuPont connectors with 2.54 mm or 0.1 inch spacing. Most micro servos already come with female connectors, and it is easy to find ESP32 dev kits with presoldered headers (male connectors). You can even use jumper wires for the button. I bent the prongs on my wires to fit in the screw terminals.
Note: For the exact parts shown below, the servo cannot be plugged directly into the ESP32 — the order of the three pins does not match. I needed jumper wires to reorder the pins and make the right connections.

Companion App
Download the companion app on GitHub. Then you need to (1) put the app on the microcontroller, (2) connect the app to WiFi and (3) assign some first-time settings. Let's start by connecting to the microcontroller board with a computer.
Programming: Getting Connected
To simplify connecting to your ESP32, disconnect any unnecessary USB devices from your computer. Then connect the ESP32 board using a USB cable that supports data transfer. A USB cable that is power-only will not allow programming or communication.
Some boards do not support native USB and require a driver before they can communicate with your computer. The board manufacturer should provide documentation. A common USB bridge chip for dev boards is the CP210x from Silicon Labs, and drivers can be downloaded here. I needed this driver to use the Elegoo ESP32 Devkit with Windows 11.
The programming software described below will ask you to select a serial port. These are usually labeled something like COM3. If you are unsure which port to select, disconnect the ESP32 board and observe which port disappears from the list. Reconnect the board and select the port that reappears.
Programming: Arduino IDE
If you want to edit the code or want the freedom to use any ESP32 board, then download and install Arduino IDE. First, add support for ESP32 boards. If the board's manufacturer provides specific setup instructions, follow those first. Otherwise, follow these steps.
Add the ESP32 board package. In Arduino IDE, go to File and Preferences. Find the field labaled Additional boards manager URLs near the bottom. Copy and paste the following: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json. Click OK to save.


Now you can install the ESP32 boards. Open the boards manager. In the search bar, look for esp32 by Espressif Systems and click install. It will take a moment to process.

Then install the required libraries. Open the library manager. Search for and install both of the following: ESP32Servo by Kevin Harrington, John K. Bennett and WiFiManager by tzapu.


If you have not done so yet, open the ino file that contains the program code. Click on the board selector in the uppler-left portion of the window. You need to select both the board and the port. When I use Adafruit boards, they are automatically detected. I had to manually select ESP32 Dev Module for my Elegoo Devkit.

Once the board is connected and correctly identified, click the Upload button to install the program.

Programming: ESP Web Tool
You can program ESP32 boards directly from your web browser using ESP Web Tool. This method is great for beginners because you do not need any extra software, packages, or libraries! You do need a compatible browser (Chrome, Edge, or Opera). Additionally, this method only works when the precompiled binary matches your board.
Click the link above to launch the online tool in a compatible browser.

Click the settings icon and verify that you are using the slowest connection speed (smallest number baud) to improve connection stability.

In most cases, you need to put the ESP32 into bootloader mode for a successful connection. If the manufacturer has specific instructions, try those first. Hold down the BOOT button on the microcontroller board and click Connect on the webpage. In the popup, click Connect and select the port, then release the BOOT button once the connection is established.
Now select the bin file that matches your board. Change the memory address to 0, and click Program. Click Continue to overwrite the current firmware, and wait for the tool to finish. Note: The three extra placeholders are unnecessary because I merged all of the binaries into a single file.

WiFi Connection Wizard
The app creates a config portal with a temporary network called AutoFeedSETUP in order to manage wireless connections. This network shows up when:
There are no saved login credentials (SSID and password).
Example: This is the first boot and initial setup.
The real time clock is not set and the login credentials failed.
Example: After a power outage, the feeder restarted before the wireless router.
Example: The feeder starts up, but you changed the name or password of your home network.
The real time clock is set, but the login credentials fail and time synchronization is out of date.
Example: The Internet went down after the feeder was already running.
To connect to WiFi for the first time:
Power on the ESP32 and wait for AutoFeedSETUP to appear.
Connect to this network with your phone (recommended) or computer.
If you used a phone, the setup page below should open automatically. To manually launch the page, visit http://192.168.4.1 in a browser.
Click Configure WiFi and wait while it scans for nearby networks. Note that many ESP32 boards only have a 2.4 GHz antenna.
Select your home network, enter the password, and click Save.
If everything worked, the temporary network will end automatically and your connection will close.

Connect to the Feeder
Once the feeder is connected to WiFi, you can open the app in a web browser. Make sure your computer or phone is connected to the same network as the feeder. (This app does not have a "connect from anywhere" feature.) If you are using the default hostname, open http://autofeed.local. You can also connect using the IP address.
Using the hostname is simple and convenient, but you may notice small delays when opening the app or loading pages. Connecting directly through the IP address is faster, but the address may change over time depending on your router's DHCP settings.
While trying to connect, you may see a "Not Secure" warning. This happens because the app (and underlying webserver) supports http instead of https. This warning is expected, and it is generally safe to proceed because:
The feeder runs locally on your private network, and behind a firewall on your router.
No sensitive data is shared over the Internet. (No logins, no passwords.)
Your router protects wireless data with a password and encryption.
Please do not use the feeder on a public or unprotected wireless network.
First-Time Setup
After connecting to the app for the first time, complete the following setup steps. These instructions are repeated in the Getting Started menu within the app.
Define the servo pin. Enter the GPIO pin connected to the servo signal wire. This pin must support PWM output.
Set your timezone. Find your value here and save it in the App Settings menu. POSIX strings are used because they include daylight savings information.
Calibrate the tray positions. Software calibration makes sure that tray positions line up with the base.

Test a manual feeding. Run a manual feeding test to verify that everything works.
If you are using more than one feeder, make sure each device has a
Unique hostname. This prevents network conflicts between devices.
Unique temporary wireless network name. This makes it possible to identify and configure each feeder during setup.
Manually Erase Flash
If you need to manually erase the flash memory, run this short program.
#include <nvs_flash.h>
void setup() {
nvs_flash_erase(); // erase the NVS partition and...
nvs_flash_init(); // initialize the NVS partition.
while(true);
}
void loop() {}Do Not Automate Everything
This feeder is a great tool for assisting with pet care, but I advise against using it as a permanent solution. Feeding time is an important opportunity to interact with your pets and check on their well-being, especially for shy animals. Additionally, it supports training and conditioning.
As your pets come out to eat, simple observations are helpful. Are they eating with normal enthusiasm? Are they moving normally? Does their body, skin, eyes, fins, tail, etc. look healthy? Have they stopped eating? You can easily miss these signs and behaviors with fully automated feeding.
Thanks for visiting, and enjoy your pets!