Smart Pond Feeder
A boat that feeds fish at fixed spots in a pond, a dock that refills it, and a phone app to watch and control both. This page goes through the ten IoT design steps in order, from why it is needed to the app running.
Professor, Computer Science and Engineering Programme
Pond feeding is manual and unmeasured. One 100 × 100 m pond takes ≈20 kg per meal over 400 m of bank.
A feeder boat drops measured feed at fixed points and returns to a dock that refills it, with water readings adjusting each dose.
Full IoT design (steps 1–10), wiring, protocols, service API, and a working dashboard simulation of one feeding loop.
In plain words
Right now someone walks the bank of the pond throwing feed by hand, and nobody really measures how much goes in. We replaced the walk with a small boat. It feeds at three marked spots, checks the water temperature and how cloudy it is before each drop, and goes back to a dock that refills its hopper. The farmer watches all of it on a phone, with no internet needed.
What changed since Review 1
The idea did not change: a boat, a dock, a phone app and auto-refill. What we changed was the hardware, making it simple enough to build in two days and still work on demo day.
| Function | Review 1 plan | Review 2 prototype | Reason |
|---|---|---|---|
| Positioning | GPS + wheel odometry | Timed differential-drive path + V-guide docking | GPS error (2–5 m) is larger than a demo tank |
| Dispensing | 25 mm valve + BLDC throw disc | Servo swing flap, gravity drop at each point | No jamming, no high-current ESC on a small hull |
| Boat ↔ dock link | NRF24L01+ at 2.4 GHz | ESP-NOW (built into ESP32) | No extra radio module; peer-to-peer with ACK |
| Power | 12 V LiFePO4 | 2S 18650 (7.4 V) + 5 V buck | Matches small motors and servo |
| Hull | Paddle boat | PVC catamaran, 45 × 30 cm | Stable, unsinkable, cut in an hour |
| Phone app, auto-refill, logging, fail-safe | Planned | Kept, now implemented | Core of the project |
| As built: boat ↔ dock | ESP-NOW | Wi-Fi HTTP heartbeat, boat found as pondboat.local | Works on a phone hotspot with one network setting |
| As built: cloud | MQTT, planned | HTTPS to Supabase, website on Vercel | Free tier, no broker to run |
| As built: control | Fixed timed path | Draw any path; remote commands behind a PIN | Farmer sets the route, not the firmware |
Purpose and requirements specification
What the system is for and what it has to do, written down before we picked any parts.
Automatically feed fish in a pond with measured doses at fixed points, adjust each dose to water conditions, refill without a person at the water, and let the farmer monitor and control it from a phone.
- Auto mode: boat leaves the dock, follows the stored path, drops a dose at each point, returns and docks.
- Adaptive dose: water temperature and turbidity scale the dose before each drop.
- Refill: when docked, the dock opens its gate until the boat hopper is full.
- Manual mode: start, pause, return home, test-drop from the phone.
- Safe stop: link loss or stop command halts motors and closes both gates.
- Remote start, pause, home and test-drop.
- Settings (dose, path timings, thresholds) changed from the app, stored in flash.
- Live status of both nodes: state, battery, link.
- Local (on boat): compute dose from temp + turbidity before each drop.
- Local (on dock): decide refill from hopper level.
- Logged per event: time, point, grams, temp, turbidity, hopper %.
- Cloud (planned): daily grams fed, trends.
- Web app served by the dock ESP32; opens in any phone browser.
- No internet needed for control (phone joins dock Wi-Fi).
- Internet only for the optional cloud upload.
- WPA2 password on the dock access point.
- ESP-NOW peers paired by MAC; encrypted with a shared key.
- Commands accepted only from the paired dock.
- Fail-safe: gates default closed, motors stop on 1 s link silence.
| Non-functional | Target |
|---|---|
| Dose accuracy | ±20 % over 5 drops after calibration |
| Docking success | 4 of 5 runs end at the limit switch |
| Link | Telemetry every 500 ms; safe stop after 1 s silence |
| Endurance | ≥ 5 complete loops per charge |
| Water protection | Electronics in a sealed box; hulls float 30 min without ingress |
Process specification
The use cases from step 1, drawn out. One feeding cycle is the main flow and everything else branches off it.
flowchart TD
A([Farmer taps Start]) --> B{Boat docked?}
B -- No --> H[Return home]
H --> B
B -- Yes --> C{Hopper at least 80 pct?}
C -- No --> R[Dock opens refill gate]
R --> C
C -- Yes --> D[Reverse out, run timed path]
D --> E{At feed point?}
E -- No --> D
E -- Yes --> F[Read temp + turbidity]
F --> G[Compute dose]
G --> I[Open flap for dose ms, close]
I --> J[Send FED event, log]
J --> K{Last point?}
K -- No --> D
K -- Yes --> L[Drive into V-guide]
L --> M{Limit switch pressed?}
M -- No --> L
M -- Yes --> N([Docked, cycle done])
D -. link lost 1 s .-> S[Safe stop: motors off, flap shut]
| Use case | Actor | Trigger | Outcome |
|---|---|---|---|
| UC1 Run feeding cycle | Farmer / schedule | Start in app or set time | Three doses delivered, boat docked |
| UC2 Auto-refill | Dock node | Boat docked and hopper < 80 % | Hopper filled, REFILL_DONE sent |
| UC3 Adaptive dose | Boat node | Arrival at feed point | Dose scaled by temp and turbidity |
| UC4 Monitor | Farmer | Opens app | Live state, hopper %, water data, event log |
| UC5 Manual control | Farmer | Pause / Home / Test drop | Command executed, acknowledged |
| UC6 Fail-safe | Either node | Link loss, stop button, low battery | Motors off, gates shut, alert in app |
Domain model specification
The things in the pond and the things we build around them, with no technology chosen yet. Drawn as UML.
classDiagram direction LR class PhysicalEntity_Pond class PhysicalEntity_Hopper class PhysicalEntity_Water class VirtualEntity_Pond class VirtualEntity_Hopper class VirtualEntity_Water class Device_BoatNode class Device_DockNode class Resource_FlapServo class Resource_DriveMotors class Resource_TempSensor class Resource_TurbiditySensor class Resource_RefillServo class Resource_LimitSwitch class Service_Feed class Service_Navigate class Service_Refill class Service_Monitor class User_Farmer PhysicalEntity_Pond <-- VirtualEntity_Pond : represents PhysicalEntity_Hopper <-- VirtualEntity_Hopper : represents PhysicalEntity_Water <-- VirtualEntity_Water : represents Device_BoatNode --> Resource_FlapServo : hosts Device_BoatNode --> Resource_DriveMotors : hosts Device_BoatNode --> Resource_TempSensor : hosts Device_BoatNode --> Resource_TurbiditySensor : hosts Device_DockNode --> Resource_RefillServo : hosts Device_DockNode --> Resource_LimitSwitch : hosts Service_Feed --> Resource_FlapServo : exposes Service_Navigate --> Resource_DriveMotors : exposes Service_Refill --> Resource_RefillServo : exposes Service_Monitor --> Resource_TempSensor : exposes User_Farmer --> Service_Monitor : uses User_Farmer --> Service_Feed : uses
Pond, boat hopper (feed stock), dock hopper, pond water.
Digital pond (path + feed points), hopper level, water state, boat state.
Boat node (ESP32 on the water), dock node (ESP32 on the bank).
On-device: flap servo, drive motors, temp probe, turbidity sensor, refill servo, limit switch. Network: dock web server.
Feed, Navigate, Refill, Monitor, Configure.
Farmer, through the phone browser.
Information model specification
Each virtual entity from step 3 gets its fields. Those fields turn into the packet layout, the API and the log.
classDiagram
direction LR
class Boat {
+string state
+int pathStep
+float batteryV
+bool linkOk
}
class Hopper {
+int levelPct
+float gramsLeft
+int lowLimitPct = 30
}
class Water {
+float tempC
+int turbidityRaw
+bool turbid
}
class FeedPoint {
+int id
+int afterStep
+int baseDoseMs = 300
}
class FeedEvent {
+long ts
+int pointId
+int doseMs
+float grams
+float tempC
+int turbidityRaw
}
class Dock {
+bool docked
+string refillState
+int refillMs
}
class Settings {
+int[] pathMs
+int pwmPct
+float gPerMs
+float coldC = 22
}
Boat "1" --> "1" Hopper : carries
Boat "1" --> "1" Water : senses
Boat "1" --> "3" FeedPoint : visits
FeedPoint "1" --> "*" FeedEvent : produces
Dock "1" --> "1" Boat : coordinates
Dock "1" --> "1" Settings : stores
| ESP-NOW message | Direction | Fields (packed struct) | Rate |
|---|---|---|---|
TELEM | Boat → Dock | state, pathStep, levelPct, tempC, turbidityRaw, batteryV | every 500 ms |
FED | Boat → Dock | pointId, doseMs, grams, tempC, turbidityRaw | per drop |
CMD | Dock → Boat | cmd (START | PAUSE | HOME | TEST_DROP | STOP), arg | on demand |
DOCKED | Dock → Boat | limit switch state | on change |
REFILL_DONE | Dock → Boat | refillMs | after refill |
Service specification
What each service does, what goes in and out, and how often it runs. They come from the process in step 2 and the information model in step 4.
| Service | Type | Runs on | Input | Output / effect | Schedule |
|---|---|---|---|---|---|
| Navigation | Native | Boat | Path array, PWM % | Motor commands; pathStep | Continuous in RUN/RETURN |
| Feed (drop) | Native | Boat | doseMs from Dose service | Flap 0° → 80° → 0°; FED event | At each feed point |
| Dose adjust | Native (analysis) | Boat | tempC, turbidityRaw, baseDoseMs | doseMs = base × f(temp) × f(turbidity) | Before each drop |
| Refill | Native | Dock | Limit switch, levelPct | Gate open/close; REFILL_DONE | When docked and level < 80 % |
| Monitor | Web (REST) | Dock | — | GET /api/state JSON | Polled every 1 s by app |
| Control | Web (REST) | Dock | {"cmd":"start"} | POST /api/cmd → CMD packet | On request |
| Log | Web (REST) | Dock | — | GET /api/log last 50 events (CSV in flash) | On request |
| Configure | Web (REST) | Dock | Settings JSON | POST /api/settings, synced to boat | On request |
| Fail-safe | Native | Both | Link watchdog, stop | Motors off, gates shut | Always on |
| Cloud uplink planned | MQTT publish | Dock | FED, TELEM | Topic pond/1/events | Per event |
// GET /api/state →
{
"boat": {"state":"RUN","step":4,"batteryV":7.62,"link":true},
"hopper": {"levelPct":71,"gramsLeft":710},
"water": {"tempC":26.4,"turbid":false},
"dock": {"docked":false,"refill":"IDLE"},
"fedToday_g": 34.5
}// Dose adjust service (boat)
int doseMs(float tC, bool turbid){
float f = 1.0;
if (tC < S.coldC) f *= 0.7; // fish eat less in cold water
if (turbid) f *= 0.7; // uneaten feed or poor water
return (int)(S.baseDoseMs * f);
}
// grams = doseMs * S.gPerMs (calibrated)IoT level specification
We sit at level 5: one end node that senses and acts, and one coordinator that gathers its data and serves the app. Uploading the coordinator's data to the cloud completes level 5. Level 6 is where it would go at scale.
| Level | Fit for this project | Status |
|---|---|---|
| 1 | Boat alone can run a loop and log locally | met |
| 2–3 | Single-node cloud patterns; we have two nodes | not used |
| 4 | Nodes analyse locally; no separate coordinator | not used |
| 5 | Boat = end node, dock = coordinator collecting and forwarding | selected |
| 6 | Several boats, dock as central controller, cloud analytics | target |
Functional view specification
The functional groups of the IoT logical design, and which parts of our system do each job.
Operational view specification
The actual choices for each group: how the system is deployed and how it runs.
| Functional group | Operational choice |
|---|---|
| Devices | 2 × ESP32 DevKit (30-pin). Boat: SG90/MG90S flap servo, 2 TT motors on TB6612FNG, DS18B20, analog turbidity sensor, 2S 18650 + 5 V buck. Dock: MG90S refill servo, lever limit switch, 5 V USB adapter. |
| Communication — link layer | ESP-NOW over 802.11 at 2.4 GHz (boat ↔ dock); 802.11 Wi-Fi AP on the dock (phone). |
| Communication — network / transport | IPv4 on the dock AP at 192.168.4.1, TCP for HTTP. ESP-NOW is connectionless with MAC-layer ACK. |
| Communication — application | HTTP REST with JSON (request–response). ESP-NOW structs (exclusive pair). MQTT publish (planned). |
| Services | Native firmware services in C++ (Arduino framework); REST services on WebServer library on the dock. |
| Application | Single-page HTML/CSS/JS app stored in dock flash, served at http://192.168.4.1. |
| Database / storage | CSV event log in dock flash (LittleFS); settings in NVS (Preferences). Cloud store planned. |
| Management | Settings page writes NVS and pushes to boat; serial monitor for debugging. |
| Security | WPA2-PSK on AP; ESP-NOW encryption with PMK/LMK; accept packets only from paired MAC; 1 s link watchdog. |
- Request–response: phone ↔ dock REST.
- Exclusive pair: dock ↔ boat ESP-NOW, bidirectional, persistent peers.
- Push–pull: navigation pushes feed jobs; feed service pulls when free.
- Publish–subscribe: dock → MQTT broker (planned).
The boat speaks ESP-NOW only (non-IP). The dock translates its packets into REST/JSON for the phone and back, so the whole boat appears behind one IP address.
Device and component integration
Where each component sits and how it is wired.
| Component | Placement |
|---|---|
| Hopper + flap | Centre, over the slot |
| ESP32 box | Front-left, sealed |
| Battery | Rear-right, low |
| Motors | Rear tip of each hull |
| Sensors | Front beam, hanging in water |
| Dock hopper + spout | On PVC arm, 3 cm above boat hopper when docked |
| Limit switch | Narrow end of the V-guide |
| Boat pin | To | Interface |
|---|---|---|
G13 | Flap servo | PWM 50 Hz |
G25 G26 G27 | PWMA AIN1 AIN2 | PWM + GPIO |
G32 G33 G14 | PWMB BIN1 BIN2 | PWM + GPIO |
G4 | STBY | GPIO |
G18 | DS18B20 | 1-Wire |
G34 | Turbidity | ADC1 |
| Dock pin | To | Interface |
|---|---|---|
VIN / GND | 5 V USB adapter | Power |
G13 | Refill servo | PWM 50 Hz |
G23 | Limit switch → GND | GPIO, INPUT_PULLUP |
G2 | Onboard LED | Docked / refilling |
| Wi-Fi | AP "PondFeeder", WPA2 | 802.11 |
Application development
The phone dashboard, running against a simulated boat. Change the water readings and watch the dose at each feed point change.
// Boat firmware structure
setup(): servo, motors, sensors, ESP-NOW peer(dock)
loop():
readSensors() // every 500 ms
sendTelem() // TELEM to dock
switch(state):
DOCKED : wait REFILL_DONE + START
RUN : runPathStep(); if FEED → DROP
DROP : dose = doseMs(t, turbid); flap(dose); sendFED()
RETURN : runPathStep(); wait DOCKED
STOP : motors off, flap shut
if (millis()-lastRx > 1000) state = STOP;// Dock firmware structure
setup(): Wi-Fi AP + WebServer, ESP-NOW peer(boat),
LittleFS log, NVS settings, servo, switch
routes: GET / → app.html GET /api/state
POST /api/cmd GET /api/log
POST /api/settings
onRecv(TELEM|FED): update state, append CSV row
loop():
server.handleClient()
if (switchPressed && level < 80) refill();
if (switch changed) send DOCKEDThe system running end to end
Steps 1 to 10 are the design we submitted for Review 2. This part is what we built since: a dock, a cloud and a website you can open from anywhere. Everything below is running code.
ESP32 boards: the boat and the dock, each with its own firmware.
Telemetry, events, missions and commands, all with row-level security.
Feed, refill, dock open and close, auto on and off, repeat mission, stop.
Temperature, feeds, refills, signal and uptime go up every 15 seconds.
From a tap on the website to the boat acting on it.
Steps the boat can follow from a shape drawn on a phone.
The boat's own control page
The boat serves its page itself, so any phone on its Wi-Fi can drive and feed it with nothing installed. The screenshot is the real page, rendered with demo readings.

The cloud dashboard
One page on Vercel that reads the Supabase tables. It turns the boat's raw numbers into things a farmer can act on.

Redraws any past path from its steps, with a replay and four numbers: steps, distance, duration, turning.
Six hours of readings with min, average, max and rate of change, and a dashed line projecting the next hour.
The most oxygen the water can hold at this temperature at Bengaluru's 920 m altitude (Benson–Krause). Warmer means less.
A feeding curve for warm-water fish, peaking at 25 to 28 °C, with a recommendation from the live reading.
One ring per day for seven days, dots sized by how long the gate stayed open.
Refills today on a 24 h line, plus a live stream of every feed, dock action, mission and sensor change.
Remote control, step by step
The boat never opens a port to the internet. It asks the cloud for work. That is why a phone hotspot is enough, and why a stranger cannot reach it.
sequenceDiagram
participant F as Farmer on the website
participant S as Supabase
participant B as Boat
participant D as Dock
F->>S: Unlock, send the 6 digit PIN
S-->>F: PIN ok, checked inside the database
F->>S: Refill at dock, with the PIN
S->>S: PIN checked again, command queued as pending
loop every 2 s
B->>S: Any commands for me, with the device secret
end
S-->>B: refill, marked taken
B->>D: Open the gate for 3 s
D-->>B: ok
B->>S: Event dock refill, 3 s
S-->>F: Shows in the event stream
The page never contains the PIN. A database function checks it, and checks it again on every command.
The database accepts only eight command names and an argument from 0 to 20000. Anything else is refused.
Each command is pending, taken or expired, so a command sent while the boat was off never fires later.
Repeat mission is refused if a path is running or none exists, and the refusal is logged.
Live steering over the internet would be unsafe, so joystick control only exists on the boat's own page.
The unlocked state lives only in that browser tab, and Lock clears it.
The dock refilling the boat
The dock is a second ESP32 with one servo gate. It opens from 180° to 135°, feed falls, and it closes itself when the timer ends.
| Dock behaviour | What it does |
|---|---|
| Heartbeat | Calls the boat every 2.5 s. The boat uses it to show the dock online and to learn its address automatically. |
| Finding the boat | On the phone hotspot it looks the boat up as pondboat.local. Otherwise it joins the boat's own PondFeeder network. |
| Recovery | After 3 missed heartbeats it looks the boat up again. After 8 it rejoins the network. |
| Stand-alone test | Its own page has Open, Close and Refill 3 s buttons. |
| LED | On-board LED is lit while the dock is talking to the boat. |
Done, in progress, still to prove
| Item | Review 2 said | Now |
|---|---|---|
| Boat drives, steers, feeds, reads temperature | Planned | working |
| Draw a path on the phone, boat follows it | Timed path, fixed | working |
| Auto feed with temperature guard | Adaptive dose | working |
| Dock refill | Under development | working |
| Cloud upload and website | MQTT, planned | working over HTTPS to Supabase |
| PIN-protected remote control | Not in the plan | built, database side tested |
| Dock heartbeat on the phone hotspot | ESP-NOW link | being fixed |
| Dose in grams, endurance, docking success rate, fail-safe timing | Test plan | not yet measured |
| Floating hull, turbidity sensor | Catamaran, adaptive dose | future work |
From a remote boat to a feeder that runs itself
The demo shows a boat you drive. The product is a boat you stop driving. Each rung below hands one more job from the farmer to the machine. Green is running today, amber is partly there, dashed is the plan.
One autonomous feeding day
What the farmer sees once rung 3 is joined up. This is the target behaviour, drawn from the pieces that already work.
- Timer-based auto feed with temperature guard
- Follow a stored route and repeat it
- Dock refill on command
- Every action logged to the cloud
- Run route, feed at points, return and refill as one job
- Start the job from the timer, not a tap
- Dock detects the boat is in place
Feeding is the biggest recurring chore and cost on a fish farm. A boat that does the whole loop on its own, and reports it, removes the chore and leaves a record.
Knowing where it is: GPS and what goes with it
Today the boat guesses its position from how long it drove, which drifts. A real autonomous boat has to know where it is. This is how we plan to get there.
Basic GPS is accurate to a few metres, which is bigger than a small pond or a feed spot. That is why Review 1 dropped it for the demo. In the product, GPS gives the big picture (where in the pond, how to get home) and a compass plus wheel encoders give the fine movement. A better GNSS receiver can tighten it further.
One more sensor on the boat ESP32. The path stored in the cloud then holds real coordinates, so the mission map shows the measured track instead of a reconstruction, and feed points become places on the map.
Roadmap, with an honest status for each item
| Capability | What it gives the farmer | Status |
|---|---|---|
| Remote driving and feeding | Feed from a phone, nothing to install | built |
| Draw a route, repeat it from the web | Set the route once, not every day | built |
| Timer feeding with temperature guard | No feeding in water the fish will not eat in | built |
| Dock refill | No one at the water to refill | built, hotspot link being fixed |
| Cloud log, map, trends, oxygen limit | A record of what was fed, when and where | built |
| Whole loop as one scheduled job | Complete autonomy for a meal | next |
| Daily schedules per day and per pond | Different meals at different times | next |
| Dose calibrated in grams, total fed shown | Know exactly how much went in | next |
| GPS, compass, encoders, geofence | Real position, safe return-to-home | planned |
| Turbidity sensor, adaptive dose | Less waste, cleaner water | planned |
| Sealed floating catamaran hull | Runs on a real pond | planned |
| Several boats on one dashboard | Cover a farm, not one pond | planned |
Test plan, demo and timeline
| Test | Method | Pass |
|---|---|---|
| Hull float | 30 min in tank, loaded | No water inside, level |
| Dose calibration | 5 drops at 300 ms, weighed | Within ±20 % |
| Adaptive dose | Cold water / stirred silt | Dose drops to 70 % / 49 % |
| Path + dock | 5 full loops | 4 of 5 hit limit switch |
| Refill | Dock with hopper at 25 % | Reaches ≥ 80 %, no spill |
| Fail-safe | Power off dock mid-run | Boat stops within 1 s |
| App | Phone joins AP, all buttons | Every command acknowledged |
Hulls sealed, parts checked, bench wiring of both ESP32s.
Flap calibrated, motors steer, dock gate + switch, ESP-NOW link.
Full loop on water, web app live, refill working.
Tuning, backup video, rehearsal of the demo script.