# ashish4hub/radar_system architecture

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

- Interactive diagram: https://gitdiagram.com/ashish4hub/radar_system
- Repository: https://github.com/ashish4hub/radar_system

## Overview

This is an AVR radar firmware project with a browser dashboard. The principal workflow is firmware initialization and repeated radar control, combining angle sweeps with ultrasonic distance measurement and sending measurements to a web-facing serial bridge for live display. The dashboard server-to-acquisition call and firmware entry point are visible; several firmware orchestration and hardware relationships are only implied by the available headers, so those links are marked unverified. The README is empty, and unsampled dashboard files are represented only where their paths and roles are evident from the tree or server code.

Main entry points: [`app/radar_control.c`](https://github.com/ashish4hub/radar_system/blob/main/app/radar_control.c) (Radar controller), [`radar_dashboard/server.py`](https://github.com/ashish4hub/radar_system/blob/main/radar_dashboard/server.py) (WebSocket server), [`src/obstacle_detection.c`](https://github.com/ashish4hub/radar_system/blob/main/src/obstacle_detection.c) (Obstacle detector), [`src/send_data.c`](https://github.com/ashish4hub/radar_system/blob/main/src/send_data.c) (Measurement TX)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Radar control"]
  node_firmware_entry["Firmware entry<br/>[main.c]"]
  node_radar_controller["Radar controller<br/>[radar_control.c]"]
  node_measurement_tx["Measurement TX<br/>[send_data.c]"]
  node_uart["UART driver<br/>[uart.c]"]
end

subgraph group_sensing["Distance sensing"]
  node_obstacle_detector["Obstacle detector"]
  node_gpio["GPIO driver<br/>[gpio.c]"]
  node_icu["Capture driver<br/>[icu.c]"]
end

subgraph group_motion["Sweep motion"]
  node_timer["Timer driver<br/>[timer.c]"]
  node_sweep["Sweep control<br/>[sweep_control.c]"]
  node_servo["Servo driver<br/>[servo.c]"]
end

subgraph group_dashboard["Dashboard"]
  node_serial_acquisition["Serial acquisition<br/>[radar_data_acq.py]"]
  node_web_server["WebSocket server<br/>[server.py]"]
  node_dashboard_page["Dashboard page<br/>[index.html]"]
  node_radar_ui["Radar UI<br/>[radar.js]"]
end

node_browser_user(("Browser user"))

node_firmware_entry -->|"calls"| node_radar_controller
node_radar_controller -.->|"coordinates"| node_obstacle_detector
node_radar_controller -.->|"coordinates"| node_sweep
node_radar_controller -.->|"dispatches"| node_measurement_tx
node_obstacle_detector -->|"triggers"| node_gpio
node_obstacle_detector -->|"captures"| node_icu
node_sweep -.->|"moves"| node_servo
node_measurement_tx -.->|"transmits"| node_uart
node_web_server -->|"reads measurements"| node_serial_acquisition
node_web_server -.->|"broadcasts data"| node_radar_ui
node_web_server -->|"serves page"| node_dashboard_page
node_browser_user -.->|"connects"| node_web_server
node_browser_user -.->|"views"| node_dashboard_page

click node_firmware_entry "https://github.com/ashish4hub/radar_system/blob/main/main.c"
click node_radar_controller "https://github.com/ashish4hub/radar_system/blob/main/app/radar_control.c"
click node_measurement_tx "https://github.com/ashish4hub/radar_system/blob/main/src/send_data.c"
click node_obstacle_detector "https://github.com/ashish4hub/radar_system/blob/main/src/obstacle_detection.c"
click node_gpio "https://github.com/ashish4hub/radar_system/blob/main/driver/gpio/gpio.c"
click node_icu "https://github.com/ashish4hub/radar_system/blob/main/driver/icu/icu.c"
click node_timer "https://github.com/ashish4hub/radar_system/blob/main/driver/timer/timer.c"
click node_sweep "https://github.com/ashish4hub/radar_system/blob/main/src/sweep_control.c"
click node_servo "https://github.com/ashish4hub/radar_system/blob/main/driver/servo/servo.c"
click node_uart "https://github.com/ashish4hub/radar_system/blob/main/driver/uart/uart.c"
click node_serial_acquisition "https://github.com/ashish4hub/radar_system/blob/main/radar_dashboard/radar_data_acq.py"
click node_web_server "https://github.com/ashish4hub/radar_system/blob/main/radar_dashboard/server.py"
click node_dashboard_page "https://github.com/ashish4hub/radar_system/blob/main/radar_dashboard/index.html"
click node_radar_ui "https://github.com/ashish4hub/radar_system/blob/main/radar_dashboard/static/radar.js"

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_firmware_entry,node_radar_controller,node_measurement_tx,node_uart,node_browser_user toneBlue
class node_obstacle_detector,node_gpio,node_icu toneAmber
class node_timer,node_sweep,node_servo toneMint
class node_serial_acquisition,node_web_server,node_dashboard_page,node_radar_ui toneRose
```

## Components

### Radar control

- [Firmware entry](https://github.com/ashish4hub/radar_system/blob/main/main.c): `main.c`
- [Radar controller](https://github.com/ashish4hub/radar_system/blob/main/app/radar_control.c): `app/radar_control.c`
- [Measurement TX](https://github.com/ashish4hub/radar_system/blob/main/src/send_data.c): `src/send_data.c`
- [UART driver](https://github.com/ashish4hub/radar_system/blob/main/driver/uart/uart.c): `driver/uart/uart.c`

### Distance sensing

- [Obstacle detector](https://github.com/ashish4hub/radar_system/blob/main/src/obstacle_detection.c): `src/obstacle_detection.c`
- [GPIO driver](https://github.com/ashish4hub/radar_system/blob/main/driver/gpio/gpio.c): `driver/gpio/gpio.c`
- [Capture driver](https://github.com/ashish4hub/radar_system/blob/main/driver/icu/icu.c): `driver/icu/icu.c`

### Sweep motion

- [Timer driver](https://github.com/ashish4hub/radar_system/blob/main/driver/timer/timer.c): `driver/timer/timer.c`
- [Sweep control](https://github.com/ashish4hub/radar_system/blob/main/src/sweep_control.c): `src/sweep_control.c`
- [Servo driver](https://github.com/ashish4hub/radar_system/blob/main/driver/servo/servo.c): `driver/servo/servo.c`

### Dashboard

- [Serial acquisition](https://github.com/ashish4hub/radar_system/blob/main/radar_dashboard/radar_data_acq.py): `radar_dashboard/radar_data_acq.py`
- [WebSocket server](https://github.com/ashish4hub/radar_system/blob/main/radar_dashboard/server.py): `radar_dashboard/server.py`
- [Dashboard page](https://github.com/ashish4hub/radar_system/blob/main/radar_dashboard/index.html): `radar_dashboard/index.html`
- [Radar UI](https://github.com/ashish4hub/radar_system/blob/main/radar_dashboard/static/radar.js): `radar_dashboard/static/radar.js`

### Other components

- **Browser user**

## Connections

- Firmware entry → Radar controller: calls (evidence: `main.c`)
- Radar controller → Obstacle detector: coordinates
- Radar controller → Sweep control: coordinates
- Radar controller → Measurement TX: dispatches
- Obstacle detector → GPIO driver: triggers (evidence: `src/obstacle_detection.c`)
- Obstacle detector → Capture driver: captures (evidence: `src/obstacle_detection.c`)
- Sweep control → Servo driver: moves
- Measurement TX → UART driver: transmits
- WebSocket server → Serial acquisition: reads measurements (evidence: `radar_dashboard/server.py`)
- WebSocket server → Radar UI: broadcasts data
- WebSocket server → Dashboard page: serves page (evidence: `radar_dashboard/server.py`)
- Browser user → WebSocket server: connects
- Browser user → Dashboard page: views
