Acrob015
Zo stránky SensorWiki
Ultrasonic sensor for distance measurement
In following application we will use the Parallax PING))) Ultrasonic sensor.
- PING)))™ Documentation v1.6 (.pdf)
Features:
- Provides precise, non-contact distance measurements within a 2 cm to 3 m range
- Simple pulse in/pulse out communication
- Burst indicator LED shows measurement in progress
- 20 mA power cosumption
- Narrow acceptance angle
Key Specifications:
- Power requirements: +5 VDC
- Communication:Positive TTL pulse
- Dimensions: 22 x 46 x 16 mm
- Operating temp range: 0 to +70 °C
Principle of operation
The Ping sensor measures distance using sonar; an ultrasonic (well above human hearing) pulse is transmitted from the unit and distance-to-target is determined by measuring the time required for the echo return. Output from the PING))) sensor is a variable-width pulse that corresponds to the distance to the target.
The PING))) sensor detects objects by emitting a short ultrasonic burst and then "listening" for the echo. Under control of a host microcontroller (trigger pulse), the sensor emits a short 40 kHz (ultrasonic) burst. This burst travels through the air, hits an object and then bounces back to the sensor. The PING))) sensor provides an output pulse to the host that will terminate when the echo is detected, hence the width of this pulse corresponds to the distance to the target.
Interfacing to the microcontrollers is a snap: a single (shared) I/O pin is use to trigger the Ping sensor and "listen" for the echo return pulse. An onboard three-pin header allows the PING))) to be plugged into a solderless breadboard (on an Acrob, for example), and to be connected to its host through a standard three-pin servo extension cable.
Example program
- include <stdio.h>
Air Temperature
Temperature has an effect on the speed of sound in air that is measurable by the PING))) sensor. If the
temperature (°C) is known, the formula is:
Cair = 331.5 +(0.6× TC)m/s
The percent error over the sensor’s operating range of 0 to 70 ° C is significant, in the magnitude of 11
to 12 percent. The use of conversion constants to account for air temperature may be incorporated into
your program