Arduino Technology
Ultrasonic Arduino tape measure


I built this ultrasonic tape measure today using an Arduino Duemilanove, a PING))) sensor, and a 7-Segment Shield. I’ll post a video this week showing it in action.

I’ve got a project in the works that’ll require distance sensing and display. I wrote some code that samples the distance from the PING))) sensor to nearest object ten times, displays the average value in inches on the 7-Segment display, and calls that “normal”, turning the big RGB LED green. When objects move in front of it, the new values are displayed and the LED turns red or blue to correlate to closer or farther. In my upcoming project, victims who see the LED turn red will regret it!

Here’s a great post Marc de Vinck did on using the PING))) sensor with an Arduino.

In the Maker Shed:

PING))) sensor

7-Segment Shield

16 thoughts on “Ultrasonic Arduino tape measure

  1. Nice. I really love the PING ultrasound sensor…pretty inexpensive, easy to wire up, and I love how it looks like a face.

    Suppose you wanted to do something with a longer range…something in the 10 to 30 foot range? What would be a good sensor for that?

  2. Hey Chris, good question, I haven’t tested the maximum range on this one yet, but the data sheet says about 3 yards. For something much farther I’d consider going electro-mechanical and use a fishing reel and a optical rotary encoder.

    1. Yes, and thanks! I’ll clean up my code and make it available when I write up the project as a step-by-step tutorial. Not sure of the timing of that, but shouldn’t be too long.

  3. I’m a physics teacher, and this looks like an excellent project for having the kids build their own sonic rangers for gathering data on position, velocity, and acceleration. Does this setup have the capability to report an output to a computer and/or report a new data point at timed intervals?

    1. Hi Theron, that sounds great, you’d better do it and then tell us all about it!

      You can definitely get data from the Arduino over USB for logging and graphing the data, or even doing real-time visualization. Simplest way to view the data is through Serial.print statements sent to Arduino’s serial monitor. My current code samples distance every half second and prints to the 7-segment display and the serial monitor.

      For actual logging and more interesting displays, check out the Processing language. for more info, and here’s a good tutorial: . (Arduino sort of grew out Processing as the physical computing side of things.)

      You can add more sensors as your class’s needs grow, too, such as digital compasses, accelerometers, etc. One thing the 7-Segment shield has that I’m not using is a temperature sensor. I still haven’t figured out why they combined four 7-segments, one RGB LED, and a temp sensor! Maybe there was a kegerator project brewing?

      I look forward to hearing of your physics class’s progress with this, and please let us know if we can help with anything.

  4. John, This is exactly what I need to enable my wife to park close to the right hand door opening. Would enclose it in a weather proof container. Could you please send me the code you wrote to make this function?  This newbie would appreciate it. You load the dcode from a pc via usb or one of the usb varieties?

Comments are closed.

John Edgar Park likes to make things and tell people about it. He builds project for Adafruit Industries. You can find him at and twitter/IG @johnedgarpark

View more articles by John Edgar Park