Parallax PING))) ranger
Parallax’s three-pin ranger: one SIG pin triggers and echoes, 2 cm to 3 m, for the Arduino IDE’s own Ping example.
- 3 pins
- 1 setting
- In 1 project

The Parallax PING))) ranger in brief
What it is, and every setting the properties panel gives it.
The PING))) is Parallax’s ultrasonic distance sensor, #28015: the same pair of 40 kHz cans as the HC-SR04 and a burst LED, but only three pins, GND, 5V and SIG. One wire does both jobs. The board drives SIG high for 2 to 5 microseconds, switches the pin to an input, and 750 microseconds later the sensor drives SIG high for as long as the sound took to reach the wall and come back, from 115 microseconds at about 2 cm to 18.5 ms when nothing answers. Sound covers a centimeter and back in about 58 microseconds, so the Arduino IDE’s Ping example divides by 29 and by 2. The sensor runs from 5 V and reaches 3 meters. In Mokxi the distance is a slider and the air temperature a property, and the IDE’s example runs as it stands.
- Family
- Sensors
- Pins
- 3
- temperature
- 20
- the air in degrees Celsius, 20 by default. Sound travels at
331.3 + 0.606 Tmeters 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.
3 pins
Named as the editor names them, so a wire lands where you expect it.
How to use a Parallax PING))) with the Arduino Ping example
The PING))) has one signal pin where the HC-SR04 has two. GND goes to GND, 5V to 5 V and SIG to pin 7. The Arduino IDE’s example under File, Examples, 06.Sensors, Ping is written for exactly this wiring, and it runs here without a change.
Each pass of loop() sets pin 7 to an output, holds it low for 2 microseconds and high for 5, and drops it again: that is the trigger. Then it sets the pin to an input and calls pulseIn(pin, HIGH). The sensor waits 750 microseconds while its burst goes out, then holds SIG high until the echo returns.
The example turns that time into distance twice: microseconds / 74 / 2 for inches and / 29 / 2 for centimeters, a round trip at about 340 meters a second. Press Run and it prints 39in, 100cm for the wall the slider starts at, a meter away. Drag the slider and the numbers follow; past 3 meters the sensor gives up and sends its longest pulse, 18.5 ms, which prints as 318 cm.
The one mistake this sensor invites is forgetting the pinMode(pin, INPUT). Leave the pin an output and the board fights the sensor’s echo, so pulseIn never sees it rise. NewPing.h, given the same pin twice, and Ultrasonic.h’s one-pin constructor both do the switch for you.
The PING))) needs 5 V, but its documentation says its SIG pin talks to 3.3 V microcontrollers too. Power it from 5 V and use any GPIO for SIG.
Common Parallax PING))) ranger errors and fixes
Questions and answers
What is the difference between the PING))) and the HC-SR04?
They time an echo the same way, but the PING))) uses one SIG pin for the trigger and the echo, waits 750 us before the echo, and reaches 3 m. The HC-SR04 has separate TRIG and ECHO pins and reaches 4 m.
Why does the Ping example divide by 29 and by 2?
Sound takes about 29 microseconds to travel a centimeter, and the pulse is the time there and back, so the round trip is halved.
Can I use NewPing with a three-pin sensor?
Yes. Give NewPing the same pin for trigger and echo, as NewPing sonar(7, 7, 300), and it switches the pin between output and input itself.
What is true about the Parallax PING))) ranger, here
In its help article’s own words: what the simulation gets right, and where it stops.
Modeled
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.
Not modeled
- 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.
From Parallax PING))) ultrasonic sensor, in full.
See the Parallax PING))) ranger in a project
One built-in project uses it. It opens in the editor, already wired.
The boards it is shown on
This board has a built-in project with the Parallax PING))) ranger in it.
Arduino libraries for the Parallax PING))) ranger
Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.
Keep going
The rest of the bench
Every one of these is drawn and simulated the same way.
Wire up the Parallax PING))) ranger
Open the editor and push it into the breadboard. It is free, and it runs on your own machine.