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

  1. 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.
  2. 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.
  3. 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

  1. 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.
  2. 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.

  1. 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.

  1. Adjust your coding to understand how it will affect your Boe-Bots performance.

Creating the Roach-Bot

  1. Both the Whisker tactile switches and the RC photosensitive circuits should be connected to the Boe-Bot’s breadboard.
  2. Utilize your engineering intuition to combine the coding from Navigation with Whiskers and Flashlight beam following Boe-Bot to create one program, except instead of following the flashlight the Boe-Bot should avoid the light. Utilize subroutines when you write your code.
  3. Also include a “Start-Up Sequence” using the piezospeaker. (The optimal range is 2kHz – 3kHz)
  4. 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.

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 twice
  • 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

  1. What is a photoresistor?
  1. What is a capacitor?
  1. How does the resistance of the photoresistor change according to the light that shines on it? Why?


12/6/2018 3:30 AMPage 1 of 4