# bishnu-subedi/xbee-based-serial-communication-using-arduino- architecture

> Architecture diagram of the GitHub repository bishnu-subedi/xbee-based-serial-communication-using-arduino-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bishnu-subedi/xbee-based-serial-communication-using-arduino-
- Repository: https://github.com/bishnu-subedi/xbee-based-serial-communication-using-arduino-

## Overview

##### Project type and purpose
- This is an embedded-systems communication project using Arduino and Digi XBee modules.
- It consists of two C programs: Transmission.c (sends data) and Reception.c (receives data).
- The goal is to demonstrate simple UART-based serial communication over wireless (XBee) links.

##### Main components
a. Hardware nodes
- Arduino Uno #1 running Transmission.c
- XBee radio module #1 (connected via UART to Arduino #1)
- Arduino Uno #2 running Reception.c
- XBee radio module #2 (connected via UART to Arduino #2)
- (Optional) A host PC or serial monitor connected via USB to either Arduino for debugging/logging
b. Communication channels
- UART link between each Arduino and its attached XBee module
- Wireless (RF) link between the two XBee modules
- USB link between Arduino and host PC (for logging or control)

##### Relationships and data flows
- On the transmitter side:
- Sensor or data source → Transmission.c on Arduino → UART TX → XBee module → RF → remote XBee
- On the receiver side:
- RF → XBee module → UART RX → Reception.c on Arduino → output (e.g., Serial Monitor/LED)
- If a PC is connected: Arduino ⇄ USB serial port ⇄ PC

##### Architectural patterns and design principles
- Separation of concerns:
- Firmware (Transmission.c / Reception.c) focuses on UART read/write and application-level logic
- XBee modules handle the wireless PHY/MAC transparently (AT mode or API mode)
- Clear layering:
- Hardware layer (Arduino MCU, XBee radio)
- Firmware layer (microcontroller code)
- (Optional) User interface layer (serial monitor on PC)
- Simple pipeline processing: read → package → transmit → receive → process

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Transmitter Node
    subgraph "Transmitter Node"
        direction TB
        Arduino1["Arduino Uno #1"]:::hardware
        Transmission["Transmission.c"]:::firmware
        XBee1["XBee Pro S2C #1"]:::hardware
    end

    %% Receiver Node
    subgraph "Receiver Node"
        direction TB
        XBee2["XBee Pro S2C #2"]:::hardware
        Reception["Reception.c"]:::firmware
        Arduino2["Arduino Uno #2"]:::hardware
    end

    %% Optional PC for debugging
    PC["Host PC\n(Serial Monitor)"]:::ui

    %% Data Source
    Sensor["Sensor/Data Source"]:::external

    %% Connections: Transmitter Side
    Sensor -->|"data input"| Transmission
    Transmission -->|"UART TX"| XBee1
    XBee1 ---|RF Link| XBee2

    %% Connections: Receiver Side
    XBee2 -->|"UART RX"| Reception
    Reception -->|"process output"| Arduino2

    %% USB connection to PC (optional)
    Arduino1 <-->|"USB Serial"| PC
    Arduino2 <-->|"USB Serial"| PC

    %% Click events for source files
    click Transmission "https://github.com/bishnu-subedi/xbee-based-serial-communication-using-arduino-/blob/master/Transmission.c"
    click Reception "https://github.com/bishnu-subedi/xbee-based-serial-communication-using-arduino-/blob/master/Reception.c"

    %% Styles
    classDef hardware fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef firmware fill:#aed6f1,stroke:#1f618d,stroke-width:1px
    classDef ui fill:#a9dfbf,stroke:#196f3d,stroke-width:1px
    classDef external fill:#f9e79f,stroke:#b9770e,stroke-width:1px
```
