Position values- Qtr-md-13a


We’ve been trying to use the polulu GTR-MD-13A sensor with your library that is available on Github(https://github.com/pololu/qtr-sensors-arduino) for a PID line following robot, but we’ve been having some difficulties position sensing. We are using the QTRAexample code provided in the library.

  1. even after calibration all the 13 sensors don’t see value of 0 on a white surface but values ranging from 50-150, even though I don’t think this should be the main reason for the problem number 2)
  2. When we slide the sensor over the black line that we want to follow(from side to side) the values decrease or increase from the value 6000(in our case that’s the middle value->because the values range from 0 to 12000[since the sensor consists of13 sensors])when we move the robot from right to left or vice versa, however when the sensor is about to loose the line and only the outmost sensor sees the line the values tend to change trend. I mean that for example if the robot should decrease the value from 6000 gradually to 0 it does it to 2000 but than when it is about to loose the line it jumps back to 4000(which indicates that the robot is more-less in the middle of the line).
    3)The sensor VCC inputs are connected to Arduinos’s 5V pin and all the grounds to one arduino’s ground pin, is it able to influence it any way?
    4)The sensor pins are connected to Arduinos’s analog pins ranging from A0 to A12(that should be correct)

Thank you for your help in advance.


Hello, Oszkár.

I moved your post to our Sensors subforum, which seems more appropriate, and removed your other duplicate posts.

Can you post close-up pictures showing your soldered joints on the QTR-MD-13A board? Which Arduino board are you using? Can you also post pictures of your setup and connections or at least a wiring diagram? It would be best if you can post a video showing your setup and how you are testing the sensors and the readings you get from that test.

Can you post your entire code too?

- Amanda