Skip to the content
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

Size
100 × 90 mm
Copper layers
2
Thickness
1.6 mm
Parts
78
Nets
97
Pads
344
Tracks, vias
531, 61
Pours
9
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
20 Jun 2026
Updated
27 Sep 2026

Overview

System desgin project 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 100 × 90 mm with 78 parts on 97 nets, routed with 531 tracks and 61 vias.

It is built around the CP2104EK, ESP32-WROOM-32 and HX711, with the LM2596T-12, LM2596T-3.3 and LM2596T-5.0 among its other parts. Its parts include 27 resistors, 19 capacitors, 10 ICs, 5 diodes and 3 inductors. It belongs with the robots and motor control boards and the ESP32 boards of this library.

Main components

9

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

78
QtyValueFootprintReferences
80.1uFCapacitor_SMD:C_0805_2012MetricC8, C9, C10, C11, C12, C14, C16, C18
61KResistor_SMD:R_0603_1608MetricR1, R2, R3, R4, R5, R6
6220Resistor_SMD:R_0603_1608MetricR11, R12, R13, R14, R15, R16
410KResistor_SMD:R_0603_1608MetricR8, R23, R26, R27
4680uFCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC1, C2, C3, C5
310uFCapacitor_SMD:C_0805_2012MetricC7, C15, C17
312KResistor_SMD:R_0603_1608MetricR7, R17, R18
31N5822Diode_SMD:D_0805_2012MetricD1, D2, D3
322uHInductor_SMD:L_6.3x6.3_H3L1, L2, L3
2100Resistor_SMD:R_0603_1608MetricR9, R10
2470Resistor_SMD:R_0603_1608MetricR24, R25
25.1KResistor_SMD:R_0603_1608MetricR19, R20
2LEDLED_SMD:LED_0805_2012MetricD4, D5
2PC837Package_DIP:DIP-12_W7.62mmU1, U2
110uFCapacitor_SMD:C_1812_4532Metric_Pad1.57x3.40mm_HandSolderC13
122.1KResistor_SMD:R_0603_1608MetricR21
14.7uFCapacitor_SMD:C_0805_2012MetricC19
147.5KResistor_SMD:R_0603_1608MetricR22
1470uFCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC6
1560uFCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC4
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U8
1CP2104Package_DFN_QFN:QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mmU9
1ESP32-WROOM-32RF_Module:ESP32-WROOM-32U0
1Encoder1_HeaderConnector_JST:JST_EH_S6B-EH_1x06_P2.50mm_HorizontalLeft_Encoder1
1Encoder2_HeaderConnector_JST:JST_EH_S6B-EH_1x06_P2.50mm_HorizontalRight_Encoder1
1HX711Package_SO:SOIC-16_3.9x9.9mm_P1.27mmU7
1LM2596T-12Package_TO_SOT_THT:TO-220-5_VerticalU4
1LM2596T-3.3Package_TO_SOT_THT:TO-220-5_VerticalU6
1LM2596T-5Package_TO_SOT_THT:TO-220-5_VerticalU5
1LineSensor_HeaderConnector_JST:JST_EH_S7B-EH_1x07_P2.50mm_HorizontalADC1
1Loadcell_HeaderConnector_JST:JST_EH_S4B-EH_1x04_P2.50mm_HorizontalLOADCELL1
1MCU POWERTerminalBlock:TerminalBlock_bornier-2_P5.08mmJ1
1MOTOR POWERTerminalBlock:TerminalBlock_bornier-2_P5.08mmJ2
1SS8550Package_TO_SOT_SMD:SOT-23Q1
1SW_Nidec_CAS-120A1Button_Switch_SMD:SW_DIP_SPSTx01_Slide_6.7x4.1mm_W6.73mm_P2.54mm_LowProfile_JPinSW1
1TB6612FNGPackage_SO:SSOP-24_5.3x8.2mm_P0.65mmU3
1UMH3NPackage_TO_SOT_SMD:SOT-363_SC-70-6Q2
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_HorizontalUSB-C1

The 74 most common of 78 parts.

More from dquang05/system_desgin_project

1
  • 2 layers90 × 40 mmLineSensor Board, the printed circuit board in 3D

    LineSensor Board

    dquang05/system_desgin_project

    Academic project - AGV: line following robot

    20 parts

Similar boards

  • 2 layers87.1 × 81.1 mmPuissance, the printed circuit board in 3D

    Puissance

    Rami-Troudi/Electrique-Eurobot-IEEE-INSAT-2026

    Repo for my electrical work for the Eurobot competition

    40 parts1
  • 2 layers40 × 60 mmNhat, the printed circuit board in 3D

    Nhat

    tue-minh/PCB_Nhat

    📥 Nhấn vào link bên dưới để xem sơ đồ nguyên lý:

    58 parts
  • 4 layers238 × 204 mmBGA Steuerung 4layer, the printed circuit board in 3D

    BGA Steuerung 4layer

    al3c00/BGA_Steuerung

    Dieses Repository enthält Platine-Daten und Software zur Steuerung und Überwachung der Substratflüsse einer landwirtschaftlichen Biogasanlage.

    371 parts
  • 2 layers70.9 × 38.1 mmRwled ctrl, the printed circuit board in 3D

    Rwled ctrl

    cliffanet/rwled

    RW-led factory

    53 parts
  • 2 layers90 × 100 mmRobot, the printed circuit board in 3D

    Robot

    k6V457/maturitni_prace

    GOALS: - [x] Create this repository - [ ] Create graduation thesis - [ ] Create template in $\LaTeX$ - [ ] fill in blank spaces - [ ] modify template for SPSKA purposes - [ ] Write INTRO and theoretical part - [ ] start…

    12 partsMIT
  • 2 layers92.7 × 43.2 mmBuck conveter, the printed circuit board in 3D

    Buck conveter

    UltraInstinct21/Kicad_Projects

    Beginner kicad projects

    22 parts
  • 2 layers45 × 85 mmPSU, the printed circuit board in 3D

    PSU

    velvia-fifty/AudioThings

    DIY audio-related projects of questionable quality and dubious utility; delivered in 30 minutes or less or the next one is free

    67 parts1

Questions

How big is the System desgin project PCB?

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

What parts does the System desgin project use?

78 parts, built around the CP2104EK, ESP32-WROOM-32, HX711 and LM2596T-12. 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 System desgin project KiCad files?

From the dquang05/system_desgin_project repository on GitHub, at the commit this page was made from: the board is hardware/main_board/main_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 System desgin project design in my own project?

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