Introduction: Tutorial: How to Build Range Detector Using Arduino Uno and Ultrasonic Sensor


This tutorial shows how to make a simple range detector which able to measure the distance between ultrasonic sensor (US-015) and obstacle in front of it.

This US-015 ultrasonic sensor is your perfect sensor for distance measurement and object detection. It offers excellent range accuracy up to (1mm) and fairly stable readings at very low cost. It requires two digital I/O pins (an output pin and an input pin) to interface with it. Ultrasonic sensor is created based on the principle of echolocation used by animals like bats and dolphins. Since ultrasonic sensor uses sonar to determine the distance to an object, its operation is not affected by sunlight, spotlight and object's surface color which will affect the readings of any infrared distance sensors. However acoustically soft materials such as clothes can be difficult to detect.


  • Operating Voltage : DC 5V
  • Current : 2.2mA
  • PinOut : 4 PIN
  • SensingRange : 2 - 400cm
  • Sensing Angle : <15deg
  • Accuracy : 0.1cm+-5%
  • Advantages : Better accuracy than HCSR04
  • Size (mm): 45 (L) x 20 (W) x 16 (H)
  • Weight : 10 g

Step 1: Material Preparation

Step 2: Follow the Video

Step 3: Source Code: