🐟 Smart Automatic Fish Feeder (NodeMCU Offline with EEPROM) – Full Guide + Code + Circuit
If you ever forget to feed your fish or travel for a few days, an automatic fish feeder is the perfect solution. In this project, we’ll build a NodeMCU (ESP8266)-based automatic fish feeder that works completely offline — no Wi-Fi, no app, no cloud. It uses a servo motor to release food twice a day and stores its schedule in EEPROM, so it can resume its timing even after a power loss.
This simple but smart project is ideal for pet owners, students, and IoT beginners looking to automate daily tasks.
⚙️ Components Required
| Component | Description |
|---|---|
| NodeMCU ESP8266 | Main microcontroller |
| SG90 Servo Motor | To dispense fish food |
| 5V Power Supply | Stable 1A recommended |
| Jumper Wires | For connections |
| Breadboard | Optional |
| Plastic Bottle or Hopper | To hold fish food |
🔌 Circuit Overview
📷 Photo:
Wire it like this:
🛠 What You Need
Buy these parts (replace placeholders with your affiliate/shop links):
📌 NodeMCU ESP8266 – https://s.click.aliexpress.com/e/_c3iM1SaP
📌 SG90 Micro Servo – https://s.click.aliexpress.com/e/_c4CEEBA7
📌 5V Power Supply – https://s.click.aliexpress.com/e/_c3aUKoAX
📌 LED (optional) – https://s.click.aliexpress.com/e/_c4tqHHzD
📌 Jumper Wires – https://s.click.aliexpress.com/e/_c3p0y3pp
📌 Breadboard or PCB – https://s.click.aliexpress.com/e/_c4bq0Taj
⚠️ Use an external 5 V supply for servo power if the servo draws more current than the NodeMCU can safely provide.
💻 Full Arduino Code
Upload this sketch to your NodeMCU using Arduino IDE:
This code:
✔ Feeds every 12 hours
✔ Uses EEPROM to remember last feed time
✔ Drives a servo to dispense food
✔ Uses an optional LED for status
💻 Code Explanation
The program uses EEPROM to save the last feed time. Every 12 hours, the servo rotates 150°, opens the feed container for 1.5 seconds, and returns to its original position. When it feeds, it stores the current timestamp in EEPROM so it continues from where it left off after a power outage.
The interval can be changed in the line:
Change “12” to any number of hours you want between feedings.
🧠 How It Works
-
When powered, the NodeMCU checks EEPROM for the last feed time.
-
It uses its internal clock (
millis()) to track time since the last feeding. -
Once 12 hours pass, it triggers the servo to dispense food.
-
The last feed time is saved again in EEPROM.
-
Even if the power goes off, it remembers when it last fed and continues automatically.
⚡ Advantages
-
✅ Works offline — no Wi-Fi or app needed
-
✅ Saves timing in EEPROM for reliability
-
✅ Low power and easy to build
-
✅ Fully automatic — perfect for daily feeding routines
This offline NodeMCU fish feeder is a practical IoT-style automation project you can sell or build for your own aquarium. It reduces maintenance, keeps your pets healthy, and teaches valuable embedded-systems skills.
automatic fish feeder project
nodeMCU offline feeder
esp8266 fish feeder
arduino servo fish feeder
eeprom schedule feeder
smart aquarium gadget
DIY pet feeder


Comments
Post a Comment