"What we are gonna do is not the Normal thing. Just like How we're gonna home, We have some pathway to go. We have a thing on Top of our head to do that.
Like wise we are gonna put that thing to understand the bot to move to the area, where should go. It like putting an RFID Reader there by If we put the tag then It will capture data and then it will move from that area where we have address in each trace".
1. Introduction and Motivation
The Line Bot is an autonomous, line-following mobile robot developed as the final project for the Fab Academy 2025 cycle. The motivation behind the project is to demonstrate how embedded systems, digital fabrication, and sensor-actuator integration can be combined into a compact, educational robotics platform.
Autonomous robots that can follow a designated path are often the first step in teaching robotic behavior, path planning, and feedback-based control systems. The project embodies this concept while enhancing it with modern tools like custom PCB design, ESP32-based microcontroller integration, and real-time data display through an OLED interface.
The bot showcases the fusion of mechanical, electrical, and programming skills required in modern embedded product development.
2. Project Objectives
The primary goals of the Line Bot project include:
- To design and fabricate a compact robot that can follow a line autonomously using IR sensors.
- To develop a custom microcontroller-based electronics system using the XIAO ESP32-C3.
- To fabricate a custom PCB integrating motor drivers and IR sensors.
- To implement reliable line-following logic using PWM and real-time feedback.
- To visualize sensor data using an onboard OLED display.
- To validate the system through performance testing in different conditions.
- To document all aspects of design, development, testing, and learning.
Bill of Materials in $
Line Follower Bot - Bill of Materials
S. No |
Component |
Description |
Qty |
Unit Price (USD) |
Total Price (USD) |
1 | XIAO ESP32-C3 | Microcontroller Unit | 1 | 5.50 | 5.50 |
2 | Fabricated PCBs | Custom Motor + Sensor Interface | 2 | 2.00 | 4.00 |
3 | Header Pins & Wires | Male/Female Headers, Solder Wires | 1 set | 1.00 | 1.00 |
4 | BO Motors + Wheels | Plastic Gear Motors with Wheels | 2 sets | 2.50 | 5.00 |
5 | L298N Motor Driver | Dual H-Bridge Driver Module | 2 | 2.00 | 4.00 |
6 | Connector Wires + JST | JST 2/7-pin wires & terminals | 2 sets | 1.00 | 2.00 |
7 | OLED Display | 0.96" I2C Monochrome | 1 | 3.00 | 3.00 |
8 | 5-Line Sensor Array | IR Line Detection Module | 1 | 4.00 | 4.00 |
9 | Acrylic Sheet | 100x100 mm Chassis Base | 1 | 1.50 | 1.50 |
10 | Line Marker Tape | Black Tape for Path | 1 roll | 0.50 | 0.50 |
Total Cost |
$30.50 |
3. Design Approach
The approach was divided into modular design steps:
- Conceptual Planning: Define the bot's capability, sensor logic, and form factor.
- Mechanical CAD: Design a chassis that securely mounts motors, sensors, and PCBs using lightweight materials like acrylic.
- Electronics Design: Build a custom PCB to manage all interfaces including motor drivers, IR sensors, and power supply.
- Programming: Develop firmware that reads sensor data, processes logic, and actuates motors accordingly.
- Integration and Testing: Ensure all components—mechanical, electrical, and firmware—are working seamlessly.
The project followed an iterative design philosophy—prototype early, test often, and refine continually.
4. Component Overview
- Microcontroller: XIAO ESP32-C3 - Compact, low-power board with built-in Wi-Fi and Bluetooth. Responsible for all sensor processing and motor control.
- Motor Drivers: L298N Dual H-Bridge Motor Driver - Controls two BO motors independently through PWM.
- Sensors: 5-Channel Infrared Sensor Array - Used to detect the contrast between black line and white background. Analog or digital values processed by ESP32.
- Display: 0.96" OLED I2C Display - Displays real-time sensor readings, motor status, and debug messages.
- Power System: Li-ion battery (3.7V) with boost converter to 5V/7.4V output.
- Mechanical: Acrylic Base (laser-cut), BO motors with wheels, mounting hardware, and wiring using JST connectors.
5. Electronics Architecture
The electronics design was tailored for simplicity and efficiency. The ESP32-C3 interfaces with:
- IR sensor via analog/digital input pins.
- L298N motor driver via PWM-enabled GPIOs.
- OLED via I2C communication (SCL, SDA).
- Power supplied from a Li-ion battery regulated via onboard voltage converters.
The system wiring was planned carefully to ensure minimal noise, secure connections, and clear power/data paths. The use of JST connectors simplified replacements and debugging.
6. Mechanical Structure
The body of the robot was designed in CAD and laser cut using 3mm acrylic sheet. The design considerations included:
- Adequate spacing between wheels and sensors.
- Firm placement of motor driver and MCU.
- Slots for wiring and connectors.
- Mounting holes for sensors to face the ground at a proper angle.
3D Design
Laser Cutting Process
The BO motors were mounted using acrylic brackets, and the IR sensor array was placed at the front underside. The final structure ensured good balance, durability, and access for debugging.
7. Firmware Development
The firmware was developed using the Arduino IDE with ESP32 board support. The program is structured into several functional blocks:
- Initialization: Setting up pin modes, I2C communication for the OLED, and serial debugging.
- Sensor Reading: Capturing values from the 5-line IR array to determine line position.
- Line Following Logic: Using conditional logic (and optionally PID control) to compare sensor values and adjust motor speeds accordingly.
- PWM Motor Control: Applying PWM signals to control motor direction and speed using the L298N driver.
- OLED Display: Displaying sensor status, speed, and current direction in real-time for debugging and visualization.
Interrupt safety, debounce handling, and a compact memory footprint were considered during development. The loop runs continuously with low latency, allowing near real-time adjustments during movement.
8. PCB Design and Integration
The custom PCB was designed using KiCad. It includes:
- Pads for XIAO ESP32-C3.
- Input headers for the IR sensor.
- Output headers for motor connections.
- Voltage regulators and decoupling capacitors.
- I2C breakout for OLED.
Design decisions focused on minimizing space, ensuring low EMI, and clean signal routing. The board was fabricated using PCB milling tools in the Fab Lab, and then soldered by hand. Careful routing allowed a single-layer PCB, reducing cost and complexity.
Testing was conducted using multimeters, continuity tests, and live firmware to confirm all traces and headers were correctly connected before integration.
9. Assembly Process
The mechanical and electrical systems were integrated step-by-step:
- Chassis Construction: Laser-cut acrylic parts were assembled using bolts and plastic spacers to form the robot frame.
- Motor Mounting: BO motors were attached to the chassis using acrylic brackets and secured with fasteners.
- PCB Installation: The custom PCB was fixed to the frame with standoffs and screws to minimize vibration.
- Sensor and Display Setup: The IR sensor module was mounted at the front bottom, and the OLED was fixed on the top for easy visibility.
- Wiring and Connections: JST connectors and male-female headers were used for quick plug-and-play setup.
- Battery Housing: The Li-ion battery and its holder were placed centrally to maintain weight balance.
All systems were connected and verified using multimeter continuity checks and boot-time LED indicators.
Assembly Video
10. Testing and Debugging
A multi-stage testing plan ensured reliability and performance:
- Power Verification: Checked all voltage rails and current consumption under load.
- Motor Control Tests: Validated motor driver logic and PWM signal integrity using oscilloscope and serial logs.
- Sensor Alignment: Ensured the IR array accurately detected line positions; tested on white sheet with black tape.
- OLED Feedback: Confirmed sensor readings and debug info appeared correctly on the OLED.
- System Integration: Tested full system in real-time, checking responsiveness and smooth motor transitions.
Issues such as unbalanced movement or occasional noise in sensor readings were resolved by adjusting speed logic, filtering values, and re-aligning the sensor module.
11. Final Demonstration and Results
The final demonstration took place on a predefined black line track with multiple curves and intersections. The bot was placed on the line and started autonomously following the path using the pre-programmed logic.
- Response Time: The bot showed excellent responsiveness to sharp turns and quick changes in direction.
- Sensor Accuracy: All five sensors were correctly aligned and capable of detecting deviation early.
- Stability: The motion was consistent without abrupt wobbles, even at moderate speeds.
- Visual Feedback: The OLED displayed sensor values and motor speed dynamically, confirming active status.
- No Manual Intervention: The robot successfully completed the track end-to-end without manual correction.
12. Challenges and Improvements
Throughout the development, several challenges were encountered:
- Sensor Placement: Initial placement caused inaccurate readings; this was fixed by tilting and spacing adjustment.
- Power Fluctuation: Brown-out issues with motors under load were resolved using capacitors and optimized wiring.
- Motor Alignment: Slight misalignment caused drift, which was corrected by refining motor mount positions.
- Code Optimization: The initial firmware lacked smoothing logic; improvements were added using average filtering.
- PCB Mistakes: Minor routing errors were patched with jumper wires in early prototypes; later designs corrected this.
Planned Improvements:
- Implement PID-based control for even smoother transitions.
- Add obstacle sensors for enhanced path decision-making.
- Integrate Wi-Fi or Bluetooth for remote debugging or control.
13. Reflections and Learnings
This project has been a comprehensive learning experience in both engineering design and iterative development. Major takeaways include:
- Interdisciplinary Knowledge: The project required integrating CAD modeling, electronics, embedded programming, and system thinking.
- Rapid Prototyping: Utilizing the Fab Lab helped reduce iteration time and allowed continuous testing and feedback.
- Documentation Discipline: Weekly documentation taught the importance of tracking changes and reflecting on decision-making.
- Problem Solving: Tackling unexpected hardware and software bugs honed practical debugging skills.
- Team Collaboration: Peer reviews and mentor feedback contributed to improving the design quality and user experience.
Overall, the journey from concept to working prototype provided a real-world simulation of embedded system product development.
14. Applications and Future Scope
The Line Bot serves as a scalable educational platform that can evolve in various directions. Possible future applications include:
- STEM Education Kits: A simplified version of the Line Bot can be used in schools to teach programming and robotics.
- Warehouse Automation: The control logic can be extended to automated guided vehicles (AGVs) in logistics.
- Swarm Robotics: With communication modules added, multiple bots can be coordinated for collective tasks.
- Sensor Research: The IR module setup can be adapted for different sensor research including reflectivity studies.
- Competition-Ready Bots: Enhancing the bot with real-time remote control or adaptive vision can make it suitable for robotics contests.
The modularity and flexibility of the Line Bot make it a great candidate for continued upgrades and real-world deployment.
15. Documentation and Fab Lab Tools Used
The project used several Fab Lab tools and techniques for its development. Key contributions include:
- 3D Design Tools: SolidWorks for mechanical modeling and STL generation.
- Laser Cutting: For precise acrylic part fabrication.
- PCB Design: KiCad for schematic capture and PCB layout.
- PCB Milling: Desktop CNC used to fabricate the custom board.
- Soldering Station: For assembling SMD and through-hole components.
- Microcontroller Programming: Arduino IDE for firmware development.
- Multimeter and DSO: For testing signals and power lines.
- Documentation Platform: FabAcademy GitLab site for weekly logs and project updates.
The Line Bot was developed entirely within the resources of the Fab Lab, demonstrating the power and versatility of local digital fabrication.