Skip to content

billtsol/Follow-The-Line

Repository files navigation

Arduino Follow-the-Line Project with QTR Reflectance Sensor

This project is an example of how to use an Arduino board, QTR reflectance sensor, and a motor driver shield to create a simple follow-the-line robot.

Requirements

To build this project, you will need the following components:

  • Arduino board
  • QTR reflectance sensor
  • Motor driver shield
  • Wheels
  • Motors
  • Jumper wires
  • Battery

Circuit Diagram

Circuit Diagram

PCB

PCB

Code

The code for this project is available in the follow_the_line.ino file. You can also open the qtr_xA_example.ino file that includes an example of how to use the QTR reflectance sensor as an analog sensor to detect the position of a line.

Installation

  1. Download the Arduino IDE from the official website and install it on your computer.
  2. Connect your Arduino board to your computer via USB cable.
  3. Open the Arduino IDE and open the follow_the_line.ino file.
  4. Upload the code to your Arduino board by clicking the "Upload" button in the IDE.

Usage

  1. Connect the QTR reflectance sensor and the motor driver shield to your Arduino board according to the circuit diagram.
  2. Attach the wheels and motors to the chassis.
  3. Connect the motors to the motor driver shield.
  4. Connect the battery to the motor driver shield.
  5. Turn on the power and place the robot on a black line on a white background.
  6. The robot will follow the line until it reaches the end of the line.

Troubleshooting

If the robot does not follow the line correctly, you may need to adjust the threshold values in the code or adjust the position of the QTR reflectance sensor.

Feature thoughts for this project:

  1. Add some LEDs to make the car follow the line in the dark: By adding some LEDs to the front of the robot, it can detect the line even in low light conditions. The LEDs can be programmed to turn on when the QTR sensor detects the line and turn off when it doesn't. This feature can improve the robot's performance in darker environments.

  2. Add some obstacle sensors to avoid objects in line: By adding some obstacle sensors to the sides of the robot, it can detect if there are any obstacles in its path and avoid them while staying on the line. This feature can improve the safety of the robot and prevent it from crashing into objects while following the line.

Final Images

final racing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages