Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Ultrasonic US-015: Examples, Pinouts, and Specs

Image of Ultrasonic US-015Design with Ultrasonic US-015 in Cirkit Designer

Introduction

The Ultrasonic US-015 is a distance measuring sensor that uses ultrasonic waves to detect the distance to an object. It emits a sound wave and measures the time it takes for the echo to return, allowing it to calculate the distance based on the speed of sound. This sensor is widely used in robotics, automation, and obstacle detection systems due to its accuracy and ease of use.

Explore Projects Built with Ultrasonic US-015

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino Mega 2560 Bluetooth-Controlled Ultrasonic Distance Measurement: A project utilizing Ultrasonic US-015 in a practical application
Arduino Mega 2560 Bluetooth-Controlled Ultrasonic Distance Measurement

This circuit features an Arduino Mega 2560 microcontroller interfaced with an HC-05 Bluetooth Module and an HC-SR04 Ultrasonic Sensor. The HC-05 is powered by the Arduino's VIN pin and is grounded to the Arduino's GND, enabling wireless communication capabilities. The HC-SR04 is powered by the Arduino's 5V output and uses two digital PWM pins (D7 for TRIG and D6 for ECHO) to measure distances via ultrasonic waves.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

The Ultrasonic US-015 sensor has the following key technical specifications:

Parameter Value
Operating Voltage 5V DC
Operating Current ≤ 8 mA
Measuring Range 2 cm to 400 cm
Measuring Accuracy ± 0.3 cm
Operating Frequency 40 kHz
Trigger Input Signal 10 µs TTL pulse
Echo Output Signal TTL level signal proportional
Operating Temperature -10°C to 70°C
Dimensions 45 mm x 20 mm x 15 mm

Pin Configuration and Descriptions

The US-015 sensor has four pins, as described in the table below:

Pin Name Pin Number Description
VCC 1 Power supply pin (5V DC)
Trig 2 Trigger pin: Sends a 10 µs pulse to initiate
Echo 3 Echo pin: Outputs a pulse proportional to the
GND 4 Ground pin: Connect to the ground of the circuit

Usage Instructions

How to Use the Ultrasonic US-015 in a Circuit

  1. Power the Sensor: Connect the VCC pin to a 5V power supply and the GND pin to the ground.
  2. Trigger the Sensor: Send a 10 µs HIGH pulse to the Trig pin to initiate the measurement.
  3. Read the Echo: Measure the duration of the HIGH pulse on the Echo pin. This duration is proportional to the distance of the object.
  4. Calculate the Distance: Use the formula below to calculate the distance: [ \text{Distance (cm)} = \frac{\text{Pulse Duration (µs)}}{58} ] The factor 58 is derived from the speed of sound in air.

Important Considerations and Best Practices

Example Code for Arduino UNO

Below is an example code to interface the Ultrasonic US-015 with an Arduino UNO:

// Define pins for the Ultrasonic US-015 sensor
const int trigPin = 9; // Trigger pin connected to digital pin 9
const int echoPin = 10; // Echo pin connected to digital pin 10

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  
  // Set pin modes for the sensor
  pinMode(trigPin, OUTPUT); // Trig pin as output
  pinMode(echoPin, INPUT);  // Echo pin as input
}

void loop() {
  // Send a 10 µs HIGH pulse to the Trig pin
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  // Measure the duration of the HIGH pulse on the Echo pin
  long duration = pulseIn(echoPin, HIGH);

  // Calculate the distance in centimeters
  float distance = duration / 58.0;

  // Print the distance to the Serial Monitor
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");

  // Wait for a short period before the next measurement
  delay(100);
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings

    • Ensure the sensor is powered with a stable 5V DC supply.
    • Verify the connections to the Trig and Echo pins.
    • Check for loose or damaged wires.
  2. Unstable or Fluctuating Readings

    • Use a pull-down resistor on the Echo pin to stabilize the signal.
    • Ensure there are no ultrasonic noise sources nearby.
  3. Sensor Not Detecting Objects

    • Ensure the object is within the sensor's detection range (2 cm to 400 cm).
    • Verify that the object is not too small or has an irregular surface, as this may affect echo detection.

FAQs

Q: Can the US-015 detect transparent objects?
A: The sensor may have difficulty detecting transparent objects like glass, as they may not reflect ultrasonic waves effectively.

Q: What is the maximum detection angle of the US-015?
A: The sensor has a detection angle of approximately 15°.

Q: Can I use the US-015 with a 3.3V microcontroller?
A: The US-015 requires a 5V power supply. However, you can use a level shifter to interface it with a 3.3V microcontroller.

Q: How do I improve accuracy in measurements?
A: Use an average of multiple readings to reduce noise and improve accuracy.