# steveio/arduino architecture

> Architecture diagram of the GitHub repository steveio/arduino, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/steveio/arduino
- Repository: https://github.com/steveio/arduino

## Overview

This repository is a collection of Arduino/ESP IoT prototypes plus Python weather-data and browser-visualization tools. The documented weather workflow runs from a sensor station through MQTT ingestion and MongoDB to time-series analysis and websocket-provisioned charts; the README also describes standalone automated plant watering. Source excerpts confirm the MQTT subscriber’s database write and the analytics scripts’ roles, but do not show all firmware or dashboard wiring, so those links are documented at README level. The Node.js MQTT-to-websocket relay and hosted chart pages are external to this tree.

Main entry points: [`data/weather`](https://github.com/steveio/arduino/tree/master/data/weather) (Weather files), [`WeatherStation/WeatherStation.ino`](https://github.com/steveio/arduino/blob/master/WeatherStation/WeatherStation.ino) (Weather station), [`weatherMqttClient.py`](https://github.com/steveio/arduino/blob/master/weatherMqttClient.py) (MQTT subscriber), [`weather.py`](https://github.com/steveio/arduino/blob/master/weather.py) (File analytics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_embedded["Embedded prototypes"]
  node_weather_firmware["Weather station<br/>[WeatherStation.ino]"]
  node_plant["Plant watering<br/>[PlantWater.ino]"]
end

subgraph group_ingest["Weather ingestion"]
  node_broker["MQTT broker"]
  node_mqtt_client["MQTT subscriber"]
  node_mongo[("Weather MongoDB")]
end

subgraph group_analysis["Weather analytics"]
  node_file_data[("Weather files")]
  node_file_analysis["File analytics<br/>[weather.py]"]
  node_python_analysis["Time-series analysis<br/>[weather.py]"]
  node_mongo_analysis["Mongo analytics<br/>[weather_mongo.py]"]
end

subgraph group_web["Web visualization"]
  node_relay["MQTT-WebSocket relay"]
  node_gauges["Gauge renderer<br/>[ResponsiveGauge.js]"]
  node_web_clients["Browser charts"]
  node_serial_ws["Serial-WebSocket server"]
end

node_operator(("Operator"))
node_serial_device(("Serial device"))

node_operator -.->|"deploys"| node_weather_firmware
node_weather_firmware -->|"sends readings"| node_broker
node_broker -->|"publishes messages"| node_mqtt_client
node_mqtt_client -->|"writes JSON"| node_mongo
node_mongo -.->|"provides records"| node_mongo_analysis
node_file_data -.->|"loads weather data"| node_file_analysis
node_file_data -.->|"loads weather data"| node_python_analysis
node_file_analysis -->|"plots statistics"| node_operator
node_python_analysis -->|"plots statistics"| node_operator
node_mongo_analysis -->|"plots statistics"| node_operator
node_broker -.->|"relays readings"| node_relay
node_relay -->|"streams weather data"| node_web_clients
node_gauges -.->|"renders gauges"| node_web_clients
node_operator -.->|"configures watering"| node_plant
node_serial_device -->|"streams serial data"| node_serial_ws
node_serial_ws -->|"sends websocket data"| node_web_clients

click node_weather_firmware "https://github.com/steveio/arduino/blob/master/WeatherStation/WeatherStation.ino"
click node_plant "https://github.com/steveio/arduino/blob/master/PlantWater/PlantWater.ino"
click node_mqtt_client "https://github.com/steveio/arduino/blob/master/weatherMqttClient.py"
click node_file_data "https://github.com/steveio/arduino/tree/master/data/weather"
click node_file_analysis "https://github.com/steveio/arduino/blob/master/weather.py"
click node_python_analysis "https://github.com/steveio/arduino/blob/master/python/weather.py"
click node_mongo_analysis "https://github.com/steveio/arduino/blob/master/python/weather_mongo.py"
click node_gauges "https://github.com/steveio/arduino/blob/master/python/ResponsiveGauge.js"
click node_serial_ws "https://github.com/steveio/arduino/blob/master/python/serialToWebsocket.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_weather_firmware,node_plant toneBlue
class node_broker,node_mqtt_client,node_mongo toneAmber
class node_file_data,node_file_analysis,node_python_analysis,node_mongo_analysis toneMint
class node_relay,node_gauges,node_web_clients,node_serial_ws toneRose
class node_operator,node_serial_device toneIndigo
```

## Components

### Embedded prototypes

- [Weather station](https://github.com/steveio/arduino/blob/master/WeatherStation/WeatherStation.ino): `WeatherStation/WeatherStation.ino`
- [Plant watering](https://github.com/steveio/arduino/blob/master/PlantWater/PlantWater.ino): `PlantWater/PlantWater.ino`

### Weather ingestion

- **MQTT broker**
- [MQTT subscriber](https://github.com/steveio/arduino/blob/master/weatherMqttClient.py): `weatherMqttClient.py`
- **Weather MongoDB**

### Weather analytics

- [Weather files](https://github.com/steveio/arduino/tree/master/data/weather): `data/weather`
- [File analytics](https://github.com/steveio/arduino/blob/master/weather.py): `weather.py`
- [Time-series analysis](https://github.com/steveio/arduino/blob/master/python/weather.py): `python/weather.py`
- [Mongo analytics](https://github.com/steveio/arduino/blob/master/python/weather_mongo.py): `python/weather_mongo.py`

### Web visualization

- **MQTT-WebSocket relay**
- [Gauge renderer](https://github.com/steveio/arduino/blob/master/python/ResponsiveGauge.js): `python/ResponsiveGauge.js`
- **Browser charts**
- [Serial-WebSocket server](https://github.com/steveio/arduino/blob/master/python/serialToWebsocket.py): `python/serialToWebsocket.py`

### Other components

- **Operator**
- **Serial device**

## Connections

- Operator → Weather station: deploys
- Weather station → MQTT broker: sends readings (evidence: `README.md`)
- MQTT broker → MQTT subscriber: publishes messages (evidence: `weatherMqttClient.py`)
- MQTT subscriber → Weather MongoDB: writes JSON (evidence: `weatherMqttClient.py`)
- Weather MongoDB → Mongo analytics: provides records
- Weather files → File analytics: loads weather data
- Weather files → Time-series analysis: loads weather data
- File analytics → Operator: plots statistics (evidence: `weather.py`)
- Time-series analysis → Operator: plots statistics (evidence: `python/weather.py`)
- Mongo analytics → Operator: plots statistics (evidence: `python/weather_mongo.py`)
- MQTT broker → MQTT-WebSocket relay: relays readings (evidence: `README.md`)
- MQTT-WebSocket relay → Browser charts: streams weather data (evidence: `README.md`)
- Gauge renderer → Browser charts: renders gauges
- Operator → Plant watering: configures watering (evidence: `README.md`)
- Serial device → Serial-WebSocket server: streams serial data (evidence: `python/serialToWebsocket.py`)
- Serial-WebSocket server → Browser charts: sends websocket data (evidence: `python/serialToWebsocket.py`)
