EGR 1301Lab 4
EGR 1301: Introduction to Engineering
Lab 4: Whiskers and Roach-Bot 1.0
Objective
This laboratory exercise will introduce students to how a robot interacts with its environment. This will be accomplished by the use of two types of sensors: tactile whiskers and light sensitive photoresistors.
Introduction
Tactile Navigation with Whiskers
Many types of robotic machinery rely on a variety of tactile switches. For example, a tactile switch may detect when a robotic arm has encountered an object. The robot can be programmed to pick up the object and place it elsewhere. Factories use tactile switches to count objects on a production line, and also for aligning objects during industrial processes. In all these instances, the switches provide inputs that dictate some other form of programmed output. The inputs are electronically monitored by the product, be it a robot, or a calculator, or a production line. Based on the state of the switches, the robot arm grabs an object, or the calculator display updates, or the factory production line reacts with motors or servos to guide products. In this chapter, you will build tactile switches, called whiskers, onto your Boe-Bot and test them. You will then program the Boe-Bot to monitor the state of these switches, and to decide what to do when it encounters an obstacle. The end result will be autonomous navigation by touch.
Light Sensitive Navigation with Photoresistors
Another type of sensor is a light detector. There are many different kinds, two of which are included in your Boe-Bot kit – one for detecting visible light (photoresistor) and one for detecting infrared light (IR detector). In this lab, you will program your Boe-Bot to detect light using the photoresistor and a capacitor. You can think of a capacitor like a small rechargeable battery. In other words, it can store a small amount of energy. A resistor and capacitor can be connected in parallel to form what called an RC (resistor-capacitor) circuit. Because a capacitor can store energy, an RC circuit has a charge/discharge time associated with it. We can talk about this time via a quantity called the time constant. We denote the time constant with the greek letter tau (τ) and calculate it as τ = RC, where R is the resistance (in ohms) and C is the capacitance (in farads). You can see in the figure below that the value of your capacitor is 0.01 µF or 1x10-8 F. The value of R in the circuit below is variable, that is, it depends on the amount of light shining on the photoresistor. More light = less resistance = shorter (smaller) time constant. Less light = more resistance = longer (larger) time constant.
Building the Circuits
Pay careful attention to how you place and wire the components on your breadboard. Incorrect connectionswill cause issues when programming the Boe-Bot.
Procedure
Whiskers
- Grab your Robotics with the Boe-Bot user manual and open it to page 165 and read the introduction, thenbuild the whiskers circuit on your Boe-Bot’s breadboard and follow the manual’s instructions for testing the whisker connections.
- Add the LED’s to your whisker circuit and test. These LED’s will allow visual debugging when the Boe-Bot is not connected to the terminal to aid in checking the programming in later steps.
- Read pages 177-187 of the Boe-Bot manual and program the Bot to navigate using the tactile whiskers. Include the “artificial intelligence” coding that will aid in escaping tight corners. Adjust subroutines and create your own movement subroutines to fine tune your Boe-Bot’s navigation abilities.
Note: Subroutines are blocks of code which you can jump to, execute, and then return from (returning back to the code (the Main Routine) that “called” the subroutine).
Note: Save all of your programs as you work through each exercise. You will need to be able to reference and use pieces of them later to complete this lab.
RC Circuit for Photosensitive Navigation
- Open the manual to page 193 and read about the photoresistor. Read through page 204 to gain further understanding on how the photoresistor will aid the Boe-Bot with navigation based on luminescent conditions.
- Read and perform Activity #4: Getting more information from your photoresistors.
Note: Building the circuit required for this lab means that you will have to move the circuit components around from their displayed positions on page 207 to the circuit layout seen above in order to get all the components on the Breadboard.
- Next, read and perform Activity #5: Flashlight Beam following Boe-Bot.
Use this table to record your RC time measurements. Averaging multiple measurements is helpful to achieve the best average RC time measurements.
- Adjust your coding to understand how it will affect your Boe-Bots performance.
Creating the Roach-Bot
- Both the Whisker tactile switches and the RC photosensitive circuits should be connected to the Boe-Bot’s breadboard.
- Write the program for the whisker navigation and test the code to refine your Boe-Bots movements. Save this program.
- Write a SEPARATE program that has your Boe-Bot moving around until light is placed over the photo-resistors. When light is on the photo-resistors your Boe-Bot should back away from the light source. Modifiy the Flashlight beam following Boe-Bot code from the manual to accomplish this task.
- Utilize subroutines when you write your code.
- Also include a “Start-Up Sequence” using the piezospeaker. (The optimal range is 2kHz – 3kHz)
- It should be noted that in order to complete this lab’s evaluation portion the Boe-Bot must be able to move normally even when light is not aimed at the photoresistors. In other words, your Boe-Bot should always be moving.
- It should be noted that these two separate programs could be integrated into a single program. Should you combine the programs successfully, EXTRA CREDIT will be given.
Evaluation
- Show your final program coding to the TA. It should be concise and structured as seen on page 215 of the Boe-Bot manual. Comments should be including that explain the code.
- Your “Start-Up Sequence” must play whenever the Boe-Bot is turned on or reset.
- Your Boe-Bot will need to be able to escape a simulated corner situation.
- The corner will be a 15” x 30” rectangle with one open end.
- The Boe-Bot will be started at the open end and must then be able to escape.
- The LED’s must correctly show which whisker was bumped, including both at the same time.
- Your Boe-Bot must move away from a flashlight beam aimed at your Boe-Bot repeatedly.
Questions
- What is a photoresistor?
- What is a capacitor?
- How does the resistance of the photoresistor change according to the light that shines on it? Why?
10/19/2018 1:12 PMPage 1 of 4