# erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project architecture

> Architecture diagram of the GitHub repository erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project
- Repository: https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project

## Overview

This is a small MicroPython plant-monitoring device: it samples air temperature, air humidity, and soil moisture, converts the soil reading to a percentage, and publishes the measurements to Adafruit IO. The main loop owns Wi-Fi setup, MQTT connection and periodic sampling; mqtt.py implements the MQTT client used to connect and publish. The README also describes dashboard visualization and webhook use, but no corresponding implementation is visible in the supplied files, so these capabilities are not expanded into code components. Edges reflect the excerpts and README; no unsampled source was inspected.

Main entry points: [`main.py`](https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/main.py) (Sampling loop), [`mqtt.py`](https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/mqtt.py) (MQTT client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Sensing"]
  node_dht["DHT11 sensor"]
  node_soil["Soil sensor"]
  node_sampling["Read and normalize<br/>[main.py]"]
end

subgraph group_device["Device connectivity"]
  node_wifi["Wi-Fi connection<br/>[main.py]"]
  node_mainloop["Sampling loop<br/>[main.py]"]
end

subgraph group_transport["MQTT transport"]
  node_mqttclient["MQTT client<br/>[mqtt.py]"]
end

subgraph group_cloud["Cloud monitoring"]
  node_adafruit["Adafruit IO"]
  node_dashboard["Data dashboard"]
end

node_user(("Plant owner"))

node_user -->|"places near plant"| node_dht
node_user -->|"inserts in soil"| node_soil
node_mainloop -->|"connects via"| node_wifi
node_mainloop -->|"calls periodically"| node_sampling
node_sampling -->|"reads"| node_dht
node_sampling -->|"reads"| node_soil
node_mainloop -->|"connects and publishes"| node_mqttclient
node_mqttclient -->|"sends MQTT data"| node_adafruit
node_adafruit -->|"visualizes feeds"| node_dashboard
node_adafruit -->|"shows readings"| node_user

click node_sampling "https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/main.py"
click node_wifi "https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/main.py"
click node_mainloop "https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/main.py"
click node_mqttclient "https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/mqtt.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dht,node_soil,node_sampling toneBlue
class node_wifi,node_mainloop toneAmber
class node_mqttclient toneMint
class node_adafruit,node_dashboard toneRose
class node_user toneIndigo
```

## Components

### Sensing

- **DHT11 sensor**
- **Soil sensor**
- [Read and normalize](https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/main.py): `main.py`

### Device connectivity

- [Wi-Fi connection](https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/main.py): `main.py`
- [Sampling loop](https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/main.py): `main.py`

### MQTT transport

- [MQTT client](https://github.com/erikssonjohannes/humidity-and-temperature-sensors-for-monitoring-plants-iot-project/blob/main/mqtt.py): `mqtt.py`

### Cloud monitoring

- **Adafruit IO**
- **Data dashboard**

### Other components

- **Plant owner**

## Connections

- Plant owner → DHT11 sensor: places near plant (evidence: `README.md`)
- Plant owner → Soil sensor: inserts in soil (evidence: `README.md`)
- Sampling loop → Wi-Fi connection: connects via (evidence: `main.py`)
- Sampling loop → Read and normalize: calls periodically (evidence: `main.py`)
- Read and normalize → DHT11 sensor: reads (evidence: `main.py`)
- Read and normalize → Soil sensor: reads (evidence: `main.py`)
- Sampling loop → MQTT client: connects and publishes (evidence: `main.py`)
- MQTT client → Adafruit IO: sends MQTT data (evidence: `README.md`)
- Adafruit IO → Data dashboard: visualizes feeds (evidence: `README.md`)
- Adafruit IO → Plant owner: shows readings (evidence: `README.md`)
