PING))) Wiring & Example Code

The Ping))) Ultrasonic Distance Sensor measures the roundtrip echo time of ultrasonic sound to determine how far away an object is. It can measure distances anywhere from 3 centimeters to 3 meters. In addition to being a great distance sensor for robots, it’s also useful for detecting people passing through doorways, viewing art exhibits, approaching holiday props, and more.

Wiring & Connections

Parallax PING))) Ultrasonic Distance Sensor (left) and Parallax Laser PING (right).

ActivityBot Alert! Use a different I/O pin if your board is on a robot - a servo is connected to P15!

     A schematic for connecting the Parallax PING))) Ultrasonic Distance Sensor to a Propeller board.

A wiring diagram for connecting the Parallax Laser Ping to your breadboard.  A schematic showing how to connect the Parallax Laser PING to your board.

Use a 2 k-ohm resistor (red-black-red) between the PING))) sensor's SIG pin and the Propeller I/O pin. 

 

Quick Code Example

Using the connections shown in the wiring diagram above, this example will display PING))) distance measurements in the Terminal Window.

Quick-start BlocklyProp code for the PING))) Ultrasonic Distance Sensor.