Author Topic: hooking up QTI sensor?  (Read 7129 times)

0 Members and 1 Guest are viewing this topic.

Offline BANETopic starter

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
hooking up QTI sensor?
« on: August 16, 2008, 06:41:58 PM »
Hello, I can't seem to get my QTI http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/txtSearch/qti/List/1/ProductID/100/Default.aspx?SortField=ProductName%2cProductName to work right.
What is the correct way to connect this to a microcontroller?  I have it connected to two I/O pins and the other ground (of course in the right order).  And maybe some sample code in Basic.

Thanks

Bane

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: hooking up QTI sensor?
« Reply #1 on: August 16, 2008, 07:44:32 PM »
If I remember correctly from when I used my line sensors the three wire interface is GND, PWR , and signal. Signal needs a ADC.

Take a cellphone camera or any camera and see if IR light is being emitted.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
Re: hooking up QTI sensor?
« Reply #2 on: August 17, 2008, 12:15:18 AM »
B: goes to ground
R: is the signal wire (weird I know)
W: is connected to power

you should also connect a 10k resistor between R and W.  The 10k resistor is a pullup which allows for a digital output HIGH for black and 0 fr white.  With this same setup you could connect the signal wire to an adc to use it as an analog sensor. 

Parallax recommends that you should use 2 i/o pin for one sensor.  The reason is you can prevent interference from multiple sensors if you only turn on one at a time.  I advise using 1 i/o per qti, and isolate each sensor.

To check if your sensor is working use a camera to see if the ir light turns on.  All digital cameras , as far as I know, are able to see ir light, as a bright white blob.  If you want to make sure your camera can see ir you can just point a tv remote at the camera and push any button.

***NOTE***
make sure the sensor is in pretty close proximity to what ever you are analyzing.

Offline BANETopic starter

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: hooking up QTI sensor?
« Reply #3 on: August 17, 2008, 03:49:57 PM »
Oh thanks, i definently had it wrong :P   
Quote
I advise using 1 i/o per qti, and isolate each sensor.
  How?  Would you just always have the IR emitter on and just read the receivers signal?

Quote
To check if your sensor is working use a camera to see if the ir light turns on.  All digital cameras , as far as I know, are able to see ir light, as a bright white blob.  If you want to make sure your camera can see ir you can just point a tv remote at the camera and push any button.
Yea, there IR

So Parallax uses a FREQOUT command to the IR emitter and then reads the reciever.  Is that correct?  Do i need a analog pin for the receiver?

Thanks

Bane   

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: hooking up QTI sensor?
« Reply #4 on: August 17, 2008, 08:02:05 PM »
B: goes to ground
R: is the signal wire (weird I know)
W: is connected to power

you should also connect a 10k resistor between R and W.  The 10k resistor is a pullup which allows for a digital output HIGH for black and 0 fr white.  With this same setup you could connect the signal wire to an adc to use it as an analog sensor. 

Parallax recommends that you should use 2 i/o pin for one sensor.  The reason is you can prevent interference from multiple sensors if you only turn on one at a time.  I advise using 1 i/o per qti, and isolate each sensor.

To check if your sensor is working use a camera to see if the ir light turns on.  All digital cameras , as far as I know, are able to see ir light, as a bright white blob.  If you want to make sure your camera can see ir you can just point a tv remote at the camera and push any button.

***NOTE***
make sure the sensor is in pretty close proximity to what ever you are analyzing.

Warning! This sensor is done so there is no need to add any components, allready has the pull-up resistor, the series resistor for the IR Led and a 0.1uF capacitor for filtering. The pins are labeld as the pins of a servo wire: B for Black (ground), R for Red (+5V), W for white (signal). All you need is a servo extension wire to hook it up to the Axon or for the $50 robot. The signal is digital, does not need a analog port. Anyway, why waste a few miliseconds for the analog conversion when you can get the result instantly with a digital port? This is what you need for line following or sumo!
Check out the uBotino robot controller!

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: hooking up QTI sensor?
« Reply #5 on: August 17, 2008, 08:04:46 PM »
Well the QTI sensor can also detect shades of colors , so perhaps ADC is necessary . But for  line following  digital is fine .
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline sonictj

  • Supreme Robot
  • *****
  • Posts: 416
  • Helpful? 11
Re: hooking up QTI sensor?
« Reply #6 on: August 18, 2008, 12:54:09 AM »
to Ro-Bot-X

The qti sensors are not like a servo wire. they should be but they are NOT, thats why I commented that it was weird.  I checked the datasheets and talked to a parallax representative over the phone.  The sensor also does not have the pullup resistor on the board if you connect it as is you will not get a signal I did this just about a week ago.

This is from the datasheet http://www.parallax.com/Portals/0/Downloads/docs/prod/compshop/qtilinesensorrev1.pdf

Quote
The QTI sensor is activated by placing 5 V (Vdd) on the W pin. This will cause current to flow through the 470 ohm resistor to the LED side of the QRD1114. IR light reflecting of the surface below will cause a change in the ability for the current to flow through the phototransistor side of the QRD1114. The transistor, in effect, behaves like an IR controlled resistance.


if you apply power to the red pin you may fry the sensor.  I have 2 of these on my current robot I promise I know what I am talking about.

here is another useful document http://www.parallax.com/Portals/0/Downloads/docs/prod/robo/28108-QTILineFollower-v1.1.pdf

I believe the reason for the odd labeling is because parallax intends you to hook an output signal to the S pin, and an input Signal on the R pin.

I currently have 2 sensors hooked up with ADCs so that I can detect shades of gray.

Quote
  How?  Would you just always have the IR emitter on and just read the receivers signal?

yes thats what I've been doing.
« Last Edit: August 18, 2008, 12:57:16 AM by sonictj »

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: hooking up QTI sensor?
« Reply #7 on: August 18, 2008, 05:23:59 AM »
Oops, my bad. So far, that's the oddest thing from Parralax. This time they didn't make a sensor to be intuitive. The way I've explained it, that's how I've done it for a friend's project. My appologies for not completly doing my homework.

So you're detecting shades of grey? Cool. I was using that to make a line follower with just one sensor, using hysteressis to keep it right there on the edge of the line. That was nice, but slow, and my robot was somewhere in the middle of the loser's pack. I would use 3 or better 5 digital sensors for line following now.
Check out the uBotino robot controller!

Offline BANETopic starter

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: hooking up QTI sensor?
« Reply #8 on: August 18, 2008, 02:47:41 PM »
So then I do need a analog pin then to detect variation in signal :P

Its nice to know I'm not the only one confused on this :D

Bane

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: hooking up QTI sensor?
« Reply #9 on: August 18, 2008, 04:45:51 PM »
i looked at the basic code they have listed and it looks like you just bring the pin high (activate it), then wait (while the resistance adjusts), then take a reading, and then bring it low (deactivate it)



Offline BANETopic starter

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: hooking up QTI sensor?
« Reply #10 on: August 18, 2008, 05:51:39 PM »
Quote
then take a reading,
meaning analog reading?

Bane

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: hooking up QTI sensor?
« Reply #11 on: August 18, 2008, 05:54:45 PM »
yes
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline BANETopic starter

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: hooking up QTI sensor?
« Reply #12 on: August 21, 2008, 04:20:59 PM »
thanks all :)

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: hooking up QTI sensor?
« Reply #13 on: August 22, 2008, 09:43:22 AM »
did it end up working?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline BANETopic starter

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: hooking up QTI sensor?
« Reply #14 on: August 23, 2008, 11:04:20 AM »
I hooked it up as you guys said and it the IR did come on, however I'm still not get a valid value when I debug.  Ive tried using a byte and Im trying a word right now.  A little more testing and I'll get it to work.  It was mainly the hooking up part that confused me.  I'll post my code when i get it.

Bane

Offline BANETopic starter

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: hooking up QTI sensor?
« Reply #15 on: August 23, 2008, 08:18:36 PM »
this code works :)  Although the range seems pretty short :P

Quote
'PARALLAX QTI SENSOR SYSTEM TEST

QTI VAR WORD


LOOP
HIGH P1
HIGH P0
PAUSE 1
RCTIME P1,0,QTI
LOW P0
DEBUG [DEC QTI, 13]
PAUSE 200
GOTO LOOP

Offline BANETopic starter

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: hooking up QTI sensor?
« Reply #16 on: August 23, 2008, 08:26:18 PM »
Oh and i only used two I/O pins :D

Bane

 


Get Your Ad Here