Inspiration

In 2024, the UN declared the Sahel the epicentre of the global hunger crisis. 25 million people displaced. Farms abandoned. Aid workers on the ground with one impossible question: what do we plant?

They open a generic crop guide written for stable conditions. It tells them nothing useful. The soil is degraded. The rain is unpredictable. The seeds they order don't survive. Months later, the harvest fails.

That second crisis — the one that comes after the disaster — is the one nobody talks about. Climate change is not a future threat. It is happening right now, to the most vulnerable people on earth, and the permanent solutions are decades away. Until then, people still need to eat.

That's the gap Sinai fills.

What it does

Sinai is a real-time, sensor-driven AI assistant that tells communities what to plant based on their exact environment — right now, today — with no internet, no cloud, and no subscription required.

An Arduino Uno R4 WiFi paired with a Grove sensor shield reads four key above-ground conditions: light intensity, temperature, barometric pressure, and air quality. That live data streams into a Raspberry Pi running a local LLM via Ollama. The model cross-references those exact current conditions against a crop database we built from scratch — five disaster regions, 17 crops each, scored across five criteria: nutrition, environmental adaptability, affordability, yield potential, and regional availability.

The output is a ranked crop recommendation list, evidence-based, region-specific, and built for people living on less than $2 a day.

Nothing else in disaster relief does this. Satellites look down from space. Soil sensors look underground. Sinai is the only tool that measures what a plant actually experiences at ground level, in real time, and turns that into an immediate, actionable answer.

The entire hardware setup costs under $50. It runs on a power bank. At volume, 10,000 units becomes a procurement line item for the UN World Food Programme — not a research grant.

How we built it

The backend is a FastAPI server handling REST endpoints and WebSocket connections. The LLM runs locally through Ollama (llama3.2:1b) for fast, on-device inference with a deterministic fallback path so the system never fully fails even without a model loaded.

Sensor readings come in over serial from the Arduino via a lightweight Python bridge script, which POSTs JSON readings to a /api/data/ingest endpoint. The server merges those readings into a live sensor state and broadcasts updates to connected clients through WebSockets in near real time.

We built two frontend surfaces: a monitor view for a shared screen showing live sensor data and the AI's recommendations, and a phone client for anyone in the room to interact with the assistant directly from their browser — no app install needed. Everything is synced across devices through the same WebSocket layer.

The crop scoring database was built from scratch and encodes region-specific knowledge across five disaster-affected zones, weighting each crop recommendation against live environmental conditions the sensors are actually reading.

We also wrote one-command Raspberry Pi deployment scripts with hotspot support so the entire stack — server, model, and sensor bridge — can be running in under 10 minutes with no external network.

Challenges we ran into

Tuning the LLM for speed was the hardest tradeoff. On a Raspberry Pi, even a 1B parameter model has real latency, and a demo that makes judges wait 30 seconds for a response loses the room. We had to aggressively reduce token ceilings and response length targets to hit a latency that felt interactive without sacrificing the quality of crop recommendations.

Getting the Arduino serial bridge to handle stale data gracefully was also tricky — when the sensor isn't connected, we needed the system to fall back to mock readings rather than crash or freeze the monitor view. We added configurable stale-time detection with a clean fallback to simulated baselines.

Structuring the crop database in a way the LLM could actually reason over — not just retrieve from — took several iterations of prompt engineering to get right.

What we learned

Building for zero-connectivity environments is a fundamentally different design constraint than building for the cloud. Every external dependency is a failure mode. We became much more deliberate about what the system actually needs versus what's just convenient.

We also learned that a $50 hardware kit running a 1B parameter model locally is genuinely capable of producing useful, context-aware agricultural recommendations — which challenges a lot of assumptions about what "edge AI" can and can't do in low-resource settings.

What's next

Sinai AI is fully open source, publicly documented, and licensed for anyone to build on. The hardware is replicable anywhere in the world.

We want to expand the crop database to more regions and add soil moisture and UV sensors to the array. Longer term, we're interested in partnering with NGOs to run field pilots in post-disaster zones and building a version of the recommendation engine that works entirely offline on sub-$10 microcontrollers for the most resource-constrained deployments.

Built With

Share this project:

Updates