Lab 7 - "Robot Sensing" Prelab




Part I - Understanding the Ultrasonic Sensor and Servo

Read the datasheets and answer the following numbered questions

Ultrasonic Sensor

  1. How fast does the signal pulse from the sensors travel in the air?

  2. For every 1 inch of distance away from the sensor, how long does it take for the sensor pulse to return to the sensor? For every 1 cm?

  3. What is the range and accuracy of the sensor?

  4. What is the minimum recommended delay cycle (in ms) for using the sensor? How does this compare to the "working frequency"?

    Going further (optional): Given the max "working frequency", does the maximum sensor range make sense? Hint: find the maximum unambiguous range.


  1. Fill out the following table identifying the pulse lengths needed for each servo position. Assume a 1 MHz clock (the actual clock frequency you use can be different).
Servo Position Pulse Length (ms) Pulse Length (counts)

Part II - Using the Ultrasonic Sensor and Servo

  1. Create psuedocode and/or flowchart showing how you will setup and use the ultrasonic sensor and servo.

  2. Create a schematic showing how you will setup the ultrasonic sensor and servo. A starter template is provided, but you may create your drawing in Fritzing or another program if desired.

  3. Include any other information from this lab you think will be useful in creating your program. Small snippets from datasheets such as the ultrasonic sensor timing may be good to include.

Below are some things you should think about as you design your interfaces: