Klein Bot

Kleins, robots, electricity


QTR Line Sensor - not working

Posted by Klein on October 2, 2010 at 10:21 PM

No luck getting the line sensor going. I'm asking for help from The Internet. I'm posting pictures of my setup and my code here, and posting my questions out there.


The setup:

Seeeduino pins 0 to 7 to QTR pins 1 to 8, respectively.

QTR enable pin unconnected.

Pictures in the photo gallery

connections to Seeduino

connections to QTR

IR LEDs are on

I verified 4.92v at Vcc on the QTR.

I verified continuity on each sensor connection


The code:

#include <PololuQTRSensors.h>

PololuQTRSensorsRC qtr((unsigned char[]) {0, 1, 2, 3, 4, 5, 6, 7},  8 );

void setup()
{ int i;
  for (i = 0; i < 250; i++) // make the calibration take about 5 seconds
  { qtr.calibrate();

void loop()
{ unsigned int sensors[8]; // an array to hold sensor values



After 5 seconds of (presumed) calibration, the code returns only "4000"s. I'm presuming that these are timeouts. A different version of the program using readLine returned only 0 for line position.


I got a prompt update from (Site Admin) Ben at the Pololu forum. No direct fix, but confirmation that it's not me. There's also some example code (with lots of room for improvement) at the primary forum thread.

Categories: Atlanta Robot Rally 2010, Arduino