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

John Edgar Park

John Edgar Park

John Edgar Park likes to make things and tell people about it. He works at Disney Research and writes for Make and Boing Boing. He is training for American Ninja Warrior. You can find him at and twitter @johnedgarpark — if you like that sort of thing.

  • Chris Spurgeon

    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?

  • John Park

    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.

  • bigla25

    Do you have the code available for this project? This is really cool. Thanks!

    • John Park

      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.

  • Theron

    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?

    • John Park

      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.

  • Anonymous
  • Anonymous

    Is it possible to get a copy of this code?