Skip to the content
2 layers100 × 78 mmLine Following Robot, the printed circuit board in 3D

Line Following Robot

bsce26023/Line-Following-Robot

This repo is for a line following robot. I've designed this robot keeping in mind that this could be used in competitions. It is designed for high speed performance and complex line following

Size
100 × 78 mm
Copper layers
2
Thickness
1.6 mm
Parts
20
Nets
53
Pads
120
Tracks, vias
361, 22
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
27 Feb 2026
Updated
24 Oct 2026

Overview

Line Following Robot is an open-source printed circuit board by bsce26023, from the bsce26023/Line-Following-Robot repository on GitHub, published under the MIT licence. It is a 2-layer board of 100 × 78 mm with 20 parts on 53 nets, routed with 361 tracks and 22 vias.

Its parts include 2 resistors, 1 connector and 1 switch. It belongs with the robots and motor control boards and the RP2040 boards of this library.

README

README.md

Autonomous Line Following Robot

Hi! I wanted to make a Line Following Robot(LFR) and I visited some shops and online marketplaces but I couldn't find a good, fast, compact and accurate robot with a reasonable price. So, I created a LFR from scratch including the PCBs for main board and sensor array for the hardware part and code in 5 separate files. Now I will explain Components, Wiring, Coding, and sensor array separately.

Corner_View

Top_viewBack_View

How to assemble and Opperate this LFR

1. Hardware Assembly : To Use this robot first you need to get the PCBs printed and then solder the components to them and then attach these to the chasis. Now plug and connect everything into its place and then you can move to software part.

2. Uploading the Code : Now connect Raspberry Pi Pico to your computer and open the LFR_Code.ino file and upload that to the Pico.

3. Tuning the Constants : Place the robot on a Black line with a White Background and adjust the Kp and Kd values such that the robot stops wobbling and runs smoothly.

4. Ready to Race : Now the robot is ready, You just need to turn it on and Race.

Components

I've decided the components based on affordability, speed, availability and ease of use. Starting with the micro controller I've selected Raspberry Pi Pico RP2040 because it has much more processing power than Arduino nano and I've not selected ESP 32 because I wanted to make the robot completely offline and autonomous and for motors I've selected 600rpm 6v N20 motors with encoders for fast speed and high torque 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 used decided to use a 2S Li-Po battery which is about 7.4v which can power the motors with ease and to power Pico I'd use a step down buck converter to convert these 7.4v into 5v so we don't damage the Pico 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.

SchematicsTracks
schemeticsTracks

3D

Custom Built Sensor Array

Now for the most difficult problem that I've faced in this project. I wanted to get analog sensor readings but Raspberry Pi Pico had only 3 analog pins. So I could add a Multiplexer chip which would make the PCB bulky. So I designed a workaround using an RC discharge Circuit. Instead of reading analog voltages, I paired 16 TCRT5000 sensors with 10nF capacitors and 220-Ohm Resistors. This converts the analog voltage signal to a digital timing signal. Working: The pico sends a brief signal to charge all 16 capacitors. Then it acts as a high-speed stopwatch to measure how fast each capacitors discharges.

  • If the sensor detects white surface, the capacitor discharges very fast
  • If the sensor detects black surface, the capacitor discharges slowly By doing this, I was able to read 16 analog sensors on 16 digital pins. To make the array even better, I also integrated two SPDT micro limit switch to use as bump sensors on left and right corners of the PCB.
SchematicsTracks
schemeticsTracks

3D

Bill of Materials (BOM)

After doing my research, the most affordable components I've got are as follows,

ComponentQuantityEst. Cost (USD)Purchase Links
Custom PCBs (JLCPCB)2 Sets$15.00https://jlcpcb.com/quote
Raspberry Pi Pico1$5.00https://ln.run/yanB3
TCRT5000 Transceivers16$4.00https://ln.run/hACwF
SMD Passives (0805)32$2.00https://ln.run/qddHJ
SPDT Limit Switches2$1.00https://ln.run/QSFtx
TB6612FNG Module1$3.00https://ln.run/ssqYa
6V N20 Motors (600 RPM)4$50.00https://ln.run/JM7nX
N20 Wheels & Brackets4$6.00https://ln.run/CkKDZ ---- https://ln.run/MqKmx
2S Battery (7.4V)1$3.00https://ln.run/iZsS-
Power Modules2$2.00https://ln.run/E-0I9 ---- https://ln.run/bBDg-
Misc. Hardware1$5.00N/A
Total Build Cost:~$96.00 USD

Because I designed the electronics to use standard, readily available modules, The robot is highly modular. If a motor driver or battery charger ever burns out during a competition, I can just unplug it and swap in a $3 replacement without having to desolder or rebuild the entire robot.

Parts

20
QtyValueFootprintReferences
4Conn_01x01Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_VerticalBAT1, GND1, GND2, VIN1
4Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalBuck_IN-1, Buck_IN+1, Buck_OUT-1, Buck_OUT+1
4Conn_01x06Connector_JST:JST_ZH_B6B-ZR_1x06_P1.50mm_VerticalMotor1, Motor2, Motor3, Motor4
2Conn_01x08Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalTB6612FNG_L1, TB6612FNG_R1
2RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR2, R3
1Conn_01x02Connector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalBattery1
1Conn_01x16Connector_PinHeader_2.54mm:PinHeader_1x16_P2.54mm_HorizontalJ1
1RaspberryPi_PicoModule:RaspberryPi_Pico_Common_THTA1
1SW_SPDTButton_Switch_THT:SW_Slide_SP3T_Straight_CK_OS103012MU1QP1SW1

More from bsce26023/Line-Following-Robot

2
  • 2 layers125 × 71 mmSensor Array, the printed circuit board in 3D

    Sensor Array

    bsce26023/Line-Following-Robot

    This repo is for a line following robot. I've designed this robot keeping in mind that this could be used in competitions. It is designed for high speed performance and complex line following

    40 partsMIT
  • 2 layers75 × 75 mmPCB (1), the printed circuit board in 3D

    PCB (1)

    bsce26023/Line-Following-Robot

    This repo is for a line following robot. I've designed this robot keeping in mind that this could be used in competitions. It is designed for high speed performance and complex line following

    14 partsMIT

Similar boards

  • 2 layers66.9 × 74.5 mmDeskHop Rev1, the printed circuit board in 3D

    DeskHop Rev1

    hrvach/deskhop

    Fast Desktop Switching Device

    20 parts7.9kGPL-3.0
  • 2 layers86.4 × 64.8 mmSlot machine, the printed circuit board in 3D

    Slot machine

    google/google-ctf

    Google CTF

    20 parts5.1kApache-2.0
  • 2 layers36.2 × 26.8 mmEsp32 minimal, the printed circuit board in 3D

    Esp32 minimal

    atopile/atopile

    Design circuit boards with code! ✨ Get software-like design reuse 🚀, validation, version control and collaboration in hardware; starting with electronics ⚡️

    20 parts4kMIT
  • 2 layers108.1 × 393.8 mmSweep compact ble, the printed circuit board in 3D

    Sweep compact ble

    davidphilipbarr/Sweep

    Sweep - a small promicro based keyboard inspired by the Ferris.

    20 parts2.1k
  • 2 layers26 × 15.9 mmTPS54340 Buck Regulator, the printed circuit board in 3D

    TPS54340 Buck Regulator

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    20 parts1.2k
  • 2 layers67.6 × 30.5 mmRgb to hdmi, the printed circuit board in 3D

    Rgb to hdmi

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    20 parts1kGPL-3.0
  • 2 layers44.3 × 28.7 mmLin bus adapter esp32, the printed circuit board in 3D

    Lin bus adapter esp32

    hackclub/OnBoard

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

    20 parts915
  • 2 layers89.5 × 61.6 mmFreeDeck TH 2020-02, the printed circuit board in 3D

    FreeDeck TH 2020-02

    FreeYourStream/freedeck-hardware

    all the stuff you need to build your own FreeDeck

    20 parts772

Questions

How big is the Line Following Robot PCB?

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

What parts does the Line Following Robot use?

20 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 Line Following Robot KiCad files?

From the bsce26023/Line-Following-Robot repository on GitHub, at the commit this page was made from: the board is PCB/PCB.kicad_pcb and its schematic PCB/PCB.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Line Following Robot 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).