AN597
Implementing Ultrasonic Ranging
THEORY OF OPERATION
Author:
Robert Schreiber
Logic Products Division
Ultrasonic ranging entails transmitting a sound wave
and measuring the time that it takes for the sound wave
to reflect off of an object and back to the origin. The
reflection time is proportional to the distance that the
object is from the source. In this implementation, the
sound wave is transmitted and received from the same
transducer. Therefore, a blanking interval is required
between signal transmission and reception to eliminate
false echoes (i.e., a transmitted signal being detected
as its own echo).
INTRODUCTION
Object ranging is essential in many types of systems.
One of the most popular ranging techniques is
ultrasonic ranging. Ultrasonic ranging is used in a wide
variety of applications including:
• Auto focus cameras
• Motion detection
• Robotics guidance
• Proximity sensing
• Object ranging
CIRCUIT CONFIGURATION
In this implementation, a PIC16C74 is connected to the
ranging module as shown in Figure 1. The RE0 and
RE1 I/O pins are configured as digital outputs and are
tied to INIT and BINH, respectively. The CCP1 pin is
configured as a digital input and is tied to ECHO
through a pull-up resistor. The pull-up resistor is
needed since the ECHO signal is an open-collector
output. The CCP1 pin is configured for capture mode
(CCP1CON). Figure 2 shows the timing relationship for
VDD and the three signal lines (INIT, BINH, and ECHO).
This application note describes a method of interfacing
PIC16CXX microcontrollers to the Polaroid 6500
Ranging Module.
This implementation uses a
minimum of microcontroller resources, a CCP module
and two I/O pins. The two major components of the
system are:
• Microcontroller
• Polaroid 6500 Ranging Module
Note: The ranging module requires 5.0 millisec-
The microcontroller performs the intelligence and
arithmetic functions for ultrasonic ranging, while the
Polaroid 6500 Ranging Module performs the ultrasonic
signal transmissions and echo detection.
onds to stabilize during power-up.
FIGURE 1: RANGING MODULE INTERFACE
BINH
RE1
RE0
TRANSMIT
INIT
ECHO
TRANSDUCER
CCP1
POLAROID 6500 RANGING MODULE
PIC16C74
1995 Microchip Technology Inc.
DS00597A-page 1