How We Built AquaGuard: From Hardware Sensors to AI-Driven Remediation
A technical deep-dive into how we designed a real-time aquaculture monitoring system — from choosing MQTT over HTTP for sensor telemetry, to autonomous hardware control that responds in under 2 seconds.
AquaGuard started as a deceptively simple problem: fish die when water conditions change and nobody notices until it is too late. What we built became one of our most technically interesting systems — a full edge-to-cloud aquaculture monitoring platform that responds to anomalies in under 2 seconds.
Why MQTT Over HTTP
Our sensors publish telemetry every 5 seconds. At scale — 20+ sensor nodes per farm — that is 600 HTTP connections per minute. HTTP connection overhead became the first thing we eliminated. MQTT's persistent TCP connection and 2-byte header overhead made the choice obvious. We run a Mosquitto broker on-premises with cloud bridging to AWS IoT Core for remote access and historical analysis.
The Autonomous Control Loop
The critical insight was that remediation cannot wait for a human. When dissolved oxygen drops below a threshold, the aeration motor must activate within 2 seconds — not after a push notification reaches a farmer's phone. We built a local PLC control layer that runs independently of cloud connectivity. The cloud provides model updates and historical reporting. The edge makes life-or-death decisions.
- Edge: Raspberry Pi 4 running Python control daemon, decision latency < 500ms
- Protocol: MQTT QoS 1 for sensor data, QoS 2 for control commands
- Cloud: AWS IoT Core → Kinesis Data Streams → Lambda → DynamoDB
- AI: Anomaly detection model runs locally via ONNX runtime — no cloud dependency
- Failsafe: Hardware watchdog ensures pumps activate on comms loss
What We Would Do Differently
We underestimated sensor calibration drift. pH probes in saltwater degrade in weeks — our initial firmware had no drift correction, causing false positives that triggered unnecessary aeration cycles. We now include Kalman filtering and a mandatory 90-day calibration window baked into every firmware update.
“The system is only as smart as the quality of data it receives. Hardware calibration is a software problem too.”
Results in Production
AquaGuard is deployed across aquaculture operations in coastal Andhra Pradesh. Early adopters report a 30–40% reduction in fish mortality rates. The autonomous control loop has handled over 12,000 remediation events without human intervention. This is the kind of system you only build when your engineering team has both hardware intuition and cloud platform experience.
More Articles