Arduino - Line Follower Robot

by MertArduino in Circuits > Arduino

68858 Views, 96 Favorites, 0 Comments

Arduino - Line Follower Robot

img.jpg

Arduino Project Tutorial Line Follower Robot - For beginners

In this tutorial, you will make line follower robot.

Video Tutorial

Arduino Project Tutorial 12 : Line Follower Robot

This tutorial involves building a line follower robot with an QTR-8RC Reflectance Sensor Array.

Hardware Required

vlcsnap-2016-12-12-02h49m52s872.png

  • Arduino Board
  • Motor Shield (Adafruit)
  • QTR-8RC Reflectance Sensor Array (Pololu)
  • DC Motor x2
  • Wheel x2
  • Bovine Wheel
  • Chassis plate
  • Battery 9V
  • Battery Buckle
  • Wires
  • Button
  • Glue Gun
  • Electrical Tape

Create of the Chassis

vlcsnap-2016-12-12-02h50m21s624.png
vlcsnap-2016-12-12-02h50m35s800.png
vlcsnap-2016-12-12-02h50m43s288.png
vlcsnap-2016-12-12-02h51m08s190.png
vlcsnap-2016-12-12-02h51m21s442.png

  1. The DC motors attach to the chassis
  2. The Arduino attach to the chassis
  3. The Motor Shield attach to the Arduino.
  4. The Bovine Wheel attach to the chassis
  5. Wheels attach to the DC Motors

About the Motor Shield

FM3N7VSIWCFB7A7.LARGE.jpg
FKM26ACIWCFB7AE.LARGE.jpg
FCE6Y96IWCFB7A9.LARGE.jpg

  • The motor controllers on this shield are designed to run from 4.5V to 25V.
  • There are two places you can get your motor 'high voltage supply' from. One is the DC jack on the Arduino board and the other is the 2-terminal block on the shield that is labeled EXT_PWR.
  • To connect a motor, simply solder two wires to the terminals and then connect them to either the M1, M2, M3, or M4.

DC Motors and the QTR-8RC Sensor Connections

vlcsnap-2016-12-12-02h51m38s110.png
vlcsnap-2016-12-12-02h51m48s995.png
vlcsnap-2016-12-12-02h52m03s929.png
vlcsnap-2016-12-12-02h52m20s316.png
vlcsnap-2016-12-12-02h52m39s890.png
vlcsnap-2016-12-12-02h52m53s628.png
vlcsnap-2016-12-12-02h53m12s200.png
vlcsnap-2016-12-12-02h53m32s165.png

  1. DC Motors connect to the Motor Shield
  2. Left Motor connect to M1 - Right Motor connect to M2
  3. 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
  • The QTR-8RC Reflectance Sensor attach to the chassis

Battery and on / Off Button Connection

vlcsnap-2016-12-12-02h53m58s660.png
vlcsnap-2016-12-12-02h54m29s167.png
vlcsnap-2016-12-12-02h54m56s524.png
vlcsnap-2016-12-12-02h55m05s842.png
  • 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 (+)
  • If you would like to have 2 seperate DC power supplies for the Arduino and motors. Plug in the supply for the Arduino into the DC jack, and connect the motor supply to the PWR_EXT block. Make sure the jumper is removed from the motor shield.

Copy the Code and Install the Arduino Libraries

vlcsnap-2016-12-12-02h55m19s685.png
vlcsnap-2016-12-12-02h55m32s554.png
vlcsnap-2016-12-12-02h56m10s047.png
vlcsnap-2016-12-12-02h56m22s884.png
vlcsnap-2016-12-12-02h56m33s908.png
vlcsnap-2016-12-12-02h56m50s436.png
vlcsnap-2016-12-12-02h57m10s082.png
vlcsnap-2016-12-12-02h57m22s246.png
vlcsnap-2016-12-12-02h57m36s194.png
vlcsnap-2016-12-12-02h58m14s096.png
vlcsnap-2016-12-12-02h58m34s602.png
vlcsnap-2016-12-12-02h58m52s268.png
vlcsnap-2016-12-12-02h59m03s788.png
  • Uncompress the ZIP file onto your desktop
  • Place the AFMotor folder into your arduinosketchfolder/libraries folder
  • Rename the uncompressed folder AFMotor
  • 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

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

If It Helps, Please Subscribe

vlcsnap-2016-12-12-02h59m13s824.png

First of all, I would like to thank you for reading this guide ! I hope it helps you.

If you want to support me, you can subscribe my channel and watch my videos.

Visit My Youtube Channel - Mert Arduino Tutorial & Projects