Arduino Line Follower – Following Robot Car QTR-8RC Sensor

In this tutorial, you will make line follower robot. This tutorial involves building a line follower robot with an QTR-8RC Reflectance Sensor Array.

Required Hardware:

You can get these components from the following links:
Arduino Board
Motor Shield L293D
QTR-8RC Reflectance Sensor
DC Motor and wheel x2
Battery Buckle
Jumper Wires
Bovine Wheel
Battery 9V
Glue Gun

Arduino Compatible SCM & DIY Kits
Electronics Equipments & Tools
Module Board For Arduino


Connections :
1) DC Motors connect to the Motor Shield
2) Left Motors connect to M1
3) Right Motors connect to M2
4) The QTR-8RC Reflectance Sensor Connections

The Sensor VCC connect to the Arduino +5V
The Sensor GND connect to the Arduino Ground
The Sensor pin 2 connect to the Arduino Analog 0
The Sensor pin 3 connect to the Arduino Analog 1
The Sensor pin 4 connect to the Arduino Analog 2
The Sensor pin 5 connect to the Arduino Analog 3
The Sensor pin 6 connect to the Arduino Analog 4

5) Battery and on / off button connection

The (+) from the battery is connect to a leg of the button
Connect a cable to the other legs of the button. This cable is for Motor Shield (+)

6) Attach wheels

Copy the Source Code and install the Library:

1) Open the new Arduino IDE page and Delete everything on the page
2) Get the code from my web site and Paste empty Arduino IDE page
3) First Install the Arduino Libraries
3.1) Install the AF_Motor Arduino library

Close the Arduino IDE
Download the library;
Uncompress the ZIP file onto your desktop
Place the AFMotor folder into your arduinosketchfolder/libraries folder
Rename the uncompressed folder AFMotor

3.2) Install the QTRSensors library

Download the library;
Rename the folder “qtr-sensors-arduino-xxxx” to “QTRSensors
Drag the “QTRSensors” folder into the “libraries” directory inside your Arduino sketchbook directory

4) After installing the library, restart the Arduino IDE
5) Now you can see the libraries you have installed
6) When you verify, you will not see any errors


By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.