René Cano
All projects

No. 13

IoT plant monitoring

Temperature and humidity with ESP8266 and MQTT

My role
Repository author
Period
Dec 2025

The problem

I wanted to monitor the temperature and humidity of several plants with cheap hardware and see the readings in near real time from the browser.

What I built

I published the project on December 6, 2025, in 3 commits.

  • Firmware for an ESP8266 with a DHT11 sensor: it joins the Wi-Fi and every 3 s publishes a JSON message with temperature and humidity to an MQTT topic for each plant.
  • A Python receiver (paho-mqtt) subscribed to every plant that stores each reading with its timestamp in SQLite.
  • A Flask server with an endpoint that returns the last 30 readings for each of the 3 plants.
  • A Chart.js dashboard that refreshes every 2 s and shows a status card per plant.

Architecture

Data flow diagram: a DHT11 sensor wired to an ESP8266 publishes temperature and humidity every 3 s over MQTT to a broker on the local network; a Python receiver subscribed to every plant stores each reading in SQLite; a Flask server returns the last 30 readings per plant and a Chart.js dashboard plots them, refreshing every 2 s.

Results

It's a local-network prototype. There are no metrics and no log of readings in the repository.

Known limits

  • The broker's IP is hardcoded in the firmware and the receiver, and the names of the 3 plants are hardcoded in the server.
  • The Wi-Fi credentials are compiled into the firmware, and neither MQTT nor Flask has authentication; MQTT doesn't use TLS either.
  • Each reading's timestamp is the time it reaches the receiver, not when it was measured.
  • There are no tests, and the README documents a /data route that is /api/data in the code.

Links