Shop OBEX P1 Docs P2 Docs Learn Events
Troubleshooting QTI Infrared sensor in digital mode — Parallax Forums

Troubleshooting QTI Infrared sensor in digital mode

WHallWHall Posts: 22
edited 2010-03-23 21:29 in Accessories
I could use some help on using the QTI sensor in digital mode. Attached are a couple of screen shots of the circuitry and the code I'm using. I can get digital output, but there doesn't seem to be any rhyme nor reason to it. I've tried various objects at various distances, including a printed out wheel encoder in black and white, but to no avail. Ideally, I want to rotate the wheel in front of the sensor and get either a "one" or "zero".

Out of the box, I was able to use the sensor in analog mode to debug IR "time" using RCTIME. But since trying to convert it, I can't get it to recognize black and white surfaces in digital mode with any certainty that the number corresponds to the object it is sensing.

The resistor in the picture is 10 ohm. P5 is connected to "W" and P3 is connected to "R". "B" goes to VSS.

I'm casting myself on the mercy of the forum members. Is the circuitry and code correct? Thanks for any and all help!
1280 x 960 - 897K
604 x 788 - 117K

Comments

  • PropabilityPropability Posts: 142
    edited 2010-03-16 19:26
    That's a little hard to drive low (10 ohm) . Try about 2k2 or maybe 1k .

    There is a document for the BOEBOT that shows how it's done but did not find it.

    Maybe it should be referenced on the product page.

    EDIT:

    OK I did a little digging on this and found some interesting things.

    When I ordered my line follower Appkit for the Boe-Bot (#28108) I also downloaded the docs. It was v1.1 8/10/2007. Just went looking and the doc has been revised. What got revised? Well the section where they describe converting it into a digital sensor has been completely removed. The funny thing is that the 10k resistors (part#150-10030) used for that purpose are still included with the newer kits if you are to go by the kit contents.

    So it looks like a 10k between the W and R of the QTI is what Parallax recommended but why they removed it in the docs·is a mystery.




    Post Edited (Propability) : 3/16/2010 10:36:28 PM GMT
  • WHallWHall Posts: 22
    edited 2010-03-16 23:20
    Since my earlier post, I've tried the 10k and still can't get a consistent read. :-( Not sure what might be going wrong... I'm pretty sure that I've wired it up correctly with a 20k resistor bridging the "w" and "r" sensor pins (see pic), but not sure what else might be at fault. I'm getting a solid stream of 1's at a variety of distances. Not sure where to go now, but I appreciate the reply, Propability.
  • PropabilityPropability Posts: 142
    edited 2010-03-16 23:31
    Just had a look at your setup on the breadboard and maybe the problem is that the QTI is not being connected to since it looks like it is on the other side of the breadboard from your wires but then how did you do the analog? The line down the middle seperates the breadboard into 2 halves.
  • WHallWHall Posts: 22
    edited 2010-03-17 00:15
    Thought the same thing and moved sensor, wires and resistors to one, then the other, side. I've tried a variety of resistors to shift the voltage. I still get solid 1's. Really stumped on this one. Have gone over the wiring and code again and again. I'm sure the solution is staring me in the face, but I'll be darned if I can see it now :-\ Thanks for the suggestions, though!
  • PropabilityPropability Posts: 142
    edited 2010-03-17 01:56
    Re-Hook it up for analog readings as you say you were able to do just to make sure that nothing got buggered in the process of trying different things.

    From what I see the QTI being driven from an IO pin would be for power saving and not really a necessity if you are not worried about battery consumption.

    What I have done is power the QTI from Vdd (the W pin of the QTI is the power pin not the signal pin -why did they do that?).

    The B pin of the QTI to Vss(ground).

    The R pin of the QTI to a stamp pin for both output and input (for rctime measurement).

    To make it flexible I also have the R pin hooked up to another stamp pin thru(in series) a

    10k resistor.

    That way I can I can still do rctime by disabling the pin that is hooked up to the resistor but I can also do digital by setting that pin high .

    Hope this helps.
  • WHallWHall Posts: 22
    edited 2010-03-23 21:29
    Propability, just wanted to let you know that the 10k resistor did the trick. I'm getting a lovely string of one's and zero's now. smile.gif
Sign In or Register to comment.