# aiahmedai/line-follower-robot architecture

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

- Interactive diagram: https://gitdiagram.com/aiahmedai/line-follower-robot
- Repository: https://github.com/aiahmedai/line-follower-robot

## Overview

This repository describes a line-following, obstacle-avoiding robot and includes Arduino firmware plus MATLAB and Proteus simulation artifacts. The documented runtime workflow is sensors detecting the line and obstacles, the Arduino processing those readings into movement decisions, and the L298N driving the motors. The README supports these firmware relationships; source excerpts were unavailable, so relationships among the simulation files and Proteus project are not asserted.

Main entry points: [`src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino`](https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino) (Arduino control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Sensing"]
  node_ir_sensors["IR sensors"]
  node_ultrasonic_servo["Ultrasonic sensor and servo"]
end

subgraph group_control["Robot control"]
  node_arduino_control["Arduino control"]
end

subgraph group_actuation["Movement"]
  node_l298n["L298N driver"]
  node_motors["Four DC motors"]
end

subgraph group_simulation["Simulation artifacts"]
  node_matlab_controller["Robot controller model<br/>[RobotController.m]"]
  node_simulation_setup["Simulation setup"]
  node_simulation_runner["Simulation runner<br/>[run_robot_sim.m]"]
  node_proteus_project["Proteus project"]
end

node_environment(("Line and obstacles"))

node_environment -->|"provides line input"| node_ir_sensors
node_environment -->|"presents obstacles"| node_ultrasonic_servo
node_ir_sensors -->|"sends readings"| node_arduino_control
node_ultrasonic_servo -->|"triggers avoidance"| node_arduino_control
node_arduino_control -->|"sets motor direction"| node_l298n
node_l298n -->|"drives motors"| node_motors

click node_ir_sensors "https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino"
click node_ultrasonic_servo "https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino"
click node_arduino_control "https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino"
click node_l298n "https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino"
click node_motors "https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino"
click node_matlab_controller "https://github.com/aiahmedai/line-follower-robot/blob/main/simmulation/RobotController.m"
click node_simulation_setup "https://github.com/aiahmedai/line-follower-robot/blob/main/simmulation/create_RobotSimulation.m"
click node_simulation_runner "https://github.com/aiahmedai/line-follower-robot/blob/main/simmulation/run_robot_sim.m"
click node_proteus_project "https://github.com/aiahmedai/line-follower-robot/blob/main/Proteus_Simmulation/Track%20Reapers%20Simulation.pdsprj"

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_ir_sensors,node_ultrasonic_servo toneBlue
class node_arduino_control toneAmber
class node_l298n,node_motors toneMint
class node_matlab_controller,node_simulation_setup,node_simulation_runner,node_proteus_project toneRose
class node_environment toneIndigo
```

## Components

### Sensing

- [IR sensors](https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino): `src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino`
- [Ultrasonic sensor and servo](https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino): `src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino`

### Robot control

- [Arduino control](https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino): `src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino`

### Movement

- [L298N driver](https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino): `src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino`
- [Four DC motors](https://github.com/aiahmedai/line-follower-robot/blob/main/src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino): `src/Line_Follower_And_Obstacle_Avoiding_Robot_car.ino`

### Simulation artifacts

- [Robot controller model](https://github.com/aiahmedai/line-follower-robot/blob/main/simmulation/RobotController.m): `simmulation/RobotController.m`
- [Simulation setup](https://github.com/aiahmedai/line-follower-robot/blob/main/simmulation/create_RobotSimulation.m): `simmulation/create_RobotSimulation.m`
- [Simulation runner](https://github.com/aiahmedai/line-follower-robot/blob/main/simmulation/run_robot_sim.m): `simmulation/run_robot_sim.m`
- [Proteus project](https://github.com/aiahmedai/line-follower-robot/blob/main/Proteus_Simmulation/Track%20Reapers%20Simulation.pdsprj): `Proteus_Simmulation/Track Reapers Simulation.pdsprj`

### Other components

- **Line and obstacles**

## Connections

- Line and obstacles → IR sensors: provides line input (evidence: `README.md`)
- Line and obstacles → Ultrasonic sensor and servo: presents obstacles (evidence: `README.md`)
- IR sensors → Arduino control: sends readings (evidence: `README.md`)
- Ultrasonic sensor and servo → Arduino control: triggers avoidance (evidence: `README.md`)
- Arduino control → L298N driver: sets motor direction (evidence: `README.md`)
- L298N driver → Four DC motors: drives motors (evidence: `README.md`)
