3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Operating the Pololu QTR-8RC Line Sensor with Arduino Uno

video Operating the Pololu QTR-8RC Line Sensor with Arduino Uno

UPDATE FEB 18, 2012: I have added some details regarding the calibration process and the differences between what I did in this guide to test the sensors and what needs to be done when the sensors are attached to the line-following robot. 

I am in the process of building a line-following and maze-traversing robot. So I got the Pololu QTR-8RC line sensor which is really 8 sensors in one pcb board. You can split the QTR-8RC into two boards, one with 6 sensor and the other 2 sensors. 

I made a short video showing steps involved in integrating the Arduino Uno with the Pololu QTR-8RC sensors before I attached the module to my line-following robot 

For this test, I used the Pololu software library for the QTR-8RC and sample test code with few modifications. The library handles all the details of the calibration process for you. 

Once you power the Arduino, the loaded sketch goes into "calibration" mode first. The calibration process involves exposing each sensor to the darkest surface of the racetrack (e.g. the black line) and the brightest surface (e.g. the white racetrack background). This is how the sensors can tell later if they are passing over the black line or if they are over the white area.

You can either do this manually by grabbing the robot and passing its sensors over the black line and white surface. Or you can write code for your robot so that when you push the start or reset button, your robot does a controlled rotation over the black line and white area, or by passing back and forth over the black line and white area. Or any combination that will give you a good calibration before your robot starts following the black line. 

NOTE: You can reverse the process so your robot is following the white line over a black racetrack. 

This process needs to be repeated every time you power the sensors, but I think it's worth trying to record and save the calibrated sensor values to use them later without having to calibrate every time you turn the robot on and off. This should be possible so long as the racetrack and its environmental conditions do not change. 

The Pololu test code sets the duration of the calibration process for 10 seconds. But you can shorten it if you feel you can get good calibration with a shorter period. 

For the video example in this guide, I only expose the sensors to a white surface so everything else will register as dark by comparison. This is not what you want to do for your line-following robot calibration, but it's just fine for the purposes of my testing. For your line-following robot, you should pass the sensors over the darkest and brightest surfaces of the racetrack. 

If you are using the Arduino IDE 1.0, replace reference to WConstants.h with Arduino.h in file "PololuQTRSensors.cpp"


HARDWARE
Arduino Uno
Pololu QTR-8RC Line Sensors
Breadboard and wires

SOFTWARE
Arduino IDE 1.0
Pololu QTR-8RC Software Library for Arduino

FEEDBACK
Your feedback is most welcome.




Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
33
Followers
18
Author:techbitar
Did I unplug the solder iron?