Pololu Qtr 8RC and orangutan sv328


i’m making a line follow robot, i’m using the qtr-8rc and the orangutan sv 328

the last year i made a similar robot with the qtr-8rc and arduino


this year i use the oragutan sv 328

i have a trouble with the sensor and the code

After the calibration i use this line code to give the value of the ubication of the white line

when the middle sensors are in the midle of the white line,the value that the code give me is about 2500 instead of the 3500 value.

after this problem i tried the next line code instead with a black line

when the middle sensors are in the midle of the black line, the value that the code give me is about 3500

i think that the problem is something related to the calibration or ther read the white line

here is all my code

[code]#include <pololu/qtr.h>
#include <pololu/orangutan.h>
#include <pololu/digital.h>

#define M1 30
#define M2 30

int main() {
int lastError = 0;

unsigned char qtr_rc_pins[]={IO_D0, IO_D1, IO_C0, IO_C1, IO_C2, IO_C3, IO_C4, IO_C5};

int i;
for (i = 0; i < 250; i++)  // make the calibration take about 5 seconds
print("press B");


{	unsigned int sensors[8];
	int position = qtr_read_line_white(sensors, QTR_EMITTERS_ON);
	//int position = qtr_read_line(sensors, QTR_EMITTERS_ON);
	int error = position - 3500;
	int motorSpeed = (1/4) * error + (7) * (error - lastError);
	lastError = error;
	int m1Speed = M1 - motorSpeed;
	int m2Speed = M2 + motorSpeed;

	if (m1Speed < 0)
	m1Speed = 0;
	if (m2Speed < 0)
	m2Speed = 0;
	if (m1Speed >45)
	m1Speed = 45;
	if (m2Speed > 45)//50
	m2Speed = 45;

	print_long (error);
	print_long (position);
return 0;



Thank you for posting your code. I do not see anything obvious in your code that might cause this problem. It sounds like one of the sensors on your array might not be working correctly. Could you try testing the IR emitters on the array by viewing them through a camera? Please note that some cameras have IR filters; most cell phone or digital cameras will work, but some (such as the rear-facing camera on some iPhones) have filters. You can find more information about using a camera to determine whether the IR LEDs are functioning as expected in the “Additional Considerations” section of the QTR-8A and QTR-8RC user’s guide.


thanks Brandon

I found the solution, I reduce the distance between the sensor and the surface, from 6.5mm to 3mm

Also change the value of 2000 to 3000

And take out of the while this line

Also add the { } in the last if conditionals

I am glad you were able to find a solution; thank you for letting us know what it was.

By the way, your Arduino-based line follower looks really cool, and if you feel like sharing it when you are finished, it would be fun to see how your new Orangutan one turns out. Good luck with your project!


the first tests of the line follower

I made two versions, one with back traction (first part of the video), and other with front traction ( last part of the video), both have the same speed (0.56 m/s), the closed curve in the path has 10 cm radius


The weight of the robot is 175 grams

I saw that the robot with front traction need less power in the motors to keep the same speed of the back traction robot

I’m working trying to increase the speed

Thank you for sharing your line follower; it looks like it works really well. Also, it is neat to see a comparison between the different orientations. It will be fun to see how much faster you can get it to go. Good luck!