# vishnu7332/aquasentinel architecture

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

- Interactive diagram: https://gitdiagram.com/vishnu7332/aquasentinel
- Repository: https://github.com/vishnu7332/aquasentinel

## Overview

AquaSentinel is a water-monitoring project whose apparent main workflow is sensor acquisition, LoRa transfer, serial gateway ingestion, Firebase storage, and dashboard presentation. The tree also contains standalone sensor experiments and motor-control sketches, suggesting adjacent hardware prototypes. Only the gateway and Flask/serial service were excerpted; the firmware, dashboards, and their wiring are not verified. Dashed edges mark those inferred connections, while the gateway’s serial read and Firebase write are supported by its excerpt.

Main entry points: [`Lora_Receiver/Lora_Receiver.ino`](https://github.com/vishnu7332/aquasentinel/blob/main/Lora_Receiver/Lora_Receiver.ino) (LoRa Receiver), [`aqua/gateway.py`](https://github.com/vishnu7332/aquasentinel/blob/main/aqua/gateway.py) (Serial Gateway), [`Lora_Transmitter/Lora_Transmitter.ino`](https://github.com/vishnu7332/aquasentinel/blob/main/Lora_Transmitter/Lora_Transmitter.ino) (LoRa Transmitter), [`aqua/lora.py`](https://github.com/vishnu7332/aquasentinel/blob/main/aqua/lora.py) (LoRa HTTP Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Water Sensing"]
  node_integrated_sensors["Integrated Sensors"]
  node_sensor_prototypes["Sensor Prototypes<br/>[PH.ino]"]
end

subgraph group_radio["Radio Transport"]
  node_lora_tx["LoRa Transmitter"]
  node_lora_rx["LoRa Receiver<br/>[Lora_Receiver.ino]"]
end

subgraph group_ingest["Gateway and Storage"]
  node_gateway["Serial Gateway<br/>[gateway.py]"]
  node_firebase[("Firebase Database")]
  node_http_service["LoRa HTTP Service<br/>[lora.py]"]
end

subgraph group_views["Monitoring Interfaces"]
  node_dashboard["Water Dashboard<br/>[dash.html]"]
  node_sensor_view["Sensor View<br/>[sensor.html]"]
  node_ui_view["UI View<br/>[ui.html]"]
end

subgraph group_control["Hardware Controls"]
  node_motor_controls["Motor Controls<br/>[BO_Motor.ino]"]
end

node_operator(("Operator"))

node_integrated_sensors -.->|"sends readings"| node_lora_tx
node_lora_tx -.->|"transmits readings"| node_lora_rx
node_lora_rx -.->|"serial data"| node_gateway
node_gateway -->|"writes readings"| node_firebase
node_gateway -->|"reads serial"| node_lora_rx
node_http_service -->|"reads serial"| node_lora_rx
node_operator -.->|"requests data"| node_http_service
node_operator -.->|"views status"| node_dashboard
node_operator -.->|"views readings"| node_sensor_view
node_operator -.->|"uses interface"| node_ui_view

click node_integrated_sensors "https://github.com/vishnu7332/aquasentinel/blob/main/Sensor_integ_Tran/Sensor_integ_Tran_1.2/Sensor_integ_Tran_1.2.ino"
click node_sensor_prototypes "https://github.com/vishnu7332/aquasentinel/blob/main/PH/PH.ino"
click node_lora_tx "https://github.com/vishnu7332/aquasentinel/blob/main/Lora_Transmitter/Lora_Transmitter.ino"
click node_lora_rx "https://github.com/vishnu7332/aquasentinel/blob/main/Lora_Receiver/Lora_Receiver.ino"
click node_gateway "https://github.com/vishnu7332/aquasentinel/blob/main/aqua/gateway.py"
click node_http_service "https://github.com/vishnu7332/aquasentinel/blob/main/aqua/lora.py"
click node_dashboard "https://github.com/vishnu7332/aquasentinel/blob/main/aqua/dash.html"
click node_sensor_view "https://github.com/vishnu7332/aquasentinel/blob/main/aqua/sensor.html"
click node_ui_view "https://github.com/vishnu7332/aquasentinel/blob/main/aqua/ui.html"
click node_motor_controls "https://github.com/vishnu7332/aquasentinel/blob/main/BO_Motor/BO_Motor.ino"

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_integrated_sensors,node_sensor_prototypes toneBlue
class node_lora_tx,node_lora_rx toneAmber
class node_gateway,node_firebase,node_http_service toneMint
class node_dashboard,node_sensor_view,node_ui_view toneRose
class node_motor_controls,node_operator toneIndigo
```

## Components

### Water Sensing

- [Integrated Sensors](https://github.com/vishnu7332/aquasentinel/blob/main/Sensor_integ_Tran/Sensor_integ_Tran_1.2/Sensor_integ_Tran_1.2.ino): `Sensor_integ_Tran/Sensor_integ_Tran_1.2/Sensor_integ_Tran_1.2.ino`
- [Sensor Prototypes](https://github.com/vishnu7332/aquasentinel/blob/main/PH/PH.ino): `PH/PH.ino`

### Radio Transport

- [LoRa Transmitter](https://github.com/vishnu7332/aquasentinel/blob/main/Lora_Transmitter/Lora_Transmitter.ino): `Lora_Transmitter/Lora_Transmitter.ino`
- [LoRa Receiver](https://github.com/vishnu7332/aquasentinel/blob/main/Lora_Receiver/Lora_Receiver.ino): `Lora_Receiver/Lora_Receiver.ino`

### Gateway and Storage

- [Serial Gateway](https://github.com/vishnu7332/aquasentinel/blob/main/aqua/gateway.py): `aqua/gateway.py`
- **Firebase Database**
- [LoRa HTTP Service](https://github.com/vishnu7332/aquasentinel/blob/main/aqua/lora.py): `aqua/lora.py`

### Monitoring Interfaces

- [Water Dashboard](https://github.com/vishnu7332/aquasentinel/blob/main/aqua/dash.html): `aqua/dash.html`
- [Sensor View](https://github.com/vishnu7332/aquasentinel/blob/main/aqua/sensor.html): `aqua/sensor.html`
- [UI View](https://github.com/vishnu7332/aquasentinel/blob/main/aqua/ui.html): `aqua/ui.html`

### Hardware Controls

- [Motor Controls](https://github.com/vishnu7332/aquasentinel/blob/main/BO_Motor/BO_Motor.ino): `BO_Motor/BO_Motor.ino`

### Other components

- **Operator**

## Connections

- Integrated Sensors → LoRa Transmitter: sends readings
- LoRa Transmitter → LoRa Receiver: transmits readings
- LoRa Receiver → Serial Gateway: serial data
- Serial Gateway → Firebase Database: writes readings (evidence: `aqua/gateway.py`)
- Serial Gateway → LoRa Receiver: reads serial (evidence: `aqua/gateway.py`)
- LoRa HTTP Service → LoRa Receiver: reads serial (evidence: `aqua/lora.py`)
- Operator → LoRa HTTP Service: requests data
- Operator → Water Dashboard: views status
- Operator → Sensor View: views readings
- Operator → UI View: uses interface
