Ultrasonic Range Finder

Learn about Sparki's Ultrasonic Range Finder


Lessons You Should Know

Sparki has an Ultrasonic Range Finder that measures distance with sound waves like a wireless sonic ruler.

Ultrasonic Identify

How It Works

This sensor finds objects with sound the same way a bat or dolphin does. One part of the sensor is a speaker that sends out a sound wave. The other part is a microphone that then measures how long it takes for the sound wave to come back. The longer it takes to come back, the further away the object:

Ultrasonic Bounce
Measure the time it takes for the sound to come back, and you can tell the distance. The speaker sends out the sound in a cone, so only objects within the cone will return sound and be detected. Objects in the center of the cone do best.

Ultrasonic Cone
This sensor is a simple ultrasonic rangefinder. It cannot detect individual objects. It can only tell you how long it took the sound sent out to return. It will measure the closest object.

Ojbects Same
If the object absorbs sound, or if there is nothing for a long distance, or if the object bounces the sound at an angle, there might not be enough sound returning to measure anything.

Ultasonic Fail

Using the Sensor

With the basic Sparki code in place, you can measure an infrared sensor by using this command:
This command returns the distance the sensor reads in centimeters in the form of a float. SparkiDuino already has code examples for you to use:
File > Examples->Ultrasonic_Range_Finder

Advanced Information



A 10uS high pulse on the Trigger pin initiates an 8 cycle burst of 40khz ultrasonic pulses. The pulses return to the module, and it emits on the Echo pin a high pulse between 150uS and 25ms. The distance can be calculated from the formulas above. They are derived from:

Test distance = (high level time * velocity of sound (340M/S) / 2.


  • Working Voltage: DC 5 V
  • Working Current: 15mA
  • Working Frequency: 40Hz
  • Max Range: 4m
  • Min Range: 2cm
  • Measuring Angle: 15 degree
  • Trigger Input Signal 10uS TTL pulse
  • Echo Output Signal Input TTL lever signal and the range in proportion
  • Dimensions: 45*20*15mm

Cone emissions pattern for this module: