Datasheet

Chapter 7 Navigating with Infrared Headlights
228Robotics with the BOE Shield-Bot
Make sure the battery pack is connected to your Arduino and the BOE Shield’s
Power switch is set to 1.
Unplug your BOE Shield-Bot from the programming cable, and test again with
objects in the area where you plan to make it navigate.
Test the detection range with different colored objects. What colors, materials,
and surface textures can it detect only at closest range? What can it detect from
farther away?
Sniffing for IR Interference
You might have found that your BOE Shield-Bot said it detected something even though
nothing was in range. That may mean a nearby light is generating some IR light at a
frequency close to 38.5 kHz. It might also mean that direct sunlight streaming through a
window is causing false detections. If you try to have a BOE Shield-Bot contest or
demonstration near one of these light sources, your infrared systems could end up
performing very poorly! So, before any public demo, make sure to check the prospective
navigation area with this IR interference “sniffer” sketch ahead of time.
The concept behind this sketch is simple: don’t transmit any IR through the IR LEDs, just
monitor to see if any IR is detected. If IR is detected, sound the alarm using the
piezospeaker.
You can use a handheld remote for just about any piece of equipment to generate IR
interference. TVs, VCRs, CD/DVD players, and projectors all use the same type of IR detectors
you have on your BOE Shield-Bot right now. So, the remotes you use to control these devices all
use the same kind of IR LED that’s on your BOE Shield-Bot to transmit messages to your TV, VCR,
CD/DVD player, etc. All you’ll have to do to generate IR interference is point the remote at your
BOE Shield-Bot and repeatedly press/release one of the remote’s buttons.
Example Sketch IrInterferenceSniffer
With this sketch, your BOE Shield-Bot should play a tone, turn on its indicator LEDs, and
display a warning in the Serial Monitor any time it detects infrared. Again, since it’s not
transmitting any IR, it means the 38 kHz infrared has to be coming from an outside source.
Create, save, and run the sketch IrInterferenceSniffer.
Test to make sure the BOE Shield-Bot sounds the alarm when it detects IR
interference. If you are in a classroom, you can do this with a separate BOE
Shield-Bot that’s running TestBothIrAndIndicators. Just point its IR LEDs into the
IrInterferenceSniffer bot’s IR receivers. If you don’t have a second BOE Shield-
Bot, just use a handheld remote for a TV, VCR, CD/DVD player, or projector.
Simply point the remote at the BOE Shield-Bot and repeatedly press and release