← writing

Dirt Signal: edge AI soil and plant health monitoring for vineyards

2026.10.13

Dirt Signal is a Raspberry Pi based edge AI platform that reads soil and climate sensors, runs literature-grounded advisory models, and tells a grower what needs attention before the vines show it. I am building it as a working product, a research foundation, and a live test on grape vines in my own greenhouse in Roodepoort, Johannesburg.

The Dirt Signal field node beside a Cabernet Sauvignon vine in the Roodepoort greenhouse.

Project at a glance

Project

Dirt Signal, an edge AI soil and plant health monitoring system

Role

Sole designer and engineer: hardware, firmware, backend, machine learning, desktop and web apps, enclosure design

Status

In active development, with a live greenhouse testbed and advisory modules running in shadow mode

Core stack

Raspberry Pi 4B, Python, FastAPI, scikit-learn, Supabase, Tauri, React, TypeScript

Target users

Winegrape growers, starting with the Cape Winelands

Testbed

Cabernet Sauvignon vines in a 4m by 3m by 2m greenhouse tunnel in Roodepoort

The problem

Vineyard diseases such as downy mildew, powdery mildew, and Botrytis are driven by weather and canopy conditions that change hour by hour. Most small and mid-sized growers still rely on scheduled sprays, memory, and a walk through the rows. Commercial monitoring systems exist, but they are expensive, cloud dependent, and often tuned for Northern Hemisphere conditions.

I wanted to find out how far a low-cost, locally processed system could go. The brief was a sensor node that works in the field, makes decisions on the device or on a nearby machine, and gives advice that a viticulturist could trace back to published research.

What Dirt Signal does

  • Reads soil temperature, soil moisture, soil pH, ambient temperature, ambient humidity, and soil nutrients (nitrogen, phosphorus, and potassium) from one field node.

  • Captures plant images with a NoIR camera, tagged by light condition, ready for vegetation index work.

  • Pulls hourly weather forecasts from Open-Meteo, which needs no API key.

  • Calculates derived metrics such as vapour pressure deficit, dew point, growing degree days, and soil dry-down rate.

  • Runs advisory modules for downy mildew, powdery mildew, Botrytis, frost, irrigation scheduling, and phenology tracking.

  • Shows everything in a desktop app and a progressive web app backed by Supabase.

Hardware: a field node built on constrained devices

The node runs on a Raspberry Pi 4B, with sensors wired through a hand-soldered perfboard rather than a breadboard, so the connections survive heat, humidity, and vibration.

The perfboard build with colour-coded wiring for power, I2C, 1-Wire, analogue, and RS485 signals.

Sensor stack

  • DS18B20 for soil temperature over 1-Wire.

  • DHT22 for ambient temperature and humidity, mounted on an external stalk pod so the Pi's own heat does not skew readings.

  • HW-390 capacitive probe for soil moisture, with a two-point calibration.

  • PH-4502C module for soil pH, read through an ADS1115 analogue to digital converter.

  • JXCT JXBS-3001-TR seven-in-one RS485 sensor for moisture, temperature, electrical conductivity, pH, nitrogen, phosphorus, and potassium.

  • NoIR Camera Module 3 for plant observation.

Engineering decisions that mattered

  • USB-to-RS485 adapter instead of a GPIO TTL module. This avoids UART and Bluetooth conflicts on the Pi and removes the need for DE/RE direction control.

  • Voltage divider before the ADS1115. The pH module outputs 0 to 5V, which would damage the converter. Two matched 5kΩ resistors fixed this, and the junction now reads about 1.9V.

  • Three-point pH calibration. I calibrated against pH 4.01, 6.86, and 9.18 buffer solutions and stored the raw values in configuration.

  • Documented wiring standard. Black for ground, red for 5V, orange for 3.3V, blue and green for I2C, white for 1-Wire, purple for analogue signals, and a twisted pair for RS485. Solid-core wire handles fixed board runs, and shielded twisted pair carries the RS485 and pH lines.

  • Separated power rails. Higher-voltage and logic rails stay physically apart on the board.

Enclosure and outdoor power

A sensor node in a Johannesburg greenhouse or a Cape vineyard faces sun, rain, dust, and lightning. I redesigned an open-source trail camera base into a four-zone enclosure: a Pi compartment, a breakout pod for the converter and terminal blocks, a 5V distribution area, and an external pod for the humidity sensor.

The 3D-printed enclosure with cable glands and a sealed lid.

  • Parametric rebuild using trimesh to produce watertight models with a tongue-and-groove lid seal and screw standoffs.

  • Six to seven cable glands, with drip loops, pressure-equalising vents, and silica gel desiccant for humidity control.

  • M2.5 brass fasteners for the Pi mounting holes after M3 nylon screws proved one size too large.

  • PETG for the current build, with ASA planned for permanent outdoor use.

  • A solar design sized for an average draw of roughly 5 to 6W: an 80 to 100W panel, a LiFePO4 battery for around three days of autonomy, an MPPT charge controller, and surge protection for Highveld lightning.

Software architecture

The platform is a monorepo with clear boundaries between collection, intelligence, and presentation.

  • Pi collector. A Python service managed by systemd that reads sensors and writes to Supabase. Each sensor has a mock or real mode, which lets me develop without hardware attached.

  • ML and advisory backend. A FastAPI service that computes advisories and runs a scikit-learn Random Forest classifier for soil nutrient categories.

  • Shared TypeScript package. UI tokens, types, and derived metric functions, mirrored in Python so both sides calculate the same numbers.

  • Desktop app. A Tauri and React application with a dark terminal aesthetic.

  • Progressive web app. A React app on Vercel that reads Supabase directly, secured with Supabase Auth and row-level security on all core tables.

The Dirt Signal dashboard showing mock readings and advisory status.

Advisory models grounded in research

An alert is only useful if a grower trusts it. Every agronomic threshold in Dirt Signal comes from published literature before it reaches code, and where only Northern Hemisphere data exists, the output carries a label reading "provisional, Northern Hemisphere reference data".

  • Downy mildew, powdery mildew, Botrytis, and frost modules for winegrapes.

  • Irrigation guidance built on the Hargreaves-Samani evapotranspiration model with crop coefficient curves.

  • A growing degree day and E-L stage phenology tracker with forecast projection.

  • Tomato disease modules, used to validate the logic on an earlier indoor testbed.

  • A soil pH target of 6.0 to 7.0 for winegrapes, the only target the current sensor stack can fully evidence.

All advisory modules launched in shadow mode. They calculate and log results without sending notifications, so I can check their behaviour against reality before a grower ever relies on them.

The Roodepoort greenhouse testbed

Software that has never met a real plant proves little. To test Dirt Signal properly, I built a testbed in a commercial greenhouse tunnel and planted Cabernet Sauvignon vines in the native red soil.

Cabernet Sauvignon vines on individual trellises inside the greenhouse tunnel.

  • Soil correction. The native soil measured a pH of about 4.9. I amended each planting hole with compost, dolomitic lime, and bone meal, aiming for 6.0 to 6.5. I chose dolomitic lime for its magnesium content.

  • Trellis design. A two metre ceiling rules out standard vineyard trellis heights, so I set the fruiting wire at 0.9m with catch wires above it and kept clear space below the roof for airflow.

  • Training. I pruned the vines to a single trunk splitting into two cordon arms.

  • Baseline data. The sensors recorded raw soil, amended soil, planting day, and settling periods, which gives the models a documented starting point.

  • Irrigation design. A planned solar-powered ESP32 controller with flow metering, float switches, and solenoid valves, using evapotranspiration to set volume and soil moisture to set timing.

Problems solved along the way

  • The Pi camera library installs through apt, so the Python virtual environment needs the system site packages flag to see it.

  • The systemd service file now links to the repository copy, so deployments cannot drift from the code.

  • Resin printing is the wrong process for a durable outdoor enclosure. Material, build volume, and UV exposure all work against it.

  • Borehole water needs pH and electrical conductivity tests before drip irrigation starts, because alkaline water can undo lime-based soil correction.

What comes next

  • Moving advisory computation to a scheduled Supabase Edge Function so alerts work on a phone without the desktop app open.

  • Fixing a timezone mismatch between backend and frontend day and night evaluation.

  • A full dashboard redesign with a warm Tuscan sunset palette, layered translucent panels, and weather placed prominently on the main screen.

  • Commissioning the solar irrigation controller.

  • Field trials in Cape Winelands vineyard blocks.

  • Entering agritech competitions and developing the work into a research proposal with an academic partner.

Skills demonstrated

Dirt Signal combines embedded systems, sensor electronics, edge machine learning, full-stack development, 3D design, solar power engineering, and applied agronomy. It reflects how I approach AI engineering: start with a real constraint, build on hardware that has to work outdoors, and ground every output in evidence.

Frequently asked questions

What is Dirt Signal?

Dirt Signal is an edge AI platform that monitors soil and plant conditions using a Raspberry Pi and low-cost sensors. It turns readings and weather forecasts into advisories about disease risk, irrigation, frost, and vine growth stage.

Why use edge AI for vineyard monitoring?

Edge processing keeps decisions close to the vines, reduces reliance on constant internet access, and lowers running costs. That matters on rural farms, where connectivity is often patchy.

Which sensors does Dirt Signal use?

The node uses soil temperature, soil moisture, pH, ambient temperature and humidity sensors, an RS485 sensor for nitrogen, phosphorus, and potassium, and a NoIR camera for plant images.

Is Dirt Signal ready for commercial vineyards?

Not yet. The platform is in active development, and its advisory modules run in shadow mode while I validate them on the greenhouse testbed. Field trials in Cape Winelands vineyards are the next stage.

Can I collaborate on or fund Dirt Signal?

Yes. I am looking for viticulture partners, researchers, and agritech programmes interested in low-cost precision agriculture. Get in touch through the contact page to start a conversation.