Skip to the content
4 layers139.7 × 41.3 mmSchemat, the printed circuit board in 3D

Fast LineFollower Robot project. Build on STM32 F7 microcontroller with custom PCB. Software, Hardware and QT Application.

Size
139.7 × 41.3 mm
Copper layers
4
Thickness
1.6 mm
Parts
74
Nets
84
Pads
282
Tracks, vias
537, 154
Pours
10
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
14 Sep 2024
Updated
17 Nov 2024

Overview

Schemat is an open-source printed circuit board by konrad1s, from the konrad1s/LineFollower-Kwark repository on GitHub, published under the MIT licence. It is a 4-layer board of 139.7 × 41.3 mm with 74 parts on 84 nets, routed with 537 tracks and 154 vias.

It is built around the LM1117MP-3.3, FTSH-105-01-F-DV-P-TR and JS202011SCQN, with the QT325G-26.000MAHQ-T among its other parts. Its parts include 20 capacitors, 15 resistors, 12 diodes, 10 connectors and 4 ICs. It belongs with the robots and motor control boards and the STM32 boards of this library.

Main components

4

README

README.md

Introduction

The LineFollower Robot is an autonomous robot designed to follow a predefined path marked by a black or white line.
This project serves a quite advanced solution including hardware project, embedded software and PC QT application.

A short video demo is available on YouTube.

LineFollower Youtube Video

Example - one of the first - linefollower run:

Hardware

High level block diagram

Schematic and PCB

Electronic circuit diagrams are available in the Hardware/release/schematic folder.
Gerbers files are available in the Hardware/release/gerbers folder.

Main board:

Sensor board:

Encoder board:

Component Details

  1. STM32F722 MCU
    ARM Cortex M7 microcontroller operating at the 216MHz with FPU, Cache, ITCM, DTCM. It powerful enough to handle algorithms and real-time processing required in linefollower applications.
  2. 12x KTIR0711S
    Phototransistor-based infrared sensors used to detect the line by measuring reflected IR light. Arranged in a array at the front of the robot to detect the position of the line. Outputs are connected to the MCU's ADC channels for monitoring.
  3. 12x LEDs
    Each LED corresponds to a KTIR0711S sensor, turned on when the sensor detects the line.
  4. 2x AMS AS5040 Encoders
    10-bit contactless magnetic rotary encoders providing precise angular position measurements. Thanks to the closed-loop control, encoders enables precise control of motor by providing feedback (velocity) for PID controllers.
  5. 2x Pololu TB6612FNG Motor Driver Modules
    H-bridge motor driver modules capable of controlling DC motors. Controller channels are combined to obtain higher current capacity.
  6. 2x Pololu Motor 10:1 HPCB 6V DC Motors
    High-power micro metal gearmotors with a 10:1 gear ratio
  7. Bluetooth Module JDY-31
    Bluetooth serial module enables wireless communication between the robot and PC application.
  8. Power Supply Components
    LiPo 7.4V battery used due to high energy density and ability to deliver powerful burst of current.
    3.3V Low dropout voltage regulator - steps down the battery voltage for MCU, sensors and others modules.

Software

Main run loop

The core functionality is implemented through an event-driven state machine. The primary signal is the LF_SIG_ADC_DATA_UPDATED, which is raised whenever new ADC data is available. Currently every 5ms, however increasing this frequency can lead to better control results.

The activity diagram presents simplified main robot algorithm in RUN state:

Code Structure

Short brief about implemented software components:

  • linefollower: The core component of the software, manages the main event driven state machine. It handles the initialization of all subsystems. This component integrates sensor data processing, PID control algorithms, encoder feedback, and motor management. Additionally, it facilitates communication with the PC application for debugging and configuration purposes.
  • linefollower_config: Defines the default configurations and settings for the robot. This ensures that all hardware related configurations is easily adjustable.
  • lf_signal_queue: Implements a signal queue used for managing events and signals within the state machine.
  • linefollower_commands: Handles the processing of serial communication protocol (SCP) commands received from the PC application. It defines a set of commands for controlling the robot's modes, resetting the MCU, initiating calibration, reading and writing NVM data, toggling debug mode, retrieving session information, and entering the bootloader for firmware updates.
  • lf_calibrate: Manages the calibration process for the sensors. It handles the collection of sensor data during calibration runs, computes appropriate threshold values based on the collected values.
  • sensors: The module is responsible for interfacing with the robot's sensors to detect the line. It processes ADC data to determine states and manages the associated LEDs. Also implements algorithms to detect specific straight lines and right angles.
  • pid: Implements the PID control algorithms used to regulate the robot's motor speeds based on sensor and encoder feedback.
  • encoder: Manages the interfacing with the motor encoders to track the robot's velocity.
  • tb6612_motor: The module interfaces with the TB6612 motor driver hardware to control the robot's motors.
  • nvm: The module handles non-volatile memory operations, enabling the storage and retrieval of configuration data, calibration settings, and runtime parameters. The module ensures data integrity through CRC verification. The nvm module allows the robot to retain configurations across power cycles.
  • scp: Implements the Serial Communication Protocol (SCP) used for communication between the robot and external interfaces such as the PC application.
  • scp_dispatcher: The module acts as a handler for processing SCP commands received via the scp module. It manages a global command queue using a circular buffer to store incoming data, parses SCP packets, verifies data integrity using CRC, and dispatches valid commands to their respective handlers.

Bootloader

Implemented bootloader allows for over the air firmware updates without the need of programmer. This is particularly useful for making quick updates "on the road." The bootloader uses the implemented SCP (Serial Communication Protocol) to receive firmware updates over Bluetooth.

There are 2 methods to enter the Bootloader:

  1. Command-Based Entry From Application
    Send a specific command to trigger reset to the bootloader.
  2. Backdoor Entry
    Enter the bootloader upon power-up by sending a specific command. Ensures that firmware updates are always possible, even if the application has errors causing continuous resets.

FLASH memory layout:

QT Application

The QT Application provides a graphical interface to control, configure, and monitor the robot. The main sections of the interface and their functionalities are as follows:

  1. Connection Panel
    Connection indicator and buttons to establish or terminate Bluetooth communication.
  2. Control Panel
    Starting, stopping, resetting, and calibrating the robot, along with options to enable debug mode, read/write NVM, and display real-time data (speed, error, and timing metrics).
  3. Sensors Panel
    Real-time sensor data display showing actual values, calibration references, and sensor weights.
  4. Configuration
    Includes settings for general parameters, PID tuning for motor control, and encoder adjustments.
  5. Graph
    A real-time graph displaying motor speeds, speed reduction, sensors error, enabling data analysis and adjustments for optimal performance.
  6. Bootloader
    Firmware update controls, including options to enter bootloader mode, switch to the main application and flash new firmware via Bluetooth.
  7. Logs
    Real-time log display with options to save or clear logs, providing detailed event tracking for debugging.

QtApplication

Parts

74
QtyValueFootprintReferences
13100nFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC2, C4, C6, C9, C10, C11, C12, C13, C15, C17, C20, C21, C22
13RResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15
12LEDLED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolderD1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12
10, , @HOLE0, @HOLE1, @HOLE2, @HOLE3, @HOLE8, @HOLE8, @HOLE9, @HOLE9
410uFCapacitor_Tantalum_SMD:CAP_293D-B_VSSC1, C7, C14, C16
210kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR1, R2
218pFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC3, C5
2Conn_Moto1_AConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ9, J12
2Conn_Moto1_BConnector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalJ10, J13
2TB6612FNGPackage_SO:SSOP-24_5.3x8.2mm_P0.65mmU3, U4
14.7uFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC8
1BatteryConnector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalJ1
1Conn_01x04_SocketConnector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ2
1Conn_Encoder1Connector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_Vertical_SMDJ6
1Conn_Encoder2Connector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_Vertical_SMDJ11
1FTSH-105-01-F-DV-P-TRConnector:SAMTEC_FTSH-105-01-F-DV-P-TRJ4
1JS202011SCQNschemat:SW_JS202011SCQNS1
1LInductor_SMD:L_0603_1608Metric_Pad1.05x0.95mm_HandSolderL1
1LM1117MP-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U1
1QT325G-26.000MAHQ-TOscillator:XTAL_QT325G-26.000MAHQ-TY1
1SENSOR_CONNSensor:GCT_FFC2B28-16-GJ3
1STM32F722RETxPackage_QFP:LQFP-64_10x10mm_P0.5mmU2

More from konrad1s/LineFollower-Kwark

2
  • 2 layers116.8 × 21.9 mmSchemat, the printed circuit board in 3D

    Schemat

    konrad1s/LineFollower-Kwark

    Fast LineFollower Robot project. Build on STM32 F7 microcontroller with custom PCB. Software, Hardware and QT Application.

    42 parts12MIT
  • 2 layers11.6 × 11.6 mmSchemat, the printed circuit board in 3D

    Schemat

    konrad1s/LineFollower-Kwark

    Fast LineFollower Robot project. Build on STM32 F7 microcontroller with custom PCB. Software, Hardware and QT Application.

    10 parts12MIT

Similar boards

  • 4 layers72.4 × 45.7 mmEasyBLDCV1 DRV8305, the printed circuit board in 3D

    EasyBLDCV1 DRV8305

    buckles3636/EasyBLDC

    Please ensure your designs meet common standards and include necessary documentation and comments.

    79 parts2MIT
  • 2 layers44.6 × 44.6 mmFgFocus, the printed circuit board in 3D

    FgFocus

    GrussmayerLab/fgFocus

    Focus Lock for Micro-Manager

    11 parts1
  • 4 layers40.3 × 68.8 mmNrfMain, the printed circuit board in 3D

    NrfMain

    batkay/CapstonePCB

    76 parts
  • 2 layers29.2 × 18.3 mmBat IMU nRF5340, the printed circuit board in 3D

    Bat IMU nRF5340

    BigBroBob2/bat_tag_nrf5340dk

    A custom-designed device to record free-flying bat kinematics, echos, and eye movement

    21 parts
  • 4 layers15 × 20 mmMillimobile circuit, the printed circuit board in 3D

    Millimobile circuit

    zenglhardt/millimobile-platform

    This repo contains the KiCad PCB design files for the development board verison of the MilliMobile. For more information on the platform, see the project page

    38 parts
  • 4 layers165 × 107 mmSpla board, the printed circuit board in 3D

    Spla board

    khaydarian/spla

    SNES PPU Logic Analyzer

    290 parts32
  • 2 layers59.2 × 93.2 mmAws iot expresslink demo badge, the printed circuit board in 3D

    Aws iot expresslink demo badge

    aws/iot-expresslink

    This device was designed and created for the AWS IoT ExpressLink Demo Badge Workshop, which was run at re:Invent 2022.

    74 parts29MIT-0
  • 4 layers92.7 × 76.2 mmDut artix7-a12t, the printed circuit board in 3D

    Dut artix7-a12t

    GMUCERG/fobos

    Flexible Open-source workBench fOr Side-channel analysis (FOBOS)

    199 parts18Apache-2.0

Questions

How big is the Schemat PCB?

It measures 139.7 × 41.3 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Schemat use?

74 parts, built around the LM1117MP-3.3, FTSH-105-01-F-DV-P-TR, JS202011SCQN and QT325G-26.000MAHQ-T. 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 Schemat KiCad files?

From the konrad1s/LineFollower-Kwark repository on GitHub, at the commit this page was made from: the board is Hardware/main_pcb/schemat.kicad_pcb and its schematic Hardware/encoder_pcb/schemat.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Schemat design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).