Line Follower 5



Smart Bricks · SKU TP-B02
Five IR sensors in one bar – build a fast line-following robot in minutes.
₹499
Works with TinkerPie V1 · same JST-PH cables as the board · Delivery across India: ₹100, 3–7 days · 7-day replacement for damaged or defective kits
About this kit
Line Follower 5 is a bar of five reflective IR sensors for line-following robots. It gives the position of the line directly, as a number from -100 (left) to +100 (right), works on black or white lines after a one-line calibration, and shows on five red LEDs which sensor sees the line. Two bars can be used on one robot.
Features
- 5 reflective IR sensors (QRE1113) with ambient-light cancelling
- Gives the line position directly: -100 (left) to +100 (right)
- Quick calibration for any floor (one function call)
- 5 red LEDs on top show which sensor sees the line
- Black or white line
- I2C 0x34 / 0x35 - two bars on one robot
Specifications
| Size | 56 x 32 mm |
|---|---|
| Sensing height | 1-3 mm above the floor |
| Voltage | 3.3 V |
| Interface | I2C 0x34-0x35 |
| Brain | CH32V003 |
How to use it with TinkerPie
- Connect the brick’s BUS IN to any TinkerPie SENSOR 1-4 port with a 4-pin JST-PH cable.
- More bricks? Plug the next one into BUS OUT (or use the I2C Hub).
- Install the TinkerPie and TinkerPieBricks Arduino libraries, open the sketch below, choose the board ESP32S3 Dev Module and upload.
Libraries: TinkerPie and TinkerPieBricks (Arduino IDE: Sketch → Include Library → Add .ZIP Library). Full guide: getting started with TinkerPie Bricks.
Quick start
Upload this, open the Serial Monitor at 115200 baud and watch the TinkerPie matrix.
Quick-start sketch (Arduino C++)
// Line Follower 5 (TP-B02): quick start
// Reads the brick and shows the value on the TinkerPie matrix and in the Serial Monitor (115200 baud).
#include <TinkerPie.h>
#include <TinkerPieBricks.h>
using namespace tinkerpie;
tpb::Line5 line;
void setup() {
Serial.begin(115200);
tinkerpie::begin(); // also starts the SENSOR ports (I2C bus Wire1)
if (!line.begin()) Serial.println("Line Follower 5 not found at 0x34: check the cable to SENSOR 1-4");
}
void loop() {
int8_t pos = line.position(); // -100 (left) .. +100 (right), NO_LINE when lost
basic::clearScreen();
if (pos != tpb::Line5::NO_LINE) for (int y = 0; y < 5; y++) led::plot(map(pos, -100, 100, 0, 5), y, Colors::Green);
Serial.println(pos);
basic::pause(50);
}
Project: Line-following robot
The Line Follower 5 bar under a two-wheel robot. Press A to calibrate (the robot spins over the line for 3 seconds), then it follows the line.
Line-following robot (Arduino C++)
// Line-following robot: Line Follower 5 (TP-B02)
// The Line Follower 5 bar under a two-wheel robot. Press A to calibrate (the robot spins over the line for 3 seconds), then it follows the line.
#include <TinkerPie.h>
#include <TinkerPieBricks.h>
using namespace tinkerpie;
tpb::Line5 line;
const float KP = 0.5; // steering strength
void setup() {
Serial.begin(115200);
tinkerpie::begin(); // also starts the SENSOR ports (I2C bus Wire1)
if (!line.begin()) Serial.println("Line Follower 5 not found at 0x34: check the cable to SENSOR 1-4");
basic::showIcon(IconNames::ArrowDown, Colors::Yellow);
while (!input::buttonIsPressed(Button::A)) basic::pause(10);
line.calibrateStart();
motors::tank(-40, 40);
basic::pause(3000);
motors::stop();
line.calibrateStop();
basic::clearScreen();
}
void loop() {
int8_t pos = line.position(); // -100 left .. +100 right
if (pos == tpb::Line5::NO_LINE) { motors::tank(-30, 30); return; } // lost: turn to find it
motors::tank(45 + KP * pos, 45 - KP * pos);
basic::pause(10);
}
More TinkerPie Bricks
IO-4 Smart BrickTP-B01Connect any analog or digital sensor to TinkerPie – 4 ports, each analog, digital or PWM.₹499Pre-order
Ultrasonic BrickTP-B03HC-SR04 distance sensor made safe and simple – distance in mm over one cable.₹499Pre-order
5V Sensor BrickTP-B04For the 5 V parts: gas sensors, 5 V PIR, relays and fans – powered from a servo port.₹499Pre-order
Servo-16 BrickTP-B05Drive 16 servos for robot arms, legs and animatronics.₹499Pre-order