QTI Line Follower AppKit for the Boe-Bot (#28108)

Similar documents
Writing Programs INTRODUCING THE BASIC STAMP EDITOR 2 SCRIBBLER HARDWARE PROGRAMMING CONNECTIONS 8 BLINKING THE LIGHTS WITH PROGRAM LOOPS 9

Laboratory 11. Required Components: Objectives. Introduction. Digital Displays and Logic (modified from lab text by Alciatore)

MOD028 GLOCKENSPIEL TECHNO-MUSIC-OLOGY

Laboratory 8. Digital Circuits - Counter and LED Display

Build Your Own Clone Super 8 Kit Instructions

Part (A) Controlling 7-Segment Displays with Pushbuttons. Part (B) Controlling 7-Segment Displays with the PIC

(Skip to step 11 if you are already familiar with connecting to the Tribot)

Data Acquisition Using LabVIEW

Revision 1.2d

Laboratory 9 Digital Circuits: Flip Flops, One-Shot, Shift Register, Ripple Counter

Informatics Enlightened Station 1 Sunflower

Introduction 1. Green status LED, controlled by output signal ST. Sounder, controlled by output signal Q6. Push switch on input D6

DX-10 tm Digital Interface User s Guide

Your EdVenture into Robotics You re a Controller

NewScope-7A Operating Manual

TCS230 Color Sensor "Tuna Can" Compass by Philip C. Pilgrim, Bueno Systems, Inc.

Bionic Elephant Trunk. Assembly Instructions

Experiment 0: Hello, micro:bit!

General Wiring and Installation Guidelines. Typical Mounting Installations Electrical Connections General Guidelines Common Questions & Answers

EZCOM-1. PLC - to - AMS MESSAGE DISPLAY INTERFACE INSTALLATION AND OPERATING INSTRUCTIONS. Rev March, 2001

Multi-Key v2.4 Multi-Function Amplifier Keying Interface

CG-1 CAMERA-GUARD INSTRUCTION BOOK IB647501

UNIT V 8051 Microcontroller based Systems Design

Summit Systems Sound Board Modification

Azatrax Model Railroad Track Signal Control - Single Track

How To Build Megavolt s Small Buffered JTAG v1.2

Step What to do Expected result What to do if test fails Component tested 1 Visual inspection. Board is accurately assembled

AristoMig U320w 208/230/400/460/475/500 V 3~ 50/60 Hz With cooling unit and central connection

INSTALLATION INSTRUCTIONS WIRED REMOTE CONTROL USING TWISTED PAIR AND COAX CABLE U-WRC-U-x

ANTUMBRA FADE MANUAL

INSTALLATION INSTRUCTIONS WIRED REMOTE CONTROL USING COAX CABLE U-WRC-C

Alice EduPad Board. User s Guide Version /11/2017

Inputs and outputs. Connecting leads. Buzzer

006 Dual Divider. Two clock/frequency dividers with reset

Assembling the BS1/LCD Serial Backpack Kit

Your EdVenture into Robotics You re a Programmer

8 PIN PIC PROGRAMMABLE BOARD (DEVELOPMENT BOARD & PROJECT BOARD)

Pelican PL-957. Adding additional Tos Link (Digital Optical) inputs, and / or IR Remote

Nixie Clock Kit IN-12B color LED backlit Operation Manual Nixie Clock Kit IN-12B V6.0 ( All Right Reserved 2015 )

Activity #5: Reaction Timer Using the PIN and CON commands Real World Testing Chapter 3 Review Links

Industrial Monitor Update Kit

Lesson Sequence: S4A (Scratch for Arduino)

On-screen display signal strength meter Version 1.02

Electrical connection

TKEY-K16. Touch CW automatic electronic keyer. (No moving parts no contacts) Assembly manual. Last review: March 15, 2018

Preface. About SunFounder. About Super Kit. Free Support

Contents Section 9, Illustrated Parts

Mal-2 assembly guide v1.0

7 SEGMENT LED DISPLAY KIT

MAIN PCB (The small one) OPEN MAIN BOARD BAG A

Bill of Materials: Super Simple Water Level Control PART NO

Dust Sensor using GP Y

Introduction 1. Green status LED, controlled by output signal ST

Introduction 1. Digital inputs D6 and D7. Battery connects here (red wire to +V, black wire to 0V )

Commissioning Guide. firepickdelta. Commissioning Guide. Written By: Neil Jansen firepickdelta.dozuki.com Page 1 of 22

GUIDE TO ASSEMBLY OF ERICA SYNTHS DELAY MODULE

TeamWork Kits Installation Guide

MODULAR DIGITAL ELECTRONICS TRAINING SYSTEM

ECE 372 Microcontroller Design

Main PCB (The small one)

MSS-CASCADE User Manual

Single sensor setup with NIVEL210

W0EB/W2CTX DSP Audio Filter Operating Manual V1.12

HC20 Healthcare Kit Installation Instructions

RST INSTRUMENTS LTD.

uresearch GRAVITECH.US GRAVITECH GROUP Copyright 2007 MicroResearch GRAVITECH GROUP

INSTRUCTIONS e

Studio DMX Decoders. Part numbers: DMX , DMX , DMX

Materials: Programming Objectives:

Spring 2011 Microprocessors B Course Project (30% of your course Grade)

Building the BX24-AHT

Flat-Bed Module Recorders

PASS. Professional Audience Safety System. User Manual. Pangolin Laser Systems. November 2O12

SHUTTLE WITH INFRA-RED DETECTION SAS2-IR

Summer Grocery Shopping Assistant for the Visually Impaired(Grozi) Joo Byoung (Ave) Park Client: National Federation of the Blind.

TeamWork Installation Guide

2002, Cisco Systems, Inc. All rights reserved.

Rocket Kit #1. Illuminated Display Model. Zifnu Electronics LLC.

Endurance Robotics PT-3

Scale Track System. 21 Century y Signal System 2-Rail Manual

OPERATION NOTES FOR PSIDEX AUDIO PGP-1A PRE-AMPLIFIER DESCRIPTION INSTALLATION

spider a bit of information

ECB DIGITAL ELECTRONICS PROJECT BASED LEARNING PROJECT REPORT ON 7 SEGMENT DIGITAL STOP WATCH USING DECODER

PHYS 3322 Modern Laboratory Methods I Digital Devices

ELECTRONICS CORP. VOD715 Drop Down Video Monitor with DVD FM SELECT PAUSE L R. Installation Guide

AUTOMATIC VIDEO LOSS A/B SWITCH

Senior Design Project: Blind Transmitter

The Micropython Microcontroller

TECHNOLOGY WILL SAVE US: THE LUMIPHONE

This module senses temperature and humidity. Output: Temperature and humidity display on serial monitor.

Complete Train Control. Run Your Trains, Not Your Track!

SN-Class Nixie Clock Kits

Using Sliders with the 4201-B Lighting Controller Application Note June 26, 2008

Lab 7: Soldering - Traffic Light Controller ReadMeFirst

LABORATORY # 1 LAB MANUAL. Digital Signals

RAKK dac. RAKK dac Mark IV. RAKK dac Mark IV. Assembly and Installation Manual

Chapter 4: One-Shots, Counters, and Clocks

TeamWork 601 Kit Installation Guide

SPECIAL SPECIFICATION 1291 Fiber Optic Video Data Transmission Equipment

Lynx Broadband Installation Manual for Residential Packages with a 35 db Amp Quick Start Guide (first 3 pages)

Transcription:

Web Site: www.parallax.com Forums: forums.parallax.com Sales: sales@parallax.com Technical: support@parallax.com Office: (916) 624-8333 Fax: (916) 624-8003 Sales: (888) 512-1024 Tech Support: (888) 997-8267 QTI Line Follower AppKit for the Boe-Bot (#28108) Boe-Bot Line Following with QTIs Just one of the many Boe-Bot robot QTI sensor applications is line following. QTIs are inexpensive and great for line following because you can adjust their position, add or remove detectors, and use them in different ways depending on the course. The QTIs were originally developed for the Parallax SumoBot robot, where they are used to detect the white edge around the competition ring. The SumoBot Manual demonstrates how QTI modules can be used as analog sensors with the RCTIME command. By adding a resistor to the QTI circuit, you can make the sensor a purely digital device that returns a 1 when it detects a black line or a 0 if it detects a white background. 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 a faster line-following application using all 4 QTI sensors, check out the Stamps in Class Mini Projects at http://forums.parallax.com. Kit Contents Part # Description Qty 805-00001 10-inch 3-lead extension cable 4 800-00016 3-inch jumper wires (bag of 10) 2 150-01030 Resistor - 10 kω 4 555-27401 QTI sensor 4 451-00303 3-pin male-male header 4 710-00007 7/8-inch screw, pan head, 4-40 4 700-00060 Standoff, round, 1-inch, 4-40 4 713-00007 Spacer, round, 1/2 inch 4 700-00002 3/8-inch screw, pan head, 4-40 4 700-00015 Washer, nylon, #4 4 For this activity, you will need to supply your own: Built and tested Boe-Bot ¾-inch electrical tape poster board Copyright Parallax, Inc. QTI Line Follower Kit (#28108) v1.1 8/10/2007 Page 1 of 6

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. It s nested below the capacitor and between the two resistors. That s a QRD1114 reflective object sensor. There s 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 transistor s base, causing it to conduct current. The more infrared incident on the transistor s base, the more current it conducts. When used as an analog sensor, the QTI can detect shades of gray on paper and distances over a short range if the light in the room remains constant. With this circuit, you can set 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 conducts more or less current depending on how much IR it receives, the RCTIME measurement can give you an indication of distance or shade of gray. If all you want to know is whether a line is black or white, the QTI can be converted to a digital sensor by adding a 10 kω resistor across its W and R terminals. After doing so, the QTI behaves similarly to the circuit on the right below. ' AnalogQti.bs2 ' {$STAMP BS2} ' {$PBASIC 2.5} time VAR word DO HIGH 3 RCTIME 3, 1, time DEBUG CLS,? time PAUSE 100 LOOP When W is connected to Vdd and B is connected to, the R terminal s voltage will drop below 1.4 V when the IR transistor sees infrared reflected from the IR LED. When the IR LED s 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. Copyright Parallax, Inc. QTI Line Follower Kit (#28108) v1.1 8/10/2007 Page 2 of 6

Mounting the QTIs Use the 7/8-inch screws to attach the 1/2-inch spacers and 1-inch standoffs to the underside of the chassis. Use the 3/8-inch screws to attach the QTIs and nylon washers to the other ends of the standoffs. As with the rest of the Boe-Bot material, you can also imagine yourself sitting in the Boe-Bot's driver seat. When you look down over the front of the breadboard, you will see the left, center, and right QTIs. Left Center Right Connect each servo extension cable to a QTI sensor, making sure the black wire lines up with the "B", the red wire lines up with the "R", and the white wire lines up with the "W" on the QTI. Pull the cables through the large hole in the Boe-Bot chassis one at a time. It s between the servos and should be lined with a rubber grommet. Label the cables, L for left, C for Center, and R for right. Copyright Parallax, Inc. QTI Line Follower Kit (#28108) v1.1 8/10/2007 Page 3 of 6

Building the Sensing Circuits If you apply 5 V to a QTI's W pin, its R pin will rise above 1.4 V if it detects a black surface, or fall below 1.4 V if it detects a white surface. In other words, the QTI sends a binary-1 if it does not see its IR reflection or a binary-0 if it does. Only one QTI should be turned on at any given time to make sure that one QTI doesn't see the reflection of another QTI's IR signal. With this rule in mind,,, and each connect to a QTI's W pin. connects to the right QTI, to the center QTI, and to the left QTI. All the B pins are tied to. All the R pins are tied together and connected to. We'll turn each QTI on, one at a time, read, and then turn that QTI off again. If the QTI that receives 5 V sees it reflection, it will drive the voltage at low; otherwise, it will be pulled high by the 10 kω resistor. Insert the 3-pin headers into the breadboard. Add the resistors and jumper wires as shown. Plug the cables for the right, center and left QTIs into their corresponding 3-pin headers on the breadboard: Right to, Center to, Left to. Check to make sure you have your cables connected so that the black cable wires are connected to, the red cable wires are bussed to, and each cable s white wire is connected to,, or respectively. Double-check to make sure each cable is properly connected to its QTI (B = black wire, R = red, and W = white). X3 5 4 3 1 0 X2 Vdd Vin 9 Vdc Battery Sout Sin ATN 1 U1 6-9VDC STAMPS in CLASS TM Vin Rst Vdd 5 4 3 1 0 www.stampsinclass.com 0 4 Vdd To QTIs X1 Reset Pwr 1 3 5 Vin 0 1 2 5 4 3 1 0 X3 X2 15 14 Vdd 13 12 X4 Vdd Vin X5 Board of Education 2000-2003 To Servos QTI Cable Colors Copyright Parallax, Inc. QTI Line Follower Kit (#28108) v1.1 8/10/2007 Page 4 of 6

Testing for Line Detection It's a good idea to test all the sensors with the Debug Terminal before taking the Boe-Bot for a spin on the line following course. Affix a few inches of 3/4-inch wide electrical tape to a white sheet of paper, or use the test line to the right of the program listing. Enter and run QtiBwDetect.bs2 Place the left QTI directly over the electrical tape (and the other QTIs over white background). The Debug Terminal should read 100. Place the center QTI over the electrical tape; the Debug Terminal should display 010. Place the right QTI over the electrical tape; the Debug Terminal should display 001. Place the Boe-Bot so that the electrical tape is between the right and center QTIs; the Debug Terminal should display 011. Place the Boe-Bot so that the electrical tape or stripe is between the left and center QTIs; the Debug Terminal should display 110. If you had problems with two QTIs sensing 1 when only one of them should have, try adjusting the standoffs so that the QTIs are further apart. Not so far that you can get 000 when the line is between two QTIs though! On the other hand, if only one QTI sensed 1 when the stripe was between two of them, they may need to be positioned closer together. Otherwise, your Boe-Bot is ready for line following. ' QtiBwDetect.bs2 ' Boe-Bot detects electrical tape with 3 QTI modules. '{$STAMP BS2} '{$PBASIC 2.5} qtileft VAR Bit qticenter VAR Bit qtiright VAR Bit DO HIGH 5: PAUSE 1: qtiright = IN3: INPUT 5 HIGH 6: PAUSE 1: qticenter = IN3: INPUT 6 HIGH 7: PAUSE 1: qtileft = IN3: INPUT 7 DEBUG HOME, BIN1 qtileft, BIN1 qticenter, BIN1 qtiright PAUSE 100 LOOP Always keep in mind that each W (on/off) line is tied to an individual I/O pin (,, ), but all the R (sense) lines are tied to. The program turns on power to the right QTI with the command HIGH 5. PAUSE 1 allows time for the voltage at the QTI s R pin to settle to its final value. Then, the command qtiright = IN3 stores the output sensed by IN3 in the qtiright bit variable. INPUT 5 turns the right QTI off. The process repeats twice more, storing the output of the center QTI in the qticenter variable, and the output of the left QTI in the qtileft variable. The DEBUG command displays the binary QTI readings. The leftmost digit indicates the state of the left QTI, the center digit indicates the center QTI, and the right digit indicates the right QTI. PAUSE 100 is there to prevent serial buffer overload on slower computers. Copyright Parallax, Inc. QTI Line Follower Kit (#28108) v1.1 8/10/2007 Page 5 of 6

Simple Line-Following QtiLineFollow.bs2 is designed to start following a line as soon as you place the center QTI over the electrical tape. It will stop line following as soon as it runs out of electrical tape. Start with an easy course, like a large S shape as shown below. If the QTIs passed the "Testing for Line Detection" tests, it should navigate the course with ease. Enter and run QtiLineFollow.bs2. Place the Boe-Bot on the course so that in straddles the line with the center QTI over the electrical tape. If your left and right QTI's cables are reversed, the Boe-Bot will appear to try to jump off the line at the first opportunity. Otherwise, it should faithfully follow the line until it reaches the end of the tape. ' QtiLineFollow.bs2 ' Boe-Bot follows electrical tape with 3 QTI modules. '{$STAMP BS2} '{$PBASIC 2.5} qti VAR Nib DO Right: HIGH 5: PAUSE 1: qti.bit0 = IN3: INPUT 5 Center: HIGH 6: PAUSE 1: qti.bit1 = IN3: INPUT 6 Left: HIGH 7: PAUSE 1: qti.bit2 = IN3: INPUT 7 SELECT qti CASE %010 PULSOUT 13, 850 PULSOUT 12, 650 CASE %011 PULSOUT 13, 850 PULSOUT 12, 750 CASE %001 PULSOUT 13, 850 PULSOUT 12, 850 CASE %110 PULSOUT 13, 750 PULSOUT 12, 650 CASE %100 PULSOUT 13, 650 PULSOUT 12, 650 ENDSELECT PAUSE 20 LOOP ' Forward ' Pivot right ' Rotate right ' Pivot Left ' Rotate Left Instead of three bit variables, one nibble variable stores the three bit values. One bit is unused, but it will come in handy for working with four QTIs. The right QTI's output is stored in qti.bit0, the center in qti.bit1, and the left in qti.bit2. A SELECT...CASE statement examines the pattern of 1s and 0s in the qti variable, and then delivers servo pulses accordingly. Only five of the eight possible cases are evaluated, one for each individual QTI, one for left + center, and one for right + center. Try other courses to test the limits of the program. Try modifying the program to solve courses that the unmodified program could not solve. Modify the program so that it smoothes out the Boe-Bot's responses to changes in the line's direction. Your code should take steps toward a maximum speed each time it detects that a given pattern is detected. Detect intersections and make random turns. Add a fourth QTI and modify the SELECT...CASE so that the middle two QTIs follow the line, and the outer ones are only used for detecting sharper turns. Try line following with just two QTIs. How about with just one? Can you do it? Challenge a friend, or set up a Boe-Bot line following competition. For more Boe-Bot and QTI applications, check the Stamps in Class forum at http://forums.parallax.com. Copyright Parallax, Inc. QTI Line Follower Kit (#28108) v1.1 8/10/2007 Page 6 of 6