This is an Arduino-based project for a line follower robot with an 8-sensor array. The robot uses PID control to follow a line on the ground and can make sharp turns when necessary.
- ESP32
- QTR-8RC or QTR-8A sensor array
- SparkFun TB6612 motor driver
- DC motors
- Jumper wires
- Breadboard
- Battery pack
- Platform IO
- QTRSensors library
- SparkFun_TB6612 library
- TaskScheduler library
- QuickPID library
- JLed library
- Install the required libraries in the Platform IO.
- Connect the QTR-8RC or QTR-8A sensor array to the Arduino board according to the pin connections in the
setup()
function. - Connect the SparkFun TB6612 motor driver to the Arduino board according to the pin connections in the
Motor
constructor. - Connect the DC motors to the motor driver.
- Upload the
main.cpp
file to the Arduino board.
- Power on the robot.
- Place the robot on a line on the ground.
- The robot will follow the line using PID control.
- If the robot loses the line, it will continue moving forward for a certain number of iterations before attempting to find the line again using the
findWhereLastLineWentFromHistory()
function. - The robot can make sharp turns when necessary by adjusting the motor speeds based on the line error.
Contributions to this project are welcome. Please submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE
file for details.