28015 规格书

P/‘PAL; X E Start Pu‘se _n_ a e J—L Echo Twme Pu‘se www auax com
Web Site: www.parallax.com
Forums: forums.parallax.com
Sales: sales@parallax.com
Technical: support@parallax.com
Office: (916) 624-8333
Fax: (916) 624-8003
Sales: (888) 512-1024
Tech Support: (888) 997-8267
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 1 of 9
PING))) Ultrasonic Distance Sensor (#28015)
The Parallax PING)))™ ultrasonic distance sensor provides precise, non-contact distance measurements
from about 2 cm (0.8 inches) to 3 meters (3.3 yards). It is very easy to connect to microcontrollers such
as the BASIC Stamp®, Propeller chip, or Arduino, requiring only one I/O pin.
The PING))) sensor works by transmitting an ultrasonic (well above human hearing range) burst and
providing an output pulse that corresponds to the time required for the burst echo to return to the
sensor. By measuring the echo pulse width, the distance to target can easily be calculated.
Features
Range: 2 cm to 3 m (0.8 in to 3.3 yd)
Burst indicator LED shows sensor
activity
Bidirectional TTL pulse interface on a
single I/O pin can communicate with 5 V
TTL or 3.3 V CMOS microcontrollers
Input trigger: positive TTL pulse, 2 µs
min, 5 µs typ.
Echo pulse: positive TTL pulse, 115 µs
minimum to 18.5 ms maximum.
RoHS Compliant
Key Specifications
Supply voltage: +5 VDC
Supply current: 30 mA typ; 35 mA max
Communication: Positive TTL pulse
Package: 3-pin SIP, 0.1” spacing
(ground, power, signal)
Operating temperature: 0 – 70° C.
Size: 22 mm H x 46 mm W x 16 mm D
(0.84 in x 1.8 in x 0.6 in)
Weight: 9 g (0.32 oz)
Pin Definitions
GND Ground (Vss)
5 V 5 VDC (Vdd)
SIG Signal (I/O pin)
The PING))) sensor has a male 3-pin header used to supply
ground, power (+5 VDC) and signal. The header may be plugged
into a directly into solderless breadboard, or into a standard 3-
wire extension cable (Parallax part #800-00120).
<— 18"(457mm)="" —=""> E ‘25“ 4— 164“(417mm) <— 17‘(43="" 2mm)="" —="">1 mm“) |‘_ 64‘ (16 3mm) 6“ WWW Davallax 00m 74" (21 3mm) (‘8 8mm) (15 3mm) 0 ©2005 - . ¢ + P f 7 (2 5mm) —>1 [4— ->| l4— 1"(2 5mm) f km 7» + Mm (Homer; 5v SIG pin Sonar TX
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 2 of 9
Dimensions
Communication Protocol
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.
Host Device Input Trigger Pulse tOUT 2 µs (min), 5 µs typical
PING)))
Sensor Echo Holdoff tHOLDOFF 750 µs
Burst Frequency tBURST 200 µs @ 40 kHz
Echo Return Pulse Minimum tIN-MIN 115 µs
Echo Return Pulse Maximum tIN-MAX 18.5 ms
Delay before next measurement 200 µs
omen «45" too sman (ApprOX) k— >3.3m —>
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 3 of 9
Practical Considerations for Use
Object Positioning
The PING))) sensor cannot accurately measure the distance to an object that: a) is more than 3 meters
away, b) that has its reflective surface at a shallow angle so that sound will not be reflected back towards
the sensor, or c) is too small to reflect enough sound back to the sensor. In addition, if your PING)))
sensor is mounted low on your device, you may detect sound reflecting off of the floor.
a. b. c.
Target Object Material
In addition, objects that absorb sound or have a soft or irregular surface, such as a stuffed animal, may
not reflect enough sound to be detected accurately. The PING))) sensor will detect the surface of water,
however it is not rated for outdoor use or continual use in a wet environment. Condensation on its
transducers may affect performance and lifespan of the device.
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:

m/sT0.6331.5C Cair
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 (as is the case in the example BS2 program given in the Example Programs section below).
Percent error and conversion constant calculations are introduced in Chapter 2 of
Smart Sensors and
Applications
, a Stamps in Class text available for download from the 28029 product page at
www.parallax.com.
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 4 of 9
Test Data
The test data on the following pages is based on the PING))) sensor, tested in the Parallax lab, while
connected to a BASIC Stamp microcontroller module. The test surface was a linoleum floor, so the
sensor was elevated to minimize floor reflections in the data. All tests were conducted at room
temperature, indoors, in a protected environment. The target was always centered at the same elevation
as the PING))) sensor.
Test 1
Sensor Elevation: 40 in. (101.6 cm)
Target: 3.5 in. (8.9 cm) diameter cylinder, 4 ft. (121.9 cm) tall – vertical orientation
10° 20° 30" 40“ 50° 60" 70" so“ 90" 10' 10° 20° 30“ 40" 50° 60° 70° 50“ 90° 10‘ V?“
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 5 of 9
Test 2
Sensor Elevation: 40 in. (101.6 cm)
Target: 12 in. x 12 in. (30.5 cm x 30.5 cm) cardboard, mounted on 1 in. (2.5 cm) pole
Target positioned parallel to backplane of sensor
zams W wwwpayanaxmm O Extension Cable and Port Cautions for the Board of Education 1514 Vdd 1312
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 6 of 9
Example Programs
BASIC Stamp 2
This circuit allows you to quickly connect your PING))) sensor to a BASIC Stamp® 2 via the Board of
Education® breadboard area. The PING))) module’s GND pin connects to Vss, the 5 V pin connects to
Vdd, and the SIG pin connects to I/O pin P15. This circuit will work with the example BASIC Stamp
program listed below.
Extension Cable and Port Cautions for the Board of Education
If you are connecting your PING))) sensor to a Board of Education platform using an extension cable,
follow these steps:
1. When plugging the cable onto the PING))) sensor, connect Black to GND, Red to 5 V, and White
to SIG.
2. Check to see if your Board of Education servo ports have a jumper, as shown at right.
3. If your Board of Education servo ports have a jumper, set it to Vdd as shown. Then plug the
cable into the port, matching the wire color to the labels next to the port.
4. If your Board of Education servo ports do not have a jumper, do not use them with the
PING))) sensor. These ports only provide Vin, not Vdd, and this may damage your PING)))
sensor. Go to the next step.
5. Connect the cable directly to the breadboard with a 3-pin header as shown above. Then, use
jumper wires to connect Black to Vss, Red to Vdd, and White to I/O pin P15.
Board of Education Servo Port Jumper, Set to Vdd
Example Program. P gMeasureCmAndl n.bsz th BASIC Stamp Debug Termina‘. The example program p www.9aral‘ax.com. The BASIC Stamp Edwtor softw f ad from www.gara‘\ax.com[baswcstampsoftware
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 7 of 9
Example Program: PingMeasureCmAndIn.bs2
This program for the BASIC Stamp 2 displays distance measurements in both inches and centimeters in
the BASIC Stamp Debug Terminal. The example program can be downloaded from the 28015 product
page at www.parallax.com. The BASIC Stamp Editor software, which includes the Debug Terminal, is a
free download from www.parallax.com/basicstampsoftware.
' Smart Sensors and Applications - PingMeasureCmAndIn.bs2
' Measure distance with Ping))) sensor and display in both in & cm
' {$STAMP BS2}
' {$PBASIC 2.5}
' Conversion constants for room temperature measurements.
CmConstant CON 2260
InConstant CON 890
cmDistance VAR Word
inDistance VAR Word
time VAR Word
DO
PULSOUT 15, 5
PULSIN 15, 1, time
cmDistance = cmConstant ** time
inDistance = inConstant ** time
DEBUG HOME, DEC3 cmDistance, " cm"
DEBUG CR, DEC3 inDistance, " in"
PAUSE 100
LOOP
vtv$tv$vv$vv$vt$vt$vv$tv$vvivvivvivt$vt ' Huthori Ehrls Savage & Jeff Martln ' vtv$tv$vv$vv$vt$vt$vv$tv$vvivvivvivt$vt uans of Klme or distance. Each method requlres one parameter, Pin, that 15 the 1/0 pin that r44‘44‘44‘44‘44‘44‘1 |\ I | PINGJJ) | I \I Remember PING))) Requires L44‘44r44‘r4‘4r‘44‘J v1‘1 - Updated @3/2fl/2flfl7 to change SIG reslstor from lflK to 1K DUN diraEPln]~~ ' Make Pin Uutput diraEPln]~ ' Make I/U Pin Input waltpqufl, |< pin,="" e)="" '="" wait="" for="" pin="" to="" go="" loh="" microseconds="" ::="" (iikcntl="" -="" cntz)="" (clkfreq="" liflflfliflflfl))="">> 1 ' Return Time 1n us "Measure object distance 1n 1nches
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 8 of 9
Propeller Microcontroller
{{
***************************************
* Ping))) Object V1.1 *
* (C) 2006 Parallax, Inc. *
* Author: Chris Savage & Jeff Martin *
* Started: 05-08-2006 *
***************************************
Interface to Ping))) sensor and measure its ultrasonic travel time. Measurements can be in
units of time or distance. Each method requires one parameter, Pin, that is the I/O pin that
is connected to the Ping)))'s signal line.
┌───────────────────
│┌───┐ ┌───┐│ Connection To Propeller
││ PING))) ││ Remember PING))) Requires
│└───┘ └───┘│ +5V Power Supply
GND +5V SIG
└─────┬───┬───┬─────
│ 1K
└┘ └ Pin
--------------------------REVISION HISTORY--------------------------
v1.1 - Updated 03/20/2007 to change SIG resistor from 10K to 1K
}}
CON
TO_IN = 73_746 ' Inches
TO_CM = 29_034 ' Centimeters
PUB Ticks(Pin) : Microseconds | cnt1, cnt2
''Return Ping)))'s one-way ultrasonic travel time in microseconds
outa[Pin]~ ' Clear I/O Pin
dira[Pin]~~ ' Make Pin Output
outa[Pin]~~ ' Set I/O Pin
outa[Pin]~ ' Clear I/O Pin (> 2 μs pulse)
dira[Pin]~ ' Make I/O Pin Input
waitpne(0, |< Pin, 0) ' Wait For Pin To Go HIGH
cnt1 := cnt ' Store Current Counter Value
waitpeq(0, |< Pin, 0) ' Wait For Pin To Go LOW
cnt2 := cnt ' Store New Counter Value
Microseconds := (||(cnt1 - cnt2) / (clkfreq / 1_000_000)) >> 1 ' Return Time in μs
PUB Inches(Pin) : Distance
''Measure object distance in inches
Distance := Ticks(Pin) * 1_000 / TO_IN ' Distance In Inches
PUB Centimeters(Pin) : Distance
''Measure object distance in centimeters
Distance := Millimeters(Pin) / 10 ' Distance In Centimeters
PUB Millimeters(Pin) : Distance
''Measure object distance in millimeters
Distance := Ticks(Pin) * 10_000 / TO_CM ' Distance In Millimeters
object is used in an example p asurements. The complete http [lobex parallax com. www paralla comlgrogellertool ds and links to VldeO www garallax om
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 9 of 9
The ping.spin object is used in an example project with the Parallax 4 x 20 Serial LCD (#27979) to
display distance measurements. The complete Project Archive can be downloaded from the Propeller
Object Exchange at http://obex.parallax.com. The Propeller Tool software can be downloaded from
www.parallax.com/propellertool.
───────────────────────────────────────
Parallax Propeller Chip Project Archive
───────────────────────────────────────
Project : "ping_demo"
Archived : Tuesday, December 18, 2007 at 3:29:46 PM
Tool : Propeller Tool version 1.05.8
ping_demo.spin
├──Debug_Lcd.spin
├──Serial_Lcd.spin
└──Simple_Serial.spin
└──Simple_Numbers.spin
└──ping.spin
Reources and Downloads
For additional example code downloads and links to videos, tutorials and robotics projects that use the
Ping))) Ultrasonic Distance Sensor, visit www.parallax.com and search “28015.”
Product Change Notice
Rev A: original release
Rev B: resonator added to the SX-28 co-processor circuit. No changes to functionality
Rev C: SX-28 co-processor changed to PIC16F57. No changes to functionality.
Revision History
Version 2.0: Added revision history. Removed Javelin Stamp examples. Added URLs for programming
software. Added Product Change Notice section with PCB revision information.