System Summary

The greenhouse continuously measures temperature, humidity, and light intensity and streams telemetry to the cloud. It also receives tuning commands remotely (setpoints, ranges, hysteresis, persistence) and applies them safely to the local control behavior.

  • Sensors: SHT31 (temperature/humidity), BH1750 (lux) via I²C
  • Local UI: OLED status + menu navigation with rotary encoder
  • Remote monitoring: MQTT → Node-RED → InfluxDB → Grafana dashboards
  • Remote control: bidirectional configuration updates via MQTT
Prototype device photo

Firmware Architecture (FreeRTOS)

The firmware is structured as independent FreeRTOS tasks rather than a single main loop. To keep the system deterministic and merge-friendly in a team environment, tasks communicate using queue-based structured messages instead of sharing global variables directly.

  • Sensors Task: reads I²C sensors, publishes environment data
  • Display/UI Task: renders OLED UI, handles encoder input
  • Logic Task: applies rules based on setpoints + hysteresis + persistence
  • MQTT/Radio Task: publishes telemetry and receives configuration commands
High-level data flow
  • Sensors Task → Environment Queue → Display Task + Logic Task
  • MQTT Task → Config Queue → Logic Task (+ UI updates)
  • MQTT → Node-RED → InfluxDB → Grafana
Software architecture figure

Integration Challenges

A major part of this project was real-world integration across modules and teammates. Common issues included I²C/library conflicts, timing/latency between tasks, and Git merge conflicts when components evolved in parallel. The queue-based architecture reduced race conditions and helped keep module interfaces clean.

  • I²C stability and library compatibility during integration
  • Task timing coordination (sampling, UI refresh, MQTT latency)
  • Team merges: interface mismatches and conflict resolution
Grafana dashboard screenshot

Tech Stack

Embedded

ESP32-S3 (Heltec WiFi LoRa 32 V3), C/C++, FreeRTOS, GPIO, I²C

Sensors & UI

SHT31, BH1750, OLED display, rotary encoder

Cloud & Monitoring

MQTT, Node-RED, InfluxDB, Grafana dashboards