Skip to the content
2 layers90 × 40 mmLineSensor Board, the printed circuit board in 3D

Academic project - AGV: line following robot

Size
90 × 40 mm
Copper layers
2
Thickness
1.6 mm
Parts
20
Nets
12
Pads
66
Tracks, vias
58, 0
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
20 Jun 2026
Updated
27 Sep 2026

Overview

LineSensor Board is an open-source printed circuit board by dquang05, from the dquang05/system_desgin_project repository on GitHub. It is a 2-layer board of 90 × 40 mm with 20 parts on 12 nets, routed with 58 tracks and 0 vias.

It is built around the TCRT5000. Its parts include 10 resistors, 5 ICs and 1 connector. It belongs with the robots and motor control boards of this library.

Main components

1

README

README.md

ESP32 Autonomous Mobile Robot (AMR)

ESP-IDF FreeRTOS C++17

An advanced Autonomous Mobile Robot firmware built on the ESP-IDF v5.x framework. Designed with strict real-time constraints, thread-safety, and modular architecture, this project demonstrates professional-grade embedded systems engineering using FreeRTOS and Object-Oriented C++.

🚀 System Architecture

The firmware is designed with a strict Application-Library Separation.

  • lib/: Contains hardware-agnostic, non-blocking drivers (Motor Control, PID, ADC DMA, Loadcell, Wi-Fi). No FreeRTOS tasks are spawned here.
  • src/: The Application layer orchestrating high-level state machines, task creation, and global resource management.

Key Engineering Highlights

  • Deterministic Real-Time Execution: Motion control and PID loops run precisely at 100Hz in a pinned Core 1 task.
  • Thread Safety: Lock-free passing where possible, combined with strict portENTER_CRITICAL Spinlocks for sharing high-frequency data (like Encoder ticks and ADC raw values) across multicore tasks.
  • Zero Dynamic Allocation in Critical Loops: No malloc or new in polling loops. Memory is strictly stack-allocated or statically provisioned at startup to prevent Heap Fragmentation.
  • Direct Memory Access (DMA): The 5-channel Infrared Line Sensor array is sampled at 20kHz continuously via ESP32's ADC DMA hardware, entirely offloading the CPU.

🧠 Control Algorithms

1. Velocity Control (Low-Level)

  • Incremental PID Controller: Controls the TB6612 H-Bridge drivers coupled with Quadrature Encoders.
  • Slew Rate Limiting: Prevents sudden current spikes (Back-EMF) by artificially capping the maximum acceleration dv/dt.
  • Integral Anti-Windup: Prevents overshooting when wheels are mechanically jammed or lose traction.

2. Autonomous Navigation (High-Level)

  • Line Tracking: Uses Weighted Average (Centroid) calculation with Affine Calibration to determine precise offset error (e2).
  • State Machine: Seamlessly transitions between MOVING_TO_PICKUP, WAITING_FOR_PACKAGE (Loadcell integration), and DELIVERING.
  • Two-Phase Pivot Turn: Executes precise turning maneuvers at intersections without the need for IMU/Compass, relying purely on encoder odometry and side-sensor polling.

3. Remote Telemetry & Tuning

  • Utilizes asynchronous UDP Sockets to broadcast telemetry data (RPM, Duty Cycle, Sensor Arrays) to a local network at high frequency.
  • Supports Live-Tuning: Send a JSON payload via UDP to dynamically update PID gains, steering RPMs, or loadcell thresholds without recompiling or halting the robot.

🛠️ Build & Flash Instructions

This project is configured using standard ESP-IDF CMake.

  1. Prerequisites: Ensure ESP-IDF v5.x is installed.
  2. Set Target:
    bash
    idf.py set-target esp32
  3. Build & Flash:
    bash
    idf.py build
    idf.py -p PORT flash monitor

📁 Repository Structure

text
├── MCU/
│   ├── include/           # Shared structures, Configs, and Orchestrator Headers
│   ├── src/               # FreeRTOS Tasks (Motion, Telemetry, UDP) & Main
│   ├── lib/               # Independent Component Libraries
│   │   ├── adc_dma/       # Continuous DMA ADC Driver
│   │   ├── loadcell_hx711/# HX711 Weight Sensor
│   │   ├── tb6612_encoder/# Motor & Quadrature Encoder Driver
│   │   ├── velocity_pid/  # Slew-Rate Limited PID
│   │   └── wifi_manager/  # Wi-Fi Station & AP provisioning
│   └── CMakeLists.txt     # Global IDF Component Registration
└── UI/                    # Node.js Server & Web Dashboard for UDP Telemetry

Parts

20
QtyValueFootprintReferences
5220Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R3, R5, R7, R9
52400Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR2, R4, R6, R8, R10
5TCRT5000MyLibrary:OPTO_TCRT5000U1, U2, U3, U4, U5
1Screw_Terminal_01x07Connector_PinHeader_2.54mm:PinHeader_1x07_P2.54mm_VerticalJ2

The 16 most common of 20 parts.

More from dquang05/system_desgin_project

1
  • 2 layers100 × 90 mmSystem desgin project, the printed circuit board in 3D

    System desgin project

    dquang05/system_desgin_project

    Academic project - AGV: line following robot

    78 parts

Similar boards

  • 2 layers200 × 78.8 mmOpenridingcontroller rev2, the printed circuit board in 3D

    Openridingcontroller rev2

    Squalius-cephalus/OpenRidingController

    D.I.Y horse riding controller for the PC.

    30 parts13
  • 2 layers66.4 × 52.5 mmWatermeter v0.4, the printed circuit board in 3D

    Watermeter v0.4

    rbisschops/mySensors

    mySensors

    39 parts6
  • 2 layers135.8 × 56.1 mmPower board, the printed circuit board in 3D

    Power board

    xtarke/automated_buggy

    This shield connects microcontroller (MSP-EXP430FR2355) pins to the car's power board. Go to Power Board for more hardware information.

    87 parts5GPL-3.0
  • 2 layers160 × 42 mmESP kicad2, the printed circuit board in 3D

    ESP kicad2

    Amrlxyz/esp-lfr-buggy

    2nd Year Embedded Systems Project (ESP) - Line Following Robot Buggy

    28 parts4
  • 2 layers34.1 × 108.8 mmMeshmerize, the printed circuit board in 3D

    Meshmerize

    ChinmayLonkar/MAZEBLAZE

    Meshmerize BOT

    62 parts3
  • 2 layers103 × 80 mmEduRoMAA EduCIAA, the printed circuit board in 3D

    EduRoMAA EduCIAA

    ciiiutnfrc/eduromaa

    Versión educativa del robot móvil RoMAA (EduRoMAA)

    81 parts3GPL-3.0
  • 2 layers150 × 100 mmMaze kiCad, the printed circuit board in 3D

    Maze kiCad

    billtsol/Maze

    This project demonstrates how to use an Arduino board, IR sensors, and a motor driver shield to create a maze-solving robot.

    39 parts2
  • 2 layers134.4 × 99.6 mmLine sensor, the printed circuit board in 3D

    Line sensor

    Potato-eater/Legacy2026

    github repo for Robocup Junior Australia lightweight soccer team

    79 parts2

Questions

How big is the LineSensor Board PCB?

It measures 90 × 40 mm and has 2 copper layers, 1.6 mm thick.

What parts does the LineSensor Board use?

20 parts, built around the TCRT5000. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the LineSensor Board KiCad files?

From the dquang05/system_desgin_project repository on GitHub, at the commit this page was made from: the board is hardware/LineSensor_Board/LineSensor_Board.kicad_pcb and its schematic hardware/LineSensor_Board/LineSensor_Board.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the LineSensor Board design in my own project?

Its repository states no licence, so its author keeps all rights: ask dquang05 before reusing the design.