Activity 6: Drop-off Detector

Up until now, your robot has mainly been programmed to take evasive maneuvers when an object is detected.  There are also applications where the BOE Shield-Bot must take evasive action when an object is not detected.  For example, if the BOE Shield-Bot is roaming on a table, its IR detectors might be looking down at the table surface.  The sketch should make it continue forward so long as both IR detectors can “see” the surface of the table.

  • Disconnect power and programming cable.
  • Point your IR object detectors downward and outward as shown above.

IR emitter and receiver on BOE Shield-Bot pointed downward to detect a drop-off

Recommended Materials:

(1) Roll of black vinyl electrical tape,  ¾″ (19 mm) wide, or black tempera paint and brush.
(1) Sheet of white poster board,  22 x 28 in (56 x 71 cm).

Simulating a Drop-Off with Poster Board

A sheet of white poster board with a border made of electrical tape or black tempera paint makes for a handy way to simulate the drop-off presented by a table edge, with much less risk to your BOE Shield-Bot. 

  • Build a course similar to the electrical tape delimited course shown in Figure 7‑12.  For electrical tape, make a small test patch on a piece of paper first to make sure the infrared detectors cannot see a reflection from it.  If it does not reflect infrared, use three strips edge to edge on the poster board with no paper visible between the strips.
  • Run the sketch IrInterferenceSniffer to make sure that nearby fluorescent lighting will not interfere with your BOE Shield-Bot’s IR detectors.
  • Use TestBothIrAndIndicators to make sure that the BOE Shield-Bot detects the poster board but does not detect the electrical tape or paint.

Rows of black electrical tape applied near the edges of white poster board simulate a drop-off

If the BOE Shield-Bot still "sees" the electrical tape too clearly, here are a few remedies:

  • Try adjusting the IR detectors and LEDs downward at shallower angles.
  • Try a different brand of vinyl electrical tape.
  • Try replacing the 2 kΩ resistors with 4.7 kΩ (yellow-violet-red) resistors to make the BOE Shield-Bot more nearsighted.
  • Adjust the tone command with different frequency arguments.  Here are some arguments that will make the BOE Shield-Bot more nearsighted: 39000, 40000, 41000.

If you are using older IR LEDs, the BOE Shield-Bot might actually be having problems with being too nearsighted.  Here are some remedies that will increase the BOE Shield-Bot’s sensitivity to objects and make it more far sighted:

  • Try replacing the 2 kΩ (red-black-red) resistors with 1 kΩ (red-black-brown) or even 470 Ω (yellow-violet-brown) resistors in series with the IR LEDs instead of 2 kΩ.
  • Try pointing the IR LEDs and detectors downward at a steeper angle so that the bot is looking at the surface right in front of it.

If you try a tabletop after success with the electrical tape or paint course:

  • Remember to follow the same steps you followed before running the BOE Shield-Bot in the electrical tape or paint delimited course!

Make sure to be the spotter for your BOE Shield-Bot.  It’s best to keep your hand poised so that you are ready to pick it up from above.  Be ready as your BOE Shield-Bot roams the tabletop:

  • Always be ready to pick your BOE Shield-Bot up from above as it approaches the edge of the table it’s navigating.  If the BOE Shield-Bot tries to drive off the edge, pick it up before it takes the plunge.  Otherwise, your BOE Shield-Bot might become a Not-Bot!
  • Your BOE Shield-Bot may detect you if you are standing in its line of sight.  Its current sketch has no way to differentiate you from the table below it, so it might try to continue forward and off the edge of the table.  So, stay out of its detector’s line of sight as you spot.