Back to articles
Gardening

Automating the Garden (Work in Progress)

Designing an offline-first IoT system for garden monitoring and automation with sensors, actuators, and anomaly detection.

December 15, 20254 min read
iotsensorsautomationraspberry-piesp32
Share:
Automating the Garden (Work in Progress)

Wanting good food led to cooking. Cooking led to wanting better ingredients. Better ingredients led to growing my own food. And growing food efficiently requires monitoring: soil moisture, temperature, light levels, humidity. Manual checks are tedious and easy to forget.

This is the story of Tendrilio: an offline-first garden automation system currently in development.

The Problem with Commercial Solutions

Smart garden products exist, but they share common flaws:

  1. Cloud Dependency: No internet = no monitoring
  2. Subscriptions: Monthly fees for your own data
  3. Vendor Lock-In: Proprietary sensors, apps, and protocols
  4. Limited Customization: Can't add sensors they don't sell
  5. Privacy Concerns: Your growing patterns aren't their business

I wanted something that:

  • Works offline (greenhouses often have poor WiFi)
  • Uses standard hardware (ESP32, common sensors)
  • Stores data locally (my data, my server)
  • Scales from one sensor to dozens
  • Automates responses (if dry, irrigate)

Architecture Design

Tendrilio Architecture Diagram

System Components

Central Dashboard

A Raspberry Pi runs the entire control plane:

  • Frontend: React dashboard accessible from any device
  • Backend: FastAPI handling API requests and MQTT messages
  • Broker: Mosquitto for sensor communication
  • Database: SQLite for historical data (simple, reliable, portable)

Sensor Nodes

ESP32 microcontrollers placed throughout the garden:

  • Cheap (~$5 each)
  • WiFi built-in
  • Low power (solar viable)
  • Arduino-compatible

Configured ESP32

Each node publishes readings to MQTT topics like tendrilio/zone1/soil_moisture.

Supported Sensors

Sensor TypeUse Case
Soil MoistureIrrigation triggers
TemperatureFrost alerts, ventilation
HumidityDisease prevention

Key Features

Device Provisioning

New sensors shouldn't require command-line setup. The dashboard includes a USB provisioning wizard:

  1. Plug in the new ESP32
  2. Dashboard detects it automatically
  3. Configure WiFi credentials and sensor type
  4. Flash firmware
  5. Done. The sensor appears in the dashboard.

Provisioning Wizard Screenshot

Configured ESP32

Automation Rules

Simple condition-action rules:

IF zone1.soil_moisture < 30%
AND NOT rain_expected_24h
AND current_hour BETWEEN 6 AND 8
THEN activate_irrigation(zone1, duration=10min)
COOLDOWN 4 hours

Rules support:

  • Multiple conditions (AND/OR)
  • Time windows
  • Cooldown periods (prevent oscillation)
  • Conflict resolution (don't irrigate during rain)

Anomaly Detection

Sensors fail. Wires get chewed by critters. Statistical analysis helps catch problems:

  • Z-score analysis of readings
  • Health scores per sensor
  • Alerts when values are statistically unlikely

If a moisture sensor suddenly reads 0% when others read 40%, something's wrong.

Data Export

All historical data is exportable as CSV or JSON. Your data isn't trapped.

Current Status

Software: Largely complete

  • 18,000+ lines of code
  • Full dashboard implementation
  • Backend API with 18 route modules
  • Firmware for ESP32, ESP8266, and Raspberry Pi Pico W

Hardware: In progress

  • Deciding which sensors to prioritize
  • A few more microcontrollers to select and order
  • Sensors pre-selected but not yet ordered
  • 3D-printed enclosures would be ideal, but no printer available yet

Next Steps:

  1. Assemble first sensor nodes
  2. Deploy in test environment
  3. Calibration and tuning
  4. Long-term reliability testing
  5. Solar power integration

Looking Forward

Once the hardware arrives and testing begins, I'll share:

  • Sensor calibration procedures
  • Enclosure designs
  • Power consumption measurements
  • Reliability data

The code will be open source once the MVP is ready and initial testing is complete.

The goal is a complete, documented system that anyone can deploy: no vendor lock-in, no subscriptions, no cloud dependency. I hope to collaborate with fellow gardening enthusiasts and build a solution that truly empowers people to grow their own food efficiently.

Growing food is ancient. The automation just makes it easier. Let's grow real food, not backyard grass.

FullStackGrower

Appearance

Connect