Plant Monitor

iot pipeline · ml models

Overview

An IoT pipeline that watches my houseplants so I don't have to: ESP32 sensor nodes stream readings into a time-series store, three models turn them into health calls and watering recommendations. It runs on hardware in the house — this page is the write-up.

Architecture

 .–––––––––––––.                  .–––––––––––––––.      .–––––––––––––.
 | 3× esp32    |      mqtt        |  fastapi      |      | timescaledb |
 | 9 sensors   |  ––––––––––––→   |  (async)      | –––→ |             |
 | esp32-cam   |  288+ rdgs/day   |  ingest · api |      | hypertables |
 '–––––––––––––'                  '–––––––––––––––'      '–––––––––––––'
                                          |                     |
                                          ↓                     ↓
                                  .–––––––––––––––––––––––––––––––––.
                                  |  models (weekly retrain)        |
                                  |  · random forest — health class |
                                  |  · lstm — soil moisture t+1     |
                                  |  · ensemble — water / don't     |
                                  '–––––––––––––––––––––––––––––––––'
    

Design notes

  • One camera, many plants: an OpenCV segmentation pass isolates each plant from a single ESP32-CAM feed instead of a camera per pot — cut hardware cost ~67%.
  • Three models share one sensor feature set: a Random Forest for multi-class health classification, an LSTM forecasting soil moisture, and an ensemble that turns both into a watering recommendation.
  • Models retrain weekly on accumulated data, so the system adapts as seasons (and my watering discipline) change.
  • Everything is containerized; the pipeline is the same one I'd build for fleet telemetry, scaled down to a shelf of plants.

Specs

  • hardware3× ESP32 + ESP32-CAM, 9 sensors — soil, temp, humidity, light
  • throughput288+ readings/day over MQTT
  • backendasync FastAPI ingest + API
  • storageTimescaleDB hypertables
  • modelsRandom Forest · LSTM (PyTorch) · ensemble, weekly retraining
  • visionOpenCV plant segmentation from one camera feed
  • deployDocker on homelab hardware