# maheswar-eltro/arduino-robot architecture

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

- Interactive diagram: https://gitdiagram.com/maheswar-eltro/arduino-robot
- Repository: https://github.com/maheswar-eltro/arduino-robot

## Overview

This is an ESP32/Arduino two-wheel robot project. Its main workflow is keyboard input translated into left/right motor commands, sent either over serial or Wi-Fi, then handled by embedded control and the motor driver. The README documents basic movement, wireless control, and the hardware stages; sampled Python confirms the host-side command loops. Firmware internals were not sampled, so documented links are cited to the README rather than inferred from filenames.

Main entry points: [`src/control/keyboard-control/keyboard-control.py`](https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/keyboard-control/keyboard-control.py) (Serial WASD sender), [`src/control/remote-control/remote_control/remote_control.py`](https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/remote-control/remote_control/remote_control.py) (UDP WASD sender), [`src/control/keyboard-control/keyboard-control.ino`](https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/keyboard-control/keyboard-control.ino) (Keyboard firmware), [`src/control/remote-control/remote_control/remote_control.ino`](https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/remote-control/remote_control/remote_control.ino) (ESP32 remote firmware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Host controls"]
  node_serial_control["Serial WASD sender"]
  node_udp_control["UDP WASD sender<br/>[remote_control.py]"]
end

subgraph group_firmware["Embedded control"]
  node_basic_move["Basic movement<br/>[basic-movement.ino]"]
  node_keyboard_firmware["Keyboard firmware"]
  node_remote_firmware["ESP32 remote firmware<br/>[remote_control.ino]"]
end

subgraph group_hardware["Robot hardware"]
  node_driver["TB6612FNG driver"]
  node_motors["Drive motors"]
end

node_keyboard(("Keyboard input"))

node_keyboard -->|"provides keys"| node_serial_control
node_serial_control -.->|"sends serial commands"| node_keyboard_firmware
node_keyboard -->|"provides keys"| node_udp_control
node_udp_control -->|"sends Wi-Fi commands"| node_remote_firmware
node_basic_move -.->|"controls motors"| node_driver
node_keyboard_firmware -->|"controls motors"| node_driver
node_remote_firmware -->|"controls motors"| node_driver
node_driver -->|"drives"| node_motors

click node_serial_control "https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/keyboard-control/keyboard-control.py"
click node_udp_control "https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/remote-control/remote_control/remote_control.py"
click node_basic_move "https://github.com/maheswar-eltro/arduino-robot/blob/main/src/basic-movement/basic-movement.ino"
click node_keyboard_firmware "https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/keyboard-control/keyboard-control.ino"
click node_remote_firmware "https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/remote-control/remote_control/remote_control.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_serial_control,node_udp_control toneBlue
class node_basic_move,node_keyboard_firmware,node_remote_firmware toneAmber
class node_driver,node_motors toneMint
class node_keyboard toneIndigo
```

## Components

### Host controls

- [Serial WASD sender](https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/keyboard-control/keyboard-control.py): `src/control/keyboard-control/keyboard-control.py`
- [UDP WASD sender](https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/remote-control/remote_control/remote_control.py): `src/control/remote-control/remote_control/remote_control.py`

### Embedded control

- [Basic movement](https://github.com/maheswar-eltro/arduino-robot/blob/main/src/basic-movement/basic-movement.ino): `src/basic-movement/basic-movement.ino`
- [Keyboard firmware](https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/keyboard-control/keyboard-control.ino): `src/control/keyboard-control/keyboard-control.ino`
- [ESP32 remote firmware](https://github.com/maheswar-eltro/arduino-robot/blob/main/src/control/remote-control/remote_control/remote_control.ino): `src/control/remote-control/remote_control/remote_control.ino`

### Robot hardware

- **TB6612FNG driver**
- **Drive motors**

### Other components

- **Keyboard input**

## Connections

- Keyboard input → Serial WASD sender: provides keys (evidence: `src/control/keyboard-control/keyboard-control.py`)
- Serial WASD sender → Keyboard firmware: sends serial commands
- Keyboard input → UDP WASD sender: provides keys (evidence: `src/control/remote-control/remote_control/remote_control.py`)
- UDP WASD sender → ESP32 remote firmware: sends Wi-Fi commands (evidence: `README.md`)
- Basic movement → TB6612FNG driver: controls motors
- Keyboard firmware → TB6612FNG driver: controls motors (evidence: `README.md`)
- ESP32 remote firmware → TB6612FNG driver: controls motors (evidence: `README.md`)
- TB6612FNG driver → Drive motors: drives (evidence: `README.md`)
