Chapter 7 - Navigating with Infrared HeadlightsThe BOE-Bot can already use whiskers to get around, but it only detects obstacles when it bumps into them. Wouldn’t it be convenient if the BOE-Bot could just “see” objects and then decide what to do about them? Well, that’s what it can do with infrared headlights in this chapter. Each headlight is an infrared LED inside a tube that directs the light forward, just like a flashlight. Each eye is an infrared receiver that sends igh/low signals to indicate whether it detects the infrared LED’s light reflected off an object. You will program the robot and create an IR detection circuit for object detection and avoidance. The result will be autonomous navigation.
By the time you complete this section you will be able to:
- Understand what an infrared sensor is and how it is used.
- Explain what IR light is and why you can't see it.
- Build and Mount IR headlights on Boe-Bot
- Build an IR Object Detection Circuit with IR LEDs for the Boe-Bot
- Test the IR receivers and understand how the program communicates with the IR circuit.
- Test the IR object detector and debug any issues that arise
- Program the Boe-Bot to use the IR detection circuit for object detection
- Program the Boe-Bot for infrared interference
- Modify the Object Detection Circuit to adjust the range detection of the IR sensor
- Program the Boe-Bot to use the IR detection circuit for object avoidance
- Program the Boe-Bot to stop moving when a drop off is detected – to detect edges of a table
- View the videos and items in the Overview section below.
- Open the worksheet document and review the questions.
- Read and follow the instructions in Robotics with the Boe-Bot Chapter 7.
- Download Chapter 7 Basic Code.
- Complete the BOE Shield-Bot activities assigned by your instructor, following the step-by-step tutorials and videos in the Activities section below. If self-study, do all the "Your Turn" parts for each activity in the chapter. (Note: It is only by typing in the commands that you truly begin to understand programming. So don't short change yourself.)
- Review the Key Points or FAQs below.
- Answer the questions in the worksheet document.
- Complete the Programming Exercises at the end of the chapter and fill out the worksheet for them.
- Complete the Projects at the end of the chapter and fill out the worksheet for them.
- Check your answers. When complete, turn in the Worksheet Doc to your instructor (print, email or other method defined by your instructor). Self-study students can optionally send to a parent, mentor or friend.
Activity / Process
How is the Freqout command used?
The Freqout command varies the frequency of an output signal. For example it can be used to make a light brighter or dimmer by varying the light wave frequency, or it can be used to vary a tone on an audio frequency. A FREQOUT signal contains two sine wave components with two different frequencies. One component's frequency is Freq1. The second component's frequency 65536 – Freq1 (or the amount of time).
What does a high signal and a low signal mean from the IR detector?
The high signal means that there are no objects within the range of the IR detector. The lower the number returned in the signal, the closer an object is to the IR detector.
Advanced topic: Learn more about IR Detectors https://www.ladyada.net/learn/sensors/ir.html
What is an interference sniffer and why is it needed?
An interference sniffer is a routine that checks to see if a value returned is valid or possibly bad data outside of what is expected. It's needed to make sure the robot doesn't respond to false positives or data that is outside of the expected results. For Example, if IR is detected in an area where the Boe-Bot is not sending IR, then it could lead to false results. By using an interference sniffer, the robot can check to make sure the area in which it will be operating is free of bad data or stray signals.