Source: https://mokxi.com/parts/ping
Updated: 2026-11-17

Part

# 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.

See every part

- 3 pins
- 1 setting
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## 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 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.

Pins

## 3 pins

Named as the editor names them, so a wire lands where you expect it.

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.

How to use 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.

Part pin

Board pin

GND

GND

5V

5 V

SIG

Pin 7

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.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

Common errors

## Common Parallax PING))) ranger errors and fixes

What goes wrong

The fix

pulseIn() returns 0, or the distance never changes.

The pin was left an output after the trigger, so the echo cannot drive it. Call pinMode(pin, INPUT) right after the trigger, before pulseIn().

It always reads about 318 cm.

That is the 18.5 ms pulse the sensor sends when nothing comes back: the target is past 3 m or not facing the sensor.

It was wired like an HC-SR04 and nothing happens.

The PING))) has no TRIG and ECHO. One board pin goes to SIG and does both jobs.

Questions

## 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.

How it is modeled

## 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.

Projects

## See the Parallax PING))) ranger in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the Parallax PING))) ranger in it.

- Arduino Uno R3

Libraries

## 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.

- Ultrasonic
- NewPing

Keep going

## Keep going

- Ultrasonic ranger
- Waterproof ultrasonic, JSN-SR04T
- VL53L0X time-of-flight sensor

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## 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.

Start building free Open the editor
