Circa — AI-Powered Precision Irrigation
The Problem
Farming today is inefficient, expensive, and hard to control. Nearly 40–50% of irrigation water is wasted through poor management and imprecise delivery — and the systems designed to fix this create problems of their own.
Center-pivot irrigation (circular farming) is one of the most water-efficient methods available, saving up to 90% more water compared to traditional flood or furrow irrigation. But it comes with serious trade-offs:
- Wasted space. Circular systems irrigate a circle inside a rectangular field. The corners go unwatered. On large farms, those ignored corners scale up to massive amounts of wasted, unproductive land.
- Non-uniform water distribution. The inner radius gets over-watered while the outer edges are under-watered — the physics of a fixed-length arm spinning from a center point makes this nearly unavoidable.
- Energy inefficiency. Continuous motor operation and pumping water across a large radius burns energy whether the soil needs water or not.
- Soil variability ignored. Different zones have different absorption rates. Some areas get waterlogged, others stay dry — and traditional center-pivot systems treat the entire field the same.
The core issue: existing systems deliver water based on geometry, not based on what the soil actually needs.
Our Solution
Circa is a compact, sensor-driven turret irrigation system that brings the water-saving advantages of center-pivot irrigation to any field shape — including rectangular plots — while eliminating the problems that make current systems wasteful.
Instead of a massive rotating arm, Circa uses a small, centrally-mounted turret with two-axis aiming (yaw + pitch) to direct water to specific coordinates on the field. This means:
- Rectangular coverage, center-pivot efficiency. The turret's stepper-driven rotation and servo-controlled pitch angle let it reach any point in a rectangular plot through calculated polar-to-Cartesian targeting. No more wasted corners.
- Sensor-driven, not geometry-driven. A distributed network of soil moisture sensors continuously reports zone-by-zone conditions. The turret only fires where the soil is actually dry — eliminating both over-watering and under-watering.
- Compact and diagnosable. All mechanical components (motor, pump, nozzle, solenoid) are co-located at the turret base. There's no hundred-meter arm to inspect — if something breaks, it's all in one place.
- Energy efficient. Instead of a continuous motor dragging an arm in circles, the turret only activates when and where irrigation is needed. The pump runs for targeted bursts, not constant flow.
- Predictive, not just reactive. An XGBoost ML model forecasts next-day soil moisture, so farmers can pre-irrigate before crops become stressed — shifting from damage control to proactive water management.
The entire system is managed through a web-based control platform with live telemetry, manual turret control, automated irrigation workflows, and ML-powered prediction dashboards.
Hardware
Turret System Architecture
The turret is the centerpiece of the platform — a custom-built, two-axis water delivery system designed for precise, repeatable coverage of rectangular field plots.
Rotation (Yaw): A NEMA 17 stepper motor (42×38mm) drives the turret's horizontal rotation through a 5:1 gear ratio, delivering high-torque, fine-resolution angular control. The TMC2209 stepper motor driver provides silent, ultra-smooth microstepping — eliminating the jitter and noise typical of basic stepper drivers and enabling precise positioning even during continuous sweeps. The turret platform rides on a 4-inch lazy susan bearing for low-friction rotation under load.
Tilt (Pitch): An MG996R high-torque servo motor controls the nozzle elevation angle, setting the throw radius of the water stream. The metal-gear MG996R was chosen for its durability and holding torque — critical when the nozzle is under water pressure.
Water Delivery: A 12V DC diaphragm pressure pump pushes water through 3/8" PVC tubing to a jet hose nozzle at the turret head. A 3/8" 12V solenoid valve provides electronically-controlled flow gating, and a relay module handles pump switching from the ESP32's logic-level GPIO. A buck converter steps down the 12V supply to the 3.3V/5V rails needed by the microcontrollers and sensors.
Sensor Node Network: Five capacitive soil moisture sensors are distributed across the field as independent nodes, each connected to an ESP-32S development board. Two DHT11 temperature and humidity sensors provide ambient environmental readings at the base station. Nodes communicate wirelessly to the base/turret via ESP-NOW — Espressif's low-power, peer-to-peer protocol that eliminates the need for WiFi infrastructure in the field. The base station aggregates all sensor data and publishes telemetry over MQTT (Mosquitto broker), feeding the backend and frontend in real time.
Communication Stack:
- ESP-NOW — node-to-base/turret low-latency sensor data transmission, no WiFi router required.
- MQTT (Mosquitto) — base station publishes parsed telemetry on port 1883 (MQTT) and 9001 (WebSocket).
- HTTP — turret station exposes direct control endpoints (servo, stepper, pump, aiming) over its own SoftAP network.
Hardware Tech Stack: 3× ESP-32S · NEMA 17 Stepper + TMC2209 Driver · 5:1 Gear Reduction · Lazy Susan Bearing · MG996R Servo · 12V DC Diaphragm Pump · 3/8" Solenoid Valve · Relay Module · Buck Converter · 5× Capacitive Soil Sensors · 2× DHT11 · PlatformIO · ESP-NOW · MQTT
Software
The software platform is split into two connected systems: Circa (the real-time field operations layer) and VWC-Predictor (the ML recommendation engine). The frontend is built with React 19, TypeScript, and Vite, with 3D rendering via React Three Fiber and state management through Zustand.
Dashboard Page
The main landing view provides a live overview of all connected stations, sensor nodes, and their current readings. Telemetry streams in real time via Socket.IO, powered by the Node.js backend subscribing to MQTT topics from the field hardware. Farmers see temperature, humidity, and soil moisture at a glance — no refresh needed.
Configure Page
Station and node management happens here. Operators can register new base stations and sensor nodes, assign them to field zones, and remove decommissioned hardware. The registry is persisted server-side, keeping the setup portable and recoverable.
Control Page — Manual Precision
The full manual control panel gives operators direct, real-time command over the turret hardware:
- Emergency Stop — immediate halt of all turret motion and pump activity.
- Joystick Aiming — intuitive directional control for pointing the turret at specific field coordinates.
- Stepper Jog & Continuous Mode — fine and coarse yaw adjustments using the stepper motor.
- Servo Positioning — set the nozzle elevation to control water throw radius.
- Pump Control — on/off toggle and timed spray bursts.
- Node Readings Panel — live soil moisture values from all distributed sensor nodes, displayed alongside the controls for informed manual targeting.
Irrigate Page — Automated Watering
This is where the automation impact is strongest. The Irrigate page supports three automated irrigation modes:
- Single Shot — target a specific zone and deliver a precise burst of water.
- Full-Coverage Sweep — select a plot area and the turret automatically sweeps across it, delivering even coverage using coordinated stepper rotation and servo pitch adjustments.
- Arc-Path Drawing — draw custom waypoint paths on the field map, and the turret executes the arc sequence autonomously, irrigating along the defined trajectory.
The key innovation here is that turret actions are driven by soil sensor readings. The distributed sensor nodes continuously report soil moisture levels. When readings drop below configured thresholds, the system can automatically trigger targeted irrigation to only the zones that need water — eliminating waste and ensuring no part of the field is over- or under-watered. This closed-loop, sensor-driven automation is what transforms Circa from a remote-controlled sprinkler into an intelligent irrigation system.
Prediction Page — ML-Powered Pre-Irrigation
The Prediction page connects to the VWC-Predictor service, a FastAPI backend running machine learning models to forecast next-day Volumetric Water Content (VWC) for each sensor cluster.
How it works:
- The predictor ingests historical sensor data (224-row dataset covering particulate metrics, ambient conditions, humidity, pressure, and raw soil moisture).
- Data is segmented into three spatial clusters, each representing a distinct soil zone.
- An XGBoost model (with Random Forest as a secondary approach) is trained per cluster, predicting tomorrow's soil moisture based on current trends and environmental factors.
- The frontend polls the predictor API every 30 seconds, displaying cluster-level forecasts, confidence intervals, threshold comparisons, and time-to-critical estimates.
Impact for farmers: Instead of reacting to dry soil after crops are already stressed, the ML model enables proactive pre-irrigation. Farmers see a clear recommendation — irrigate now, or wait — backed by predicted VWC values and confidence scores. The chart view shows historical train/test splits with predicted vs. actual VWC, giving transparency into model accuracy and building trust in the recommendations.
ML Stack: XGBoost, Random Forest, Optuna (hyperparameter tuning), scikit-learn, with model artifacts stored as joblib files per cluster.
AI Chatbot — Multilingual Automation with Kimi K2
The platform includes an AI chatbot powered by Kimi K2, Moonshot AI's open-source mixture-of-experts language model (1 trillion total parameters, 32 billion activated per request). Kimi K2 was chosen for its strong agentic capabilities — it's specifically optimized for tool use, instruction following, and autonomous problem-solving, making it ideal for translating farmer intent into structured automation rules.
Farmers interact with the chatbot in natural language to define IFTTT (If-This-Then-That) automation workflows. Instead of navigating configuration menus, a farmer can simply say "if soil moisture in zone 2 drops below 30%, water for 5 minutes" and the chatbot translates that into an actionable automation rule the system executes. This dramatically lowers the barrier to entry for non-technical users.
Multilingual support is a key feature — Kimi K2's multilingual training means farmers can define workflows in their native language, making the platform accessible to agricultural communities worldwide. This isn't just a convenience feature; it's a societal impact consideration, ensuring that language is never a barrier to adopting precision irrigation technology.
How We Built It
- Firmware: PlatformIO (C++) targeting ESP32 for base station, turret station, and sensor nodes. Each device has a distinct firmware role — sensing, communication, or actuation.
- Backend (Circa): Node.js + Express server handling MQTT subscriptions, Socket.IO streaming, station/node registry (JSON persistence), and hardware proxy endpoints.
- Backend (Predictor): FastAPI (Python 3.11) with async services, in-memory data repository seeded from CSV, OpenWeatherMap integration for environmental context, and ML model serving.
- Frontend: React 19 + TypeScript + Vite, with React Three Fiber for 3D field visualization, Zustand for state, and Socket.IO for real-time telemetry.
- Infrastructure: Docker Compose orchestration — Mosquitto MQTT broker, PostgreSQL, MLflow tracking, and the FastAPI predictor service.
Challenges We Ran Into
- Achieving reliable ESP-NOW communication between sensor nodes and the base/turret across varying field distances.
- Tuning the NEMA 17 stepper with the 5:1 gear ratio and TMC2209 driver for smooth, precise yaw control without stalling under diaphragm pump vibration.
- Bridging the gap between the real-time control layer (direct HTTP to ESP32) and the ML prediction layer (REST API) into a cohesive user experience.
- Managing the simulation-vs-live toggle so the platform demos cleanly without hardware connected while still being ready for real field deployment.
What We Learned
- Sensor-driven automation is only as good as the reliability of the sensor network — ESP-NOW proved to be a strong choice for low-latency, infrastructure-free field communication.
- Predictive models need to be transparent to build farmer trust — visible train/test chart splits showing predicted vs. actual VWC were essential, not optional.
- A NEMA 17 with TMC2209 microstepping and a relay-controlled diaphragm pump is a surprisingly effective combination for low-cost precision water delivery.
What's Next
- Migrate the predictor runtime from in-memory to full PostgreSQL persistence for production-scale data.
- Add scheduling persistence (resolving the current Supabase integration inconsistency).
- Expand the sensor node network to support larger field geometries with mesh routing.
- Integrate weather forecast data more deeply into the ML pipeline for multi-day irrigation planning.
- Field trials with real crop cycles to validate VWC prediction accuracy across seasons.
Built with: ESP32 · PlatformIO · React 19 · TypeScript · Vite · React Three Fiber · Zustand · Node.js · Express · MQTT · Socket.IO · FastAPI · Python · XGBoost · scikit-learn · SHAP · Optuna · Docker · PostgreSQL · MLflow
Log in or sign up for Devpost to join the conversation.