# kharkiveducationaccount/automatedgreenhousesimulator architecture

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

- Interactive diagram: https://gitdiagram.com/kharkiveducationaccount/automatedgreenhousesimulator
- Repository: https://github.com/kharkiveducationaccount/automatedgreenhousesimulator

## Overview

This is a small greenhouse sensor simulator that samples sensor values and publishes JSON readings to an MQTT broker. Its principal workflow is configured in Program.cs: create sensors and topic/unit settings, read each sensor, serialize a reading, then publish it. Greenhouse also models sensor monitoring and irrigation/ventilation systems, but the excerpts do not show those systems controlling the simulation or being activated. The graph reflects the shown calls; MQTT is the only external integration evidenced.

Main entry points: [`AutomatedGreenhouseSimulator/Program.cs`](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Program.cs) (Simulation runner), [`AutomatedGreenhouseSimulator/Greenhouse.cs`](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Greenhouse.cs) (Greenhouse monitor), [`AutomatedGreenhouseSimulator/TemperatureSensor.cs`](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/TemperatureSensor.cs) (Temperature sensor), [`AutomatedGreenhouseSimulator/Sensor.cs`](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Sensor.cs) (Sensor base)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Simulation runtime"]
  node_program["Simulation runner<br/>[Program.cs]"]
  node_configuration["Sensor configuration"]
end

subgraph group_sensing["Sensor model"]
  node_sensor["Sensor base<br/>[Sensor.cs]"]
  node_temperature["Temperature sensor"]
  node_humidity["Humidity sensor<br/>[HumiditySensor.cs]"]
end

subgraph group_controls["Greenhouse controls"]
  node_greenhouse["Greenhouse monitor<br/>[Greenhouse.cs]"]
  node_ventilation["Ventilation system"]
  node_irrigation["Irrigation system"]
end

node_broker(("MQTT broker"))

node_program -->|"creates settings"| node_configuration
node_program -->|"creates sensors"| node_temperature
node_program -->|"reads configured sensors"| node_configuration
node_program -->|"requests readings"| node_temperature
node_program -->|"connects and publishes"| node_broker
node_temperature -->|"extends"| node_sensor
node_humidity -->|"extends"| node_sensor
node_greenhouse -->|"reads sensors"| node_sensor
node_greenhouse -->|"creates system"| node_ventilation
node_greenhouse -->|"creates system"| node_irrigation

click node_program "https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Program.cs"
click node_configuration "https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Mqtt/SensorConfiguration.cs"
click node_sensor "https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Sensor.cs"
click node_temperature "https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/TemperatureSensor.cs"
click node_humidity "https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/HumiditySensor.cs"
click node_greenhouse "https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Greenhouse.cs"
click node_ventilation "https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Systems/VentilationSystem.cs"
click node_irrigation "https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Systems/IrrigationSystem.cs"

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_program,node_configuration toneBlue
class node_sensor,node_temperature,node_humidity toneAmber
class node_greenhouse,node_ventilation,node_irrigation toneMint
class node_broker toneIndigo
```

## Components

### Simulation runtime

- [Simulation runner](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Program.cs): `AutomatedGreenhouseSimulator/Program.cs`
- [Sensor configuration](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Mqtt/SensorConfiguration.cs): `AutomatedGreenhouseSimulator/Mqtt/SensorConfiguration.cs`

### Sensor model

- [Sensor base](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Sensor.cs): `AutomatedGreenhouseSimulator/Sensor.cs`
- [Temperature sensor](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/TemperatureSensor.cs): `AutomatedGreenhouseSimulator/TemperatureSensor.cs`
- [Humidity sensor](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/HumiditySensor.cs): `AutomatedGreenhouseSimulator/HumiditySensor.cs`

### Greenhouse controls

- [Greenhouse monitor](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Greenhouse.cs): `AutomatedGreenhouseSimulator/Greenhouse.cs`
- [Ventilation system](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Systems/VentilationSystem.cs): `AutomatedGreenhouseSimulator/Systems/VentilationSystem.cs`
- [Irrigation system](https://github.com/kharkiveducationaccount/automatedgreenhousesimulator/blob/master/AutomatedGreenhouseSimulator/Systems/IrrigationSystem.cs): `AutomatedGreenhouseSimulator/Systems/IrrigationSystem.cs`

### Other components

- **MQTT broker**

## Connections

- Simulation runner → Sensor configuration: creates settings (evidence: `AutomatedGreenhouseSimulator/Program.cs`)
- Simulation runner → Temperature sensor: creates sensors (evidence: `AutomatedGreenhouseSimulator/Program.cs`)
- Simulation runner → Sensor configuration: reads configured sensors (evidence: `AutomatedGreenhouseSimulator/Program.cs`)
- Simulation runner → Temperature sensor: requests readings (evidence: `AutomatedGreenhouseSimulator/Program.cs`)
- Simulation runner → MQTT broker: connects and publishes (evidence: `AutomatedGreenhouseSimulator/Program.cs`)
- Temperature sensor → Sensor base: extends (evidence: `AutomatedGreenhouseSimulator/TemperatureSensor.cs`)
- Humidity sensor → Sensor base: extends (evidence: `AutomatedGreenhouseSimulator/HumiditySensor.cs`)
- Greenhouse monitor → Sensor base: reads sensors (evidence: `AutomatedGreenhouseSimulator/Greenhouse.cs`)
- Greenhouse monitor → Ventilation system: creates system (evidence: `AutomatedGreenhouseSimulator/Greenhouse.cs`)
- Greenhouse monitor → Irrigation system: creates system (evidence: `AutomatedGreenhouseSimulator/Greenhouse.cs`)
