Skip to the content
PCBKitNew board
2 layers110 × 100 mmLFR, the printed circuit board in 3D

I designed a LFR from scratch including the PCBs for main board and a custom sensor array. I designed this because I saw a friend of mine going into robotics competetions, so I also wanted to participate in them but I…

Size
110 × 100 mm
Copper layers
2
Thickness
1.6 mm
Parts
19
Nets
53
Pads
120
Tracks, vias
326, 38
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
14 May 2026
Updated
31 Oct 2026

Overview

LFR is an open-source printed circuit board by bsce26023, from the bsce26023/LFR repository on GitHub. It is a 2-layer board of 110 × 100 mm with 19 parts on 53 nets, routed with 326 tracks and 38 vias.

Its parts include 5 connectors and 1 switch.

README

README.md

Autonomous Line Following Robot

I designed a LFR from scratch including the PCBs for main board and a custom sensor array. I designed this because I saw a friend of mine going into robotics competetions, so I also wanted to participate in them but I didn't have a robot that I could take to those competetions, so I finally built one myself. I chose STM32 because in some of those events there is a requirement that your robot should not have wireless connectivity, so the first thing that came into my mind was arduino uno but it is very slow and basic compared to other microcontrollers available on market then after some research I had two options Raspberry Pi Pico RP2040 or a STM32 Black Pill. raspberry pi pico had only 3 analog pins so I went with STM32.

To View the 3D assembly --> Assembly

Top_viewCorner_View_1Corner_View_2

Components

I've decided the components based on affordability, speed, availability and ease of use. Starting with the micro controller I've selected STM 32 BlackPill and for motors I've selected 3000rpm 6v N20 motors with encoders for fast speed to drive these motors I've chosen TB6612FNG motor driver because it has low voltage drop and also it is way lighter than L298N. I've decided to use a 2S Li-Po battery which is about 7.4v which can power the motors with ease and to power STM32 I'd use a step down buck converter to convert these 7.4v into 5v so we don't damage the STM32 to charge the battery I'd use a 2S charger and for the sensors I've designed a custom sensor array.

PCB and Connections

To talk about the connections, I'd Start with the Power connections. The battery provides 7.4v which goes to VMOT pin of motor driver and buck converter. the buck converter then outputs 5v which goes to VSYS on Pico. Now we have 3 voltages. i.e. 7.4v, 5v and 3.3v. now the 3.3v goes to VCC and STBY pin of TB6612FNG and VCC pin on Sensor Array. Now lets talk about the Data and Logic Signals. The GPIO pins from 0 to 18 will be connected to sensor array and GPIO pins 19,20, 21, 22, 26, 27 will be connected to PWMA, AIN1, AIN2, PWMB, BIN1 and BIN2 respectively. At the end the AO1, AO2 and BO1, BO2 will be connected to left and right motors respectively. [Schematics]

SchematicsTracks
3DTracks

Custom Built Sensor Array

I designed the schematics for the sensor array, it is the working principle is inspired from the QTR-16RC sensor array. I designed this because traditional sensors and sensor arrays look too uncool, so I had to design something that looked aesthetic and visually pleasing.

SchematicsTracks
schemeticsTracks

3D

Assembly & Firmware Guide

Because STM32 boards lack native USB bootloaders out-of-the-box like standard Arduino boards, flashing firmware requires a specific procedure using either an ST-LINK V2 programmer or the built-in UART system memory bootloader.

Step 1: Mechanical & Electrical Assembly

  1. Chassis & Motors: Secure the DC gear motors to the mechanical chassis frame and attach the wheels.
  2. PCB Mounting: Mount the fabricated PCB securely onto the chassis using standoffs.
  3. Wiring Connections:
    • Connect the motor output leads from the gear motors to the motor driver output terminals (M1, M2).
    • Connect the IR sensor array to the designated analog/digital input header pins on the PCB.
    • Wire the power distribution, ensuring proper fusing and a stable common ground between the logic circuitry and motor drivers.

Step 2: Setting Up the Development Environment

  1. Install Visual Studio Code with the PlatformIO IDE extension (recommended for STM32 development) or Arduino IDE with the STMSS/STM32 Cores by STMicroelectronics installed via the Board Manager.
  2. Clone or download this repository to your local machine.

Step 3: Connecting the Programmer (ST-LINK V2 Method)

To flash code to an STM32 board, wire an external ST-LINK V2 programmer to the board's SWD pins:

ST-LINK V2 PinSTM32 Target PinFunction
3.3V3.3VPower Supply
GNDGNDCommon Ground
SWDIOPA13 (DIO)Serial Wire Data
SWCLKPA14 (CLK)Serial Wire Clock

Note: Ensure the target board is powered either via the ST-LINK's 3.3V pin (if current draw is low) or via an independent battery/bench supply.

Step 4: Uploading the Firmware

  1. Open the project workspace in your IDE.
  2. Verify that your platformio.ini or Arduino board settings match your exact STM32 part number (e.g., stm32f103c8).
  3. Build/compile the project to check for syntax or dependency errors.
  4. Initiate the upload command:
    • In PlatformIO: Click the Upload arrow icon (PlatformIO will automatically invoke OpenOCD and interface with your ST-LINK).
    • In Arduino IDE: Select ST-LINK under Tools > Programmer, then click Upload.
  5. Once the upload finishes successfully, disconnect the programmer (or keep it connected for serial debugging via UART if configured), power cycle the robot, and place it on the test track.

Bill of Materials (BOM)

NamePurposeQuantityTotal Cost (USD)LinkDistributor
PCBPCB217https://cart.jlcpcb.com/shopcart/cart/JLCPCB
Mounting BracketsMounting motors13https://a.aliexpress.com/_c41oltrBAliExpress
N20 WheelsWheels for Motors410https://a.aliexpress.com/_c3mDdjNxAli Express
Caster WheelsCaster wheels24https://a.aliexpress.com/_c2yFCmMdAliExpress
Slide SwitchPower Switch12https://a.aliexpress.com/_c3g6KmzXAliExpress
TB6612FNGMotor Driver14https://a.aliexpress.com/_c3bzgEgzAliExpress
N20 MotorsMotors with Encoders425https://a.aliexpress.com/_c39RykznAliExpress
CapacitorCapacitance13https://a.aliexpress.com/_c3Ig4r1XAliexpress
ResistorsResistance25https://a.aliexpress.com/_c3G1MsVLAliexpress
Limit switchBump sensor12.5https://a.aliexpress.com/_c3uz2IsvAliexpress
Ultrasonic sensorMeasures distance16https://a.aliexpress.com/_c35Zat1RAliexpress
TCRT5000Sensor17https://a.aliexpress.com/_c3RbgmiNAliexpress
Header pinsSoldering on pcb24https://a.aliexpress.com/_c4B0APx7Aliexpress
Mp1584Buck converter14.5https://a.aliexpress.com/_c4qnSguhAliexpress
Charging moduleFor charging battery12https://a.aliexpress.com/_c3Dtj3BLAliexpress
STM32Microcontroller16https://a.aliexpress.com/_c3GJD5FFAliexpress
Soldering IronFor Soldering115https://epro.pk/product/soldering-iron-station-adjustable-temperature-esd-safe-kada-936-in-pakistan/Epro
Customs--60-AliExpress
Shipping--20-JLCPCB
Total--200--

Parts

19
QtyValueFootprintReferences
4Conn_01x02Connector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalBuck_IN-1, Buck_IN+1, Buck_OUT-1, Buck_OUT+1
4Conn_01x06Connector_PinSocket_2.54mm:PinSocket_1x06_P2.54mm_VerticalMotor1, Motor2, Motor3, Motor4
2Conn_01x08Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalTB6612FNG_L1, TB6612FNG_R1
2Conn_01x20Connector_PinSocket_2.54mm:PinSocket_1x20_P2.54mm_VerticalJ3, J4
1Battery2Connector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_VerticalJ5
1Charger_OutConnector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalJ2
1Conn_01x01Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalVIN1
1Conn_01x01Connector_PinSocket_2.54mm:PinSocket_1x01_P2.54mm_VerticalGND1
1Conn_01x02Connector_AMASS:AMASS_XT60-M_1x02_P7.20mm_VerticalBattery1
1Conn_01x16Connector_PinHeader_2.54mm:PinHeader_1x16_P2.54mm_VerticalJ1
1SW_SPDTButton_Switch_THT:SW_Slide_SP3T_Straight_CK_OS103012MU1QP1SW1

Questions

How big is the LFR PCB?

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

What parts does the LFR use?

19 parts. 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 LFR KiCad files?

From the bsce26023/LFR repository on GitHub, at the commit this page was made from: the board is Main Board/PCB.kicad_pcb and its schematic Custom Sensor Array/Sensor Array.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the LFR design in my own project?

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

Similar boards

  • 2 layers43.9 × 27.7 mmTcd1304-4v, the printed circuit board in 3D

    Tcd1304-4v

    OpnTec/open-spectrometer-hardware

    Open source VIS spectrometer

    19 parts1.5k
  • 2 layers50 × 60 mmDebate Device, the printed circuit board in 3D

    Debate Device

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    19 parts915
  • 2 layers102.9 × 96.7 mmISA adapter, the printed circuit board in 3D

    ISA adapter

    polpo/picogus

    Emulation of ISA sound cards and CD-ROM on Raspberry Pi Pico (GUS, SB/Adlib, MPU-401, Tandy, CMS, Panasonic CD-ROM) with USB mouse/joystick support

    19 parts805
  • 2 layers60 × 39 mmPs2usb, the printed circuit board in 3D

    Ps2usb

    rasteri/HIDman

    Adapting USB devices to work on old computers

    19 parts432
  • 2 layers70.1 × 43.2 mmIaq device, the printed circuit board in 3D

    Iaq device

    nkitanov/iaq_board

    IAQ Board is a DIY (Do-It-Yourself) device for measuring internal air quality

    19 parts396
  • 2 layers80 × 80 mmGB BRK CPU G1, the printed circuit board in 3D

    GB BRK CPU G1

    Gekkio/gb-hardware

    Game Boy -related custom hardware by gekkio

    19 parts379CC-BY-4.0
  • 2 layers25.4 × 25.4 mmIna169, the printed circuit board in 3D

    Ina169

    Ardumower/ardumower

    Develop an open source robotic lawn mower (HW+SW reference platform)

    19 parts282
  • 2 layers58.4 × 28.6 mmNew rele, the printed circuit board in 3D

    New rele

    zmaker/arduino_cookbook

    gli sketch del nuovo progetto Arduino Cookbook e dei video di YouTube

    19 parts269