Activity 5: Introduction to the Ultrasonic Sensor
Introduction
For the final getting started activity, you will finish up your exploration of sensors
by creating a sketch using the Ultrasonic Sensor. In this activity, you will connect
an Ultrasonic Sensor to digital sensor port D3 and display the distance to an object
you place in front of it using the serial monitor window.
Like all sensors, the Ultrasonic Sensor enables us to gather information. The
Ultrasonic Sensor gathers information to communicate distance. The sensor works
by sending a sonic pulse burst and then waiting on its return as it is reflected off an
object in range. The reflected sonic pulse time period is measured to determine the
distance to the object. The sensor has a measuring range of approximately 3-400
centimeters.
Figure 42
Open the Program
Before you open your next example sketch, be sure to save any sketch you want
to reference later. Let’s start by looking at the example sketch. Open the sketch by
selecting Examples > GS_Activity_5. A new sketch window will open titled GS_
Activity_5 (Figure 42).
Parts Needed
1x
6 V NiMH Battery
Pack 40235
1x
TETRIX® PULSE™
Controller 44268
1x
3-Foot Type A-B USB
Cable 40967
1x
Computer
1x
Ultrasonic Sensor
Pack 43055
Getting Started Activities 41