This part has a page of its own, with a note on using it and a circuit to try: the part page.
The PING))) (Parallax #28015) has the HC-SR04's two transducer cans and a burst LED,
but only three pins: GND, 5V and SIG. The board drives SIG high for a few
microseconds, lets go of it, and the sensor answers on the same wire with a pulse as
long as the sound took there and back. The Arduino IDE's own Ping example
(File > Examples > 06.Sensors > Ping) is written for it and runs here unmodified.
Aliases: PING sensor, Parallax ultrasonic, three-pin ultrasonic sensor.
Pins
| Pin | What it does |
|---|---|
GND |
Ground. |
5V |
Supply, 5 V (4.5 V absolute minimum). |
SIG |
Both ways: a trigger in from the board, then the echo pulse out. |
Properties
temperature: the air in degrees Celsius, 20 by default. Sound travels at
331.3 + 0.606 T meters a second (the PING))) documentation gives the same formula),
so this sets the echo time per centimeter: 29.1 microseconds each way at 20 °C, the
figure the Arduino example rounds to 29.
The distance is not a property. It is set on the slider, 0 to 3.5 m.
While it runs
Drag the slider on the part to move the wall. Past 3 m the readout says "no echo".
What the model gets right
The documentation's timing table, line by line:
| What | Datasheet | Here |
|---|---|---|
| Trigger pulse | 2 us minimum, 5 us typical | A high of 2 us or more on SIG starts a measurement. |
| Echo holdoff | 750 us | SIG rises 750 us after the trigger falls. |
| Echo pulse | 115 us to 18.5 ms | The round trip, held to that window. |
| Delay before the next measurement | 200 us | SIG is driven low that long, then let go. |
Between measurements the sensor does not drive SIG at all: it is listening. During
the echo it drives the pin from its own 5 V, so the board must have switched the pin to
INPUT by then. With nothing in range the echo is the 18.5 ms maximum, which the
example prints as 318 cm. NewPing.h (one pin for both) and Ultrasonic.h (the one-pin
constructor) read it too.
What it does not model
- No sound is simulated: the slider is one number. The beam's cone, the floor echoes the documentation warns about, soft or angled targets and the reading-to-reading jitter of a real sensor are not modeled.
- Nearer than about 2 cm the echo is the 115 us minimum, whatever is there.
- The burst LED is drawn, not lit.
- There is no supply current.
Common mistakes
Leaving the pin an OUTPUT after the trigger. The echo then fights the board's own
output and pulseIn() never sees it rise. Call pinMode(pin, INPUT) right after the
trigger, as the example does.
Wiring it like an HC-SR04. It has no TRIG and ECHO: one board pin goes to SIG.
See it in action
The PING))) distance, the Arduino Ping example template runs the IDE's example on an Uno. Open it at /templates.