Web Site: www.parallax.com Office: (916) 624-8333 Forums: forums.parallax.com Fax: (916) 624-8003 Sales: sales parallax.com Sales: (888) 512-1024 Technical: support parallax.com Tech Support: (888) 997-8267 QTI Line Follower AppKit for the Boe-Bot ( 28108) Boe-Bot Line Following with QTIs The QTI sensor is a close-proximity infrared emitter and receiver pair mounted on a tiny PCB. It can be used as an analog sensor to differentiate between different levels of infrared reflectivity. It can also be used as a purely digital device that returns a 1 when it detects a black line or a 0 if it detects a white background. An array of four QTI sensors used as digital devices makes an effective and flexible line-follower for the Boe-Bot robot. The QTI positions are adjustable for different sizes and types of lines. This activity demonstrates how the QTIs can be used for digital line following on a simple 3/4- inch wide electrical tape course with a white background. For an in-depth look at how the QTI sensors function, and for the complete QTI Line Follower source code, see the Stamps in Class Mini Projects sticky-thread at the top of the Stamps in Class forum at on A Closer Look at the QTI The QTI module is designed for close proximity infrared (IR) detection. Take a look at the small square black box just above the QTI label. Its nested below the capacitor and between the two resistors. Thats a QRD1114 reflective object sensor. Theres an infrared diode behind its clear window and an infrared transistor behind its black window. When the infrared emitted by the diode reflects off a surface and returns to the black window, it strikes the infrared transistors base, causing it to conduct current. The more infrared incident on the transistors base, the more current it conducts. When used as an analog sensor, the QTI Vdd = 5 VCD can detect shades of gray on paper and Vss = 0 V (ground) distances over a short range if the light in the room remains constant. With this circuit, you can set P3 high and then test it with RCTIME to measure how long it takes the capacitor to discharge through the IR transistor. Since the IR transistor AnalogQti.bs2 conducts more or less current depending STAMP BS2 PBASIC 2.5 on how much IR it receives, the RCTIME measurement can give you an indication time VAR word of distance or shade of gray. DO If all you want to know is whether a line is HIGH 3 RCTIME 3, 1, time black or white, the QTI can also be DEBUG CLS, time converted to a digital sensor. This is how PAUSE 100 the array of four QTI sensors will be used LOOP later in our Boe-Bot line-following application. When W is connected to Vdd and B is connected to Vss, the R terminals voltage will drop below 1.4 V when the IR transistor sees infrared reflected from the IR LED. When the IR LEDs signal is mostly absorbed by a black surface, the voltage at R goes above 1.4 V. Since the BASIC Stamp interprets any voltage above 1.4 V as 1 and any voltage below 1.4 V as 0, this circuit gives us a quick and easy way to detect a black line on a white background. Mounting the QTIs 1. Match the components in your kit to the Kit Contents above to make sure all pieces are present. If anything is missing, contact Parallax Tech Support. 2. Referring to the picture on the next page, insert the 7/8-inch screws through the top of the Boe- Bot chassis, at the three slots near the front. Two screws will go through the center slot, and one screw each in the right and left slots. 3. On the underside of the chassis, slip a 1/2-inch unthreaded spacer on each screw, followed by a 1-inch threaded standoff. Copyright Parallax Inc. QTI LIne Follower AppKit ( 28108) v2.0 3/23/2009 Page 2 of 6