background image

Copyright © Parallax Inc.

 

 

Infrared Line Follower Kit (#28034) 

v1.0  1/18/2011  Page 8 of 9 

Calibration  

Different lighting conditions, mounting positions or changes in temperature may require different 

frequency settings. For this reason, the Infrared Line Follower has a user selectable infrared frequency 

range of 38-43 kHz using an onboard potentiometer. If you are having problems reading a line when 

running the test code, place all IR detectors over a black surface and gently adjust the onboard 
potentiometer until all eight red LEDs are off. 

 

Note:

 A small flathead screwdriver is required to adjust the frequency range. The Parallax screwdriver 

included in the Boe-Bot and Stingray robot kits is usually sufficient. 

Boe-Bot Robot Line Following Code 

The code below can be used for simple Boe-Bot line following applications, and is compatible with the 

circuit shown in Figure 1. Keep in mind that this is not the most robust line following code, which can and 

should be expanded to better fit your needs.  

 

' InfraredLineFollower_BoeBot.bs2 
' Simple line following Boe-Bot code using the Infrared Line Follower. 
 
' {$STAMP BS2} 
' {$PBASIC 2.5} 
 
DO 
  SELECT INL                                  ' Select line follower states 
    CASE %11000000, %11100000                 ' Pivot right 
      PULSOUT 13, 650 
      PULSOUT 12, 650 
    CASE %01100000, %01110000                 ' Curve right 
      PULSOUT 13, 700 
      PULSOUT 12, 650 
    CASE %00110000                            ' Slight right 
      PULSOUT 13, 750 
      PULSOUT 12, 650 
    CASE %00111000                            ' Adjust right 
      PULSOUT 13, 800 
      PULSOUT 12, 650 
    CASE %00011000                            ' Straight 
      PULSOUT 13, 850 
      PULSOUT 12, 650 
    CASE %00011100                            ' Adjust left 
      PULSOUT 13, 850  
      PULSOUT 12, 700 
    CASE %00001100                            ' Slight left 
      PULSOUT 13, 850 
      PULSOUT 12, 750 
    CASE %00000110, %00001110                 ' Curve left 
      PULSOUT 13, 850 
      PULSOUT 12, 800 
    CASE %00000011, %00000111                 ' Pivot left 
      PULSOUT 13, 850 
      PULSOUT 12, 850 
  ENDSELECT 
LOOP

 

Summary of Contents for 28034

Page 1: ...nly needs to read the state of each IR receiver to detect white or black surfaces An Enable pin is also included which when pulled low puts the Infrared Line Follower into low power mode Features Compatible with both the Boe Bot and Stingray robots from Parallax Onboard 3 V regulator for easy use with Propeller powered robots Easily adjust 38 43 kHz IR frequency using an onboard potentiometer See ...

Page 2: ...ack surface no light is reflected to the IR receiver and its output is high The voltage regulator included on the PCB limits the power to the Infrared Line Follower s circuitry to 3 V This means that a 5 V supply can safely be used with microcontrollers operating at 3 3 V Red LEDs located on the top of the board are wired to the output of each IR receiver and the anode of each LED is connected to ...

Page 3: ... you will need a strip of black electrical tape on white paper Boe Bot Assembly Instructions To mount the Infrared Line Follower on your Boe Bot robot you will need the following materials 2 7 8 4 40 pan head screws 2 1 4 4 40 pan head screws 2 1 round standoffs 2 1 2 round spacers Step 1 Insert the 7 8 screws through the top of the Boe Bot chassis through the left and right slots at the front Ste...

Page 4: ...o the screws The Infrared Line Follower should be facing downward with the headers pointing toward the tail wheel Stingray Assembly Instructions To mount the Infrared Line Follower on your Stingray you will need the following materials 2 7 8 4 40 pan head screws 2 1 2 round spacers 2 4 40 x 3 8 nuts Step 1 Remove the front Stingray plate and insert the 7 8 screws through the top of the chassis thr...

Page 5: ...ng downward with the headers pointing toward the tail wheel Pin Definitions Pin Name Type Function 1 GND G Ground 0V 2 Vdd P Supply Voltage 3 EN I Enable pin pull low for low power mode 4 OUT0 O Output state of IR receiver 0 5 OUT1 O Output state of IR receiver 1 6 OUT2 O Output state of IR receiver 2 7 OUT3 O Output state of IR receiver 3 8 OUT4 O Output state of IR receiver 4 9 OUT5 O Output sta...

Page 6: ...age Go to www parallax com and search 28230 Figure 1 Infrared Line Follower Quick Start Circuit BASIC Stamp 2 Example Code The program InfraredLineFollower_Simple bs2 will test the Infrared Line Follower sensors before they re used in a line following application Follow the instructions below to test that all 8 sensors are working correctly Affix a 3 4 piece of electrical tape on a white piece of ...

Page 7: ... over the electrical tape and the other sensors over the white paper The Parallax Serial Terminal should read 00000001 and the S0 LED should be off Repeat this process until all eight sensors are tested If your sensor doesn t display a logical 1 when over a black line and logical 0 when over a white line check your connections and or try adjusting the frequency in the Calibration section on page 8...

Page 8: ...ow can be used for simple Boe Bot line following applications and is compatible with the circuit shown in Figure 1 Keep in mind that this is not the most robust line following code which can and should be expanded to better fit your needs InfraredLineFollower_BoeBot bs2 Simple line following Boe Bot code using the Infrared Line Follower STAMP BS2 PBASIC 2 5 DO SELECT INL Select line follower state...

Page 9: ...ected to P25 MotorB 26 Motor B connected to P26 VAR byte DutyCycleA DutyCycleB state OBJ PWM PWM_32_V2 spin PUB Main PWM Start Start PWM object dira 7 0 Set pins 7 0 as input repeat state ina 7 0 Set input states to variable state case state 00000011 00000001 00000010 Pivot left DutyCycleA 65 DutyCycleB 0 00000111 00000110 00000100 Slight left DutyCycleA 60 DutyCycleB 0 00001110 00001100 Adjust le...

Page 10: ...Mouser Electronics Authorized Distributor Click to View Pricing Inventory Delivery Lifecycle Information Parallax 28034 ...

Reviews: