Shop OBEX P1 Docs P2 Docs Learn Events
Object for QTI Line Sensor. — Parallax Forums

Object for QTI Line Sensor.

KyeKye Posts: 2,200
edited 2010-03-10 22:58 in Propeller 1
Hey everyone and parallax.

I uploaded a QTI Line Sensor driver to the OBEX.

http://obex.parallax.com/objects/584/

The driver runs 8 QTI line sensors at once. It gives back an 8 bit value for each sensor that has been inverted so that dark surfaces show up·near 0 and lighter surfaces show up near 255.

The driver also allows you to set a threshold for each sensor so that you can get a digital value back from them.

The driver gets about 500 samples per second per channel.

...

I developed this driver for a line following competition that Carngie Mellon Univeristy host every year called Mobot. I'll be showing off the String Ray robot there. Hopefully I'll win. (The string ray robot works great with QTI line sensors. I'll be posting my project up once I finish it. You have to hack the robot controller board however as the 5V to 3V converters are in the way.)

Anyway, when I was looking for other drivers for QTI line sensors I noticed that there were none avialable so this should be a nice addition to the OBEX. I also noticed a link on the QTI line sensor sales page which links to nothing.

If parallax wants to test out my driver and link to it on their product page that is fine with me.

Cheers.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Post Edited (Kye) : 3/5/2010 9:52:27 PM GMT

Comments

  • mikedivmikediv Posts: 825
    edited 2010-03-05 20:35
    Kye that's very cool thank you sir for sharing your work
  • Let's Go!Let's Go! Posts: 124
    edited 2010-03-05 22:14
    good luck. what color are the lines you are following? jim

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The smarter I get, the more I understand I don't know!
  • Let's Go!Let's Go! Posts: 124
    edited 2010-03-05 22:15
    sorry, what color are both the surfaces, i.e. the lines and the outside of the lines. thanks, jim

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The smarter I get, the more I understand I don't know!
  • KyeKye Posts: 2,200
    edited 2010-03-06 02:26
    Its a white line on concrete over a few hills outdoors. The course is pretty unforgiving.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • Let's Go!Let's Go! Posts: 124
    edited 2010-03-06 06:56
    best of luck in the contest..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The smarter I get, the more I understand I don't know!
  • nohabnohab Posts: 96
    edited 2010-03-08 18:52
    Great, sensing 8 QTI with one cog!

    What if I don't have exactly 8? Maybe 4 or something...
    Can I specify -1 for unused QTI-pins, or are there any other way to reduce the capacity?
    (except deleting assembly lines...)
  • KyeKye Posts: 2,200
    edited 2010-03-08 22:08
    If you look in the asm you'll find a variable called outputmask. Delete the lines you don't need from that variable.

    I thought about putting in a variable allowing you to turn off unused lines but it got awkward really quickly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • John AbshierJohn Abshier Posts: 1,116
    edited 2010-03-08 22:25
    Kye, it looks like you are setting the output/input status of all 32 pins, not just the pins connected to the QTIs.

    John Abshier
  • KyeKye Posts: 2,200
    edited 2010-03-09 05:54
    I shouldn't be setting the status of all 32 I/O pins. The "outputMask" variable is used to only select the pins you specify.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • nohabnohab Posts: 96
    edited 2010-03-09 13:13
    Thanks !
  • John AbshierJohn Abshier Posts: 1,116
    edited 2010-03-09 15:43
    My mistake, sorry.

    John Abshier
  • DigitalJayBirdDigitalJayBird Posts: 9
    edited 2010-03-10 18:25
    Kye, thank you very much for creating this object.

    I thought I would give it a try but I don't think I'm using the object correctly. I am using the·attached code, the·propeller demo board·and the·QTI hooked up per the schematic included with·the object (pin 0 to W, VDD to R·and GND to B). I receive a reading of 250 regardless of the surface the QTI is looking at. The object shows 3.3v but the data sheet for the QTI shows a 5v requirement. Could that be the problem?

    Any help would be appreciated.

    Jay
  • KyeKye Posts: 2,200
    edited 2010-03-10 22:46
    RTFM... =)

    The QTI line senor has white as the power and red as the sensor input.

    It works with 3.3v also, 5v works better of course.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • DigitalJayBirdDigitalJayBird Posts: 9
    edited 2010-03-10 22:58
    That was the problem. Thanks for your help Kye.

    Jay
Sign In or Register to comment.