Anda di halaman 1dari 4

Food Living Outside Play Technology Workshop

Line following Robot with Arduino


by ZRob314 on September 26, 2012

Table of Contents

Line following Robot with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Line following Robot with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Build list... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Assembly... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3: Arduino Sketch... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4: Test and Tune... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5: Conclusion... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

http://www.instructables.com/id/Line-following-Robot-with-Arduino/
Intro: Line following Robot with Arduino
In this tutorial we are going to go over building a arduino line following robot using Proportional control as the control method. Similar to PID but simpler. I reccommend
checking out the Wiki on both control systems.

Proprotional Control

http://en.wikipedia.org/wiki/Proportional_control

PID

http://en.wikipedia.org/wiki/PID_controller

http://http://www.societyofrobots.com/programming_PID.shtml

Step 1: Build list...


1. Arduino Uno or compatible http://www.zagrosrobotics.com/shop/item.aspx?itemid=868

2. Sparkfun Ardumotoshield http://www.zagrosrobotics.com/shop/item.aspx?itemid=782

3. Pololu QTR-8RC Reflectance Sensor Array

4. Robot chassis http://www.zagrosrobotics.com/shop/item.aspx?itemid=859

5. Jumper Wires http://www.zagrosrobotics.com/shop/item.aspx?itemid=834

http://www.instructables.com/id/Line-following-Robot-with-Arduino/
Step 2: Assembly...
After assembling the chassis secure the battery, Arduino and Ardumoto shield to the chassis ( I used zip ties). Next secure the QTR sensor so that it is just slightly above
the surface that the robot is going to be moving on. I used thin wire so that it was easy to adjust the sensors position but strong enough to hold it, as it might take some
adjusting when tuning your completed robot. Also take notice of the position of the sensor, header pins towards the inside so that the sensor pins match the Arduino
sketch.

Step 3: Arduino Sketch...


Next download the folder in the link below.

## These files do not work with newer versions of Arduino Ide 1.0 and above ##

https://www.box.com/s/c26rsnfenj1ifd2gtyvg

And add it you your libraries folder located in your Arduino folder. If you are unfamiliar with this step or the location of your folder go here for help. >>>
http://arduino.cc/en/Guide/Libraries

Inside the QTRRCExamples folder is the sketch you are going to be using. You can use use the Arduino Ide to find and import the sketch or copy and paste the sketch
from a text editor into the Ide then upload it to your UNO.

Also the pinouts for the sketch are as follows:

Ardumoto Digital pin 2 - QTR Sensor pin1


Ardumoto Digital pin 4 - QTR Sensor pin2
Ardumoto Digital pin 5 - QTR Sensor pin3
Ardumoto Digital pin 6 - QTR Sensor pin4
Ardumoto Digital pin 7 - QTR Sensor pin5
Ardumoto Digital pin 8 - QTR Sensor pin6
Ardumoto Digital pin 9 - QTR Sensor pin7
Ardumoto Digital pin 10 - QTR Sensor pin8
Ardumoto Analog pin 0 - QTR Sensor pin LEDON
Ardumoto A 1 - Negative wire for Right motor
Ardumoto A 2 - Positive wire for Right motor
Ardumoto B 3 - Positive wire for Left motor
Ardumoto B 4 - Negative wire for Left motor
Ardumoto GND - QTR Sensor pin GND
5V - QTR Sensor pin VCC

http://www.instructables.com/id/Line-following-Robot-with-Arduino/
Step 4: Test and Tune...
After uploading the sketch, and remove it from USB. Then place the robot on a white surface (off the line) and reset the Arduino. Resetting the Arduino reboots the sketch
which for the first few seconds begins calibration of the sensors. Now once the wheels start to move again hold the robot off the surface and just above the black line
moving it left to right to see how well it adjusts the wheels to keep up with the line. You may find your robot reacts sporadically at first but continue to adjust the height
your sensor and resetting the Arduino every time until you notice a height which seems to react best. This is Usually about 2/16 of an inch but may vary, also the black
line width should be close to or around 3/4 of an inch. Obviously some of these conditions can be changed with some minor editing of the PololuQTRSensors library files
and or the original sketch.

Step 5: Conclusion...
Hopefully with this tutorial, you have gained some basic understandings of control methods like Proportional control and or PID. Which can be useful in robotics and
automated control systems. Here is a short video of the robot maneuvering under conditions I suggested previously.

Related Instructables

Arduino Operating the GOduino - The


Controlled Line Arduino Uno +
make simple Pololu QTR-8RC Line Follower Arduino and
Following Robot Line Sensor Motor Driver
line follower Robot by nbibest clone (Photos) L293D Robot (
(video) by with erulduino with Arduino Part 2 ) Infrared
earthshine Uno (video) by by techbitar
(Photos) by Sensor by
stpdxpdc techbitar AgentWolf

Advertisements

http://www.instructables.com/id/Line-following-Robot-with-Arduino/

Anda mungkin juga menyukai