# akshpatel3110/cs321- architecture

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

- Interactive diagram: https://gitdiagram.com/akshpatel3110/cs321-
- Repository: https://github.com/akshpatel3110/cs321-

## Overview

This repository implements an onboard environmental-telemetry transmitter and a ground receiver, with separate Python simulation and telemetry-logging scripts. The main hardware workflow initializes sensors and radio, samples measurements, formats a telemetry record, transmits it, and displays readings at both ends. SD-card logging is implemented but its write call is commented out in the transmitter loop. The graph follows the sampled firmware; the Python scripts are indexed as read, but their contents were not provided, so their behavior and connections are not inferred.

Main entry points: [`hardware_interfacing/on_board_transmitter/src/main.cpp`](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/src/main.cpp) (Transmitter loop), [`hardware_interfacing/ground_receiver/lib/lora_sx1276/lora_sx1276.cpp`](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/ground_receiver/lib/lora_sx1276/lora_sx1276.cpp) (Receive radio), [`hardware_interfacing/ground_receiver/src/main.cpp`](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/ground_receiver/src/main.cpp) (Receiver loop), [`hardware_interfacing/on_board_transmitter/lib/lora_sx1276/lora_sx1276.cpp`](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/lora_sx1276/lora_sx1276.cpp) (Transmit radio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_onboard["Onboard telemetry"]
  node_transmitter["Transmitter loop<br/>[main.cpp]"]
  node_transmitter_radio["Transmit radio<br/>[lora_sx1276.cpp]"]
  node_sd_logging["SD logging<br/>[sd_card.cpp]"]
end

subgraph group_receiver["Ground receiver"]
  node_receiver_loop["Receiver loop<br/>[main.cpp]"]
  node_receiver_radio["Receive radio<br/>[lora_sx1276.cpp]"]
end

subgraph group_shared["Hardware interfaces"]
  node_temperature_humidity["Temperature humidity<br/>[shtc3.cpp]"]
  node_motion_sensor["Motion sensor<br/>[mpu6050_A.cpp]"]
  node_pressure_sensor["Pressure sensor<br/>[bmp390.cpp]"]
  node_transmitter_display["Transmitter display<br/>[ssd1306.cpp]"]
  node_receiver_display["Receiver display<br/>[ssd1306.cpp]"]
end

subgraph group_python["Python utilities"]
  node_simulator["Launch simulator"]
  node_telemetry_logger["Telemetry logger"]
  node_telemetry_script["Telemetry script<br/>[telemetry.py]"]
end

node_radio_link{{"LoRa radio link"}}

node_transmitter -->|"reads"| node_temperature_humidity
node_transmitter -->|"reads"| node_motion_sensor
node_transmitter -->|"reads"| node_pressure_sensor
node_transmitter -->|"transmits record"| node_transmitter_radio
node_transmitter -->|"updates display"| node_transmitter_display
node_transmitter -->|"initializes"| node_sd_logging
node_transmitter_radio -.->|"sends packets"| node_radio_link
node_radio_link -.->|"delivers packets"| node_receiver_radio
node_receiver_loop -->|"receives"| node_receiver_radio
node_receiver_loop -->|"updates display"| node_receiver_display
node_receiver_radio -->|"shows received data"| node_receiver_display

click node_transmitter "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/src/main.cpp"
click node_temperature_humidity "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/shtc3/shtc3.cpp"
click node_motion_sensor "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/mpu6050_A/mpu6050_A.cpp"
click node_pressure_sensor "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/bmp390/bmp390.cpp"
click node_transmitter_radio "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/lora_sx1276/lora_sx1276.cpp"
click node_sd_logging "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/sd_card/sd_card.cpp"
click node_transmitter_display "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/ssd1306/ssd1306.cpp"
click node_receiver_loop "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/ground_receiver/src/main.cpp"
click node_receiver_radio "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/ground_receiver/lib/lora_sx1276/lora_sx1276.cpp"
click node_receiver_display "https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/ground_receiver/lib/ssd1306/ssd1306.cpp"
click node_simulator "https://github.com/akshpatel3110/cs321-/blob/main/Arav%20work/launch_controller_sim.py"
click node_telemetry_logger "https://github.com/akshpatel3110/cs321-/blob/main/Arav%20work/telemetry_logger.py"
click node_telemetry_script "https://github.com/akshpatel3110/cs321-/blob/main/Aksh_Work/telemetry.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_transmitter,node_transmitter_radio,node_sd_logging toneBlue
class node_receiver_loop,node_receiver_radio toneAmber
class node_temperature_humidity,node_motion_sensor,node_pressure_sensor,node_transmitter_display,node_receiver_display toneMint
class node_simulator,node_telemetry_logger,node_telemetry_script toneRose
class node_radio_link toneIndigo
```

## Components

### Onboard telemetry

- [Transmitter loop](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/src/main.cpp): `hardware_interfacing/on_board_transmitter/src/main.cpp`
- [Transmit radio](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/lora_sx1276/lora_sx1276.cpp): `hardware_interfacing/on_board_transmitter/lib/lora_sx1276/lora_sx1276.cpp`
- [SD logging](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/sd_card/sd_card.cpp): `hardware_interfacing/on_board_transmitter/lib/sd_card/sd_card.cpp`

### Ground receiver

- [Receiver loop](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/ground_receiver/src/main.cpp): `hardware_interfacing/ground_receiver/src/main.cpp`
- [Receive radio](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/ground_receiver/lib/lora_sx1276/lora_sx1276.cpp): `hardware_interfacing/ground_receiver/lib/lora_sx1276/lora_sx1276.cpp`

### Hardware interfaces

- [Temperature humidity](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/shtc3/shtc3.cpp): `hardware_interfacing/on_board_transmitter/lib/shtc3/shtc3.cpp`
- [Motion sensor](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/mpu6050_A/mpu6050_A.cpp): `hardware_interfacing/on_board_transmitter/lib/mpu6050_A/mpu6050_A.cpp`
- [Pressure sensor](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/bmp390/bmp390.cpp): `hardware_interfacing/on_board_transmitter/lib/bmp390/bmp390.cpp`
- [Transmitter display](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/on_board_transmitter/lib/ssd1306/ssd1306.cpp): `hardware_interfacing/on_board_transmitter/lib/ssd1306/ssd1306.cpp`
- [Receiver display](https://github.com/akshpatel3110/cs321-/blob/main/hardware_interfacing/ground_receiver/lib/ssd1306/ssd1306.cpp): `hardware_interfacing/ground_receiver/lib/ssd1306/ssd1306.cpp`

### Python utilities

- [Launch simulator](https://github.com/akshpatel3110/cs321-/blob/main/Arav%20work/launch_controller_sim.py): `Arav work/launch_controller_sim.py`
- [Telemetry logger](https://github.com/akshpatel3110/cs321-/blob/main/Arav%20work/telemetry_logger.py): `Arav work/telemetry_logger.py`
- [Telemetry script](https://github.com/akshpatel3110/cs321-/blob/main/Aksh_Work/telemetry.py): `Aksh_Work/telemetry.py`

### Other components

- **LoRa radio link**

## Connections

- Transmitter loop → Temperature humidity: reads (evidence: `hardware_interfacing/on_board_transmitter/src/main.cpp`)
- Transmitter loop → Motion sensor: reads (evidence: `hardware_interfacing/on_board_transmitter/src/main.cpp`)
- Transmitter loop → Pressure sensor: reads (evidence: `hardware_interfacing/on_board_transmitter/src/main.cpp`)
- Transmitter loop → Transmit radio: transmits record (evidence: `hardware_interfacing/on_board_transmitter/src/main.cpp`)
- Transmitter loop → Transmitter display: updates display (evidence: `hardware_interfacing/on_board_transmitter/src/main.cpp`)
- Transmitter loop → SD logging: initializes (evidence: `hardware_interfacing/on_board_transmitter/src/main.cpp`)
- Transmit radio → LoRa radio link: sends packets
- LoRa radio link → Receive radio: delivers packets
- Receiver loop → Receive radio: receives (evidence: `hardware_interfacing/ground_receiver/src/main.cpp`)
- Receiver loop → Receiver display: updates display (evidence: `hardware_interfacing/ground_receiver/src/main.cpp`)
- Receive radio → Receiver display: shows received data (evidence: `hardware_interfacing/ground_receiver/lib/lora_sx1276/lora_sx1276.cpp`)
