Line-Follower Robot

Line Follower Robot (LFR) is a simple robot concept that is autonomously guided to follow a line, that is drawn over white surface as dark lines or over a considerably dark surface as white lines. These lines are detected via the Reflectance Sensor Module on the robot. The code uses a PID algorithm in order to actuate motors, deciding whether turn left or right. The robot smoothly follows the line with these decisions of slight turns.

About Tools and Materials:

2x SMD Red (Purchase Here)

SMD USB Gateway (Purchase Here)

Arduino Gateway Module (Purchase Here)

2x BDC Motor (Purchase Here)

Reflectance Sensor Module (Purchase Here)

Step 1: Hardware & Software Overview

Project Key Components

  1. SMD

    The SMD acts as a bridge between the script and the modules. It is responsible for interpreting the commands sent by the script and translating them into actions that read input from the Ultrasonic Distance Sensor Module and meanwhile, actuate the motor for the continuous reading of the script.

  2. BDC Motor

    The 100 RPM BDC Motor with Encoder is used to rotate the radar mechanism in a full circle. The user can precisely control the motor and get the position through the built-in encoder.

  3. Reflectance Sensor Module The Reflectance Sensor Module is a tool that used to detect contrast on a surface. It works by detecting the reflectance of a surface using infrared light and differentiating the contrast by measuring the amount of reflected light to the ratio of emitted light.

Key Features

• PID-Controlled Line Following Uses QTR sensors and a PID algorithm for precise tracking.

• Dynamic Speed Adjustment Adjusts motor speed based on deviation from the line.

• Real-Time Visualization Graphical representation of robot movement using Tkinter Canvas.

• Smooth Path Tracking Implements differential drive control for accurate turns.

• Modular & Expandable Supports easy modifications for different sensor setups.

Step 2: Assemble

Connect the SMD Red to the PC or Arduino board using a USB Gateway Module or Arduino Gateway Module.

Connect the BDC Motors with encoders to the motor ports of the SMD.

Attach the Reflectance Sensor Module to the SMD using RJ-45 cables.

Ensure the SMD is powered and all connections are properly secured.

Project Wiring Diagram

Step 3: Run & Test

1. Connect the Line Follower Robot to your PC using the appropriate USB port. Ensure all connections are secure.

2. Run the Python script to initialize the SMD and set up the motor control.

3. Press the “Start” button in the GUI to begin the line-following operation.

4. The robot will use QTR sensors to detect the line and adjust its movement using a PID algorithm.

5. If needed, adjust the PID parameters (kp, ki, kd) to optimize the tracking accuracy.

6. Press “Stop” to halt the robot, or “Clear” to reset the path tracking.

7. Verify that the motors respond correctly to sensor input and that the robot follows the line smoothly.

Codes

Last updated