Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

My Arduino Line Following Robot - Using Pololu IR Reflectance Sensor Array

Loading...

Sign in or sign up now!
14,665
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 24, 2009

I used an Arduino Duemillanove with the ATMega 328. Propulsion is provided by the two Parallax Futaba Continuous Rotation Servos. My sensor is the Pololu QTR-6A IR Reflectance Sensor Array, and it is all powered off 4 rechargeable NiMH Duracell AA Batteries :)

It can follow a dark like, on a light background. In this case i used black tape on a whiteboard. It first calibrates itself for 5 seconds. You move it across the line a few times so it gets used to the difference in reflectance. After the calibration it begins moving foward. I used an algorithm to determine its error off the line. If it determines through the algorithm that it is at an extreme error, it will turn for a longer amount of time. Similarly, if the robot determines it is only a fraction of an inch off the line, it will only turn for a fraction of a second. This reduces over compensation and makes the line following a little smoother and more reliable.

This is the code I used, I started it from scratch and added the MegaServo Library. I'm aware that there is a library for the Pololu IR sensor arrays, but I encountered problems so i decided to start from scratch with the sensor reading as well. I'm using the Analog version of the Pololu sensor array, as opposed to the RC version, which outputs a digital signal. My sensors output an Analog voltage based on the reflectance of the surface. For example, if you are providing 5V to the sensors at Vcc, and you encounter a dark surface, that sensor will output a a voltage closer to 5V. Conversely, if the sensor encounters a very reflective, (white surface) it will output closer to 0V. I can read these 6 Analog outputs from my 6 sensors through the 6 Analog I/O pins on my Arduino.
In addition, my STOP algorithm uses nested if statements to check 3 times if the robot is really at the end, before it stops for 10 seconds, blinking the light. This prevents an accidental stop in the middle of the track due to inaccurate readings or glitches. During calibration, I calculated an average value of reflectance which i use later on to help with the navigation and decision making. I also printed some data to the Serial screen for testing purposes.

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (10)

Sign In or Sign Up now to post a comment!
  • @zeeshanamriya See his instructable on Instructables

    He has his email listed in the comment. Youtube is not letting me post direct link to his Instructable

  • could you give your email id so that i could contact you. i wish to know some specifications

  • @kyCap222 I used the same robot for another project involving ultrasound mapping. Its not active in this video.

  • @kyCap222 maybe because if suddenly an obstacle falls in front of the robot and you don't want to damege it driving against...

  • @jamesbond0096 Yes it is but why?? its a line follower.

  • @kyCap222 I think ist a Ping))) ultrasonic distance sensor.

  • Y is there a sonic detector on the front?

    hayden

  • Very Nice!!! That's awesome man!! :D

  • wow! it must have taken you foreverrr to make that! it's amazing! but it could really use some sort of designnn or color. pink in my opinion would be best. oh and your hands are reallyyyy flawless looking. they look good for stuff and things... like robots of course...

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more