# rorynorbury/eng20009-project-group-3 architecture

> Architecture diagram of the GitHub repository rorynorbury/eng20009-project-group-3, 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/rorynorbury/eng20009-project-group-3
- Repository: https://github.com/rorynorbury/eng20009-project-group-3

## Overview

This is Arduino firmware for an SDI-12 environmental monitoring device. Its command parser handles address queries and changes, measurement requests, data retrieval, and identification; sensor readings also support threshold alerts, an LCD display, and periodic timestamped SD-card logging. The sampled code establishes these module-level relationships, but does not show the main sketch’s runtime dispatch or setup/loop wiring, so those links are omitted.

Main entry points: [`main/command_parser.h`](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/command_parser.h) (Command Parser), [`main/periodic_logging.h`](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/periodic_logging.h) (Periodic Logging), [`main/sensors.h`](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/sensors.h) (Sensor Acquisition), [`main/LCD.h`](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/LCD.h) (LCD Display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commands["SDI-12 Commands"]
  node_parser["Command Parser<br/>[command_parser.h]"]
  node_address["Address Handling"]
  node_measurement["Measurement Response"]
  node_data["Data Response<br/>[send_data.h]"]
  node_identification["Identification Response"]
end

subgraph group_sensing["Sensing and Alerts"]
  node_sensors["Sensor Acquisition<br/>[sensors.h]"]
  node_thresholds["Threshold Alerts<br/>[threshold_alert.h]"]
end

subgraph group_logging["Time and Logging"]
  node_rtc["RTC Clock<br/>[rtc.h]"]
  node_periodic["Periodic Logging<br/>[periodic_logging.h]"]
  node_sd_logging["SD-card Logging<br/>[sd_card_logging.h]"]
end

subgraph group_display["Device Display"]
  node_lcd["LCD Display<br/>[LCD.h]"]
end

node_host(("SDI-12 Host"))
node_sensor_hardware{{"Environmental Sensors"}}
node_sd_card[("SD Card")]
node_display_hardware["TFT Display"]

node_parser -->|"dispatches"| node_address
node_parser -->|"dispatches"| node_measurement
node_parser -->|"dispatches"| node_data
node_parser -->|"dispatches"| node_identification
node_measurement -->|"reads"| node_sensors
node_thresholds -->|"checks state"| node_sensors
node_periodic -->|"reads"| node_sensors
node_periodic -->|"gets time"| node_rtc
node_periodic -->|"writes log"| node_sd_logging
node_sd_logging -->|"writes"| node_sd_card
node_lcd -->|"uses alert flags"| node_thresholds
node_lcd -->|"updates"| node_display_hardware

click node_parser "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/command_parser.h"
click node_address "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/query_and_address.h"
click node_measurement "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/start_measurement.h"
click node_data "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/send_data.h"
click node_identification "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/send_identification.h"
click node_sensors "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/sensors.h"
click node_thresholds "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/threshold_alert.h"
click node_rtc "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/rtc.h"
click node_periodic "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/periodic_logging.h"
click node_sd_logging "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/sd_card_logging.h"
click node_lcd "https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/LCD.h"

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_parser,node_address,node_measurement,node_data,node_identification toneBlue
class node_sensors,node_thresholds,node_sd_card toneAmber
class node_rtc,node_periodic,node_sd_logging toneMint
class node_lcd toneRose
class node_host,node_sensor_hardware,node_display_hardware toneIndigo
```

## Components

### SDI-12 Commands

- [Command Parser](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/command_parser.h): `main/command_parser.h`
- [Address Handling](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/query_and_address.h): `main/query_and_address.h`
- [Measurement Response](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/start_measurement.h): `main/start_measurement.h`
- [Data Response](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/send_data.h): `main/send_data.h`
- [Identification Response](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/send_identification.h): `main/send_identification.h`

### Sensing and Alerts

- [Sensor Acquisition](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/sensors.h): `main/sensors.h`
- [Threshold Alerts](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/threshold_alert.h): `main/threshold_alert.h`

### Time and Logging

- [RTC Clock](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/rtc.h): `main/rtc.h`
- [Periodic Logging](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/periodic_logging.h): `main/periodic_logging.h`
- [SD-card Logging](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/sd_card_logging.h): `main/sd_card_logging.h`

### Device Display

- [LCD Display](https://github.com/rorynorbury/eng20009-project-group-3/blob/main/main/LCD.h): `main/LCD.h`

### Other components

- **SDI-12 Host**
- **Environmental Sensors**
- **SD Card**
- **TFT Display**

## Connections

- Command Parser → Address Handling: dispatches (evidence: `main/command_parser.h`)
- Command Parser → Measurement Response: dispatches (evidence: `main/command_parser.h`)
- Command Parser → Data Response: dispatches (evidence: `main/command_parser.h`)
- Command Parser → Identification Response: dispatches (evidence: `main/command_parser.h`)
- Measurement Response → Sensor Acquisition: reads (evidence: `main/start_measurement.h`)
- Threshold Alerts → Sensor Acquisition: checks state (evidence: `main/threshold_alert.h`)
- Periodic Logging → Sensor Acquisition: reads (evidence: `main/periodic_logging.h`)
- Periodic Logging → RTC Clock: gets time (evidence: `main/periodic_logging.h`)
- Periodic Logging → SD-card Logging: writes log (evidence: `main/periodic_logging.h`)
- SD-card Logging → SD Card: writes (evidence: `main/sd_card_logging.h`)
- LCD Display → Threshold Alerts: uses alert flags (evidence: `main/LCD.h`)
- LCD Display → TFT Display: updates (evidence: `main/LCD.h`)
