View Full Version : QTI Help

01-08-2006, 09:00 AM
I'm having some problems with the QTI kit for the BOE-Bot. I have hooked up the circuit test circuit exactly as it is shown in the documentation except that I have replaced pins 3,5,6, and 7 with 0,1,2, and 3 respectively. For some reason, the only sensor that works properly is the one connected to pin 3. I have had the wiring checked and double checked by outside parties and I have tried swapping QTI's in case of faults. Nothing works. The code is exactly the same as it appears in the documentation, except for the difference in pins. Any ideas as to what the problem might be would be greatly appreciated.

Jon Williams
01-08-2006, 09:02 AM
Are you sure the code if correct? Just in case, why not post it and let us have a look. http://forums.parallax.com/images/smilies/wink.gif

Jon Williams
Applications Engineer, Parallax

01-08-2006, 08:47 PM
Here's the code I'm using:

qtiLeft VAR Bit
qtiCenter VAR Bit
qtiRight VAR Bit


HIGH 1: PAUSE 1: qtiRight = IN0: INPUT 1
HIGH 2: PAUSE 1: qtiCenter = IN0: INPUT 2
HIGH 3: PAUSE 1: qtiLeft = IN0: INPUT 3

DEBUG HOME, BIN1 qtiLeft, BIN1 qtiCenter, BIN1 qtiRight

Pause 100


As I said before the only one that is properly functioning is the one attached to pin 3

Bruce Bates
01-08-2006, 09:34 PM
Spencer -

To compare the code you're using, and the test code below, as supplied in the Parallax Documentation, I'm wondering if we're even talking about the same sensor! A quick glance at the code below will show you what I mean. Even if you're using three sensors (left, center, right), as·might well·be implied by your coding, there is something RADICALLY wrong here.

Parallax Supplied Test·Program for QTI Line Sensor
As supplied in the QTI Line Sensor Revision One PDF Document


' -----[ Title ]----------------------------------------------------------------
' Mini-Sumo 3.1 : Line Sensor Test

' {$STAMP BS2}

' -----[ I/O Definitions ]------------------------------------------------------
LineSnsrPwr CON 10············ ' line sensor power
LineSnsrIn CON 9················ ' line sensor input

' -----[ Constants ]------------------------------------------------------------
ClrEOL CON 11···················· ' clear to end of line (DEBUG)

' -----[ Variables ]------------------------------------------------------------
Sense VAR Word·················· ' sensor raw reading

' -----[ Main Code ]------------------------------------------------------------

HIGH LineSnsrPwr················ ·' activate sensor
HIGH LineSnsrIn················· · ' discharge QTI cap


RCTIME LineSnsrIn, 1, Sense·· ' read sensor value
LOW LineSnsrPwr················· ' deactivate sensor


DEBUG Home DEBUG "Sensor ", CR DEBUG "-----", CR DEBUG DEC Sense, ClrEOL
GOTO Read_Sensor




Bruce Bates

Bruce Bates
01-08-2006, 09:45 PM
Spencer -

I just found the sample code from which your example came. I'm now as puzzled as you are. Apparently the coding in the document I had used was for "analog sampling" or something like that. Sorry for any confusion my prior post may have caused!

May I presume all your sense wires (RED) are tied in common with each other?


Bruce Bates

Jon Williams
01-08-2006, 10:26 PM
Post removed by Jon Williams -- error on my part.

Jon Williams
Applications Engineer, Parallax

Post Edited (Jon Williams (Parallax)) : 1/8/2006 5:18:43 PM GMT

01-08-2006, 11:35 PM

Unless there is a problem with the test code supplied with the QTI line follower appkit, pin 0 is the only pin I am supposed to be sampling. All the sensors are
tied to that pin.


I have checked and double checked and even had outside parties check the wiring. The next thing I am going to try is testing the circuit on a different breadboard.
It is an old breadboard that I pulled out of a drawer and may have some faults in it.

Post Edited (Spencer) : 1/8/2006 4:40:06 PM GMT

Jon Williams
01-09-2006, 12:18 AM
Sorry, my mistake -- will remove error (that teach me for not looking at our docs!).

Jon Williams
Applications Engineer, Parallax