Ultrasonic Distance Meter

Introduction

An Ultrasonic Distance Meter is an electronic device used to measure the distance between the sensor and an object without physical contact. It works by using ultrasonic sound waves and measuring the time taken for the echo to return after hitting an object.

This project is widely used in robotics, automation, and industrial applications.


Objective of the Project

  • To measure distance using ultrasonic waves.
  • To understand time-of-flight measurement.
  • To interface ultrasonic sensors with Arduino.
  • To display distance in real time.

Working Principle

The Ultrasonic Distance Meter works on the echo principle.

How It Works

  1. The ultrasonic sensor emits a high-frequency sound wave (40 kHz).
  2. The wave travels through air and hits an object.
  3. The wave reflects back to the sensor.
  4. Arduino measures the time delay between transmission and reception.
  5. Distance is calculated using the formula:

Distance=Time×Speed of Sound2\text{Distance} = \frac{\text{Time} \times \text{Speed of Sound}}{2}Distance=2Time×Speed of Sound​


Components Required

  • Arduino Uno
  • Ultrasonic Sensor (HC-SR04)
  • 16×2 LCD / Serial Monitor
  • Jumper Wires
  • Breadboard
  • 5V Power Supply

Circuit Diagram

HC-SR04 Connections

VCC  -> 5V
Trig -> D9
Echo -> D10
GND  -> GND

Arduino Code for Ultrasonic Distance Meter

#define trigPin 9
#define echoPin 10

long duration;
int distance;

void setup() {
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  Serial.begin(9600);
}

void loop() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);

  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);

  distance = duration * 0.034 / 2;

  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");

  delay(500);
}

Code Explanation

  • Trigger pin sends ultrasonic pulse.
  • Echo pin receives reflected signal.
  • Pulse duration is measured.
  • Distance is calculated and displayed.

Advantages

  • Non-contact measurement
  • High accuracy
  • Low power consumption
  • Easy to implement

Applications

  • Obstacle detection
  • Parking assistance systems
  • Robotics
  • Level measurement
  • Automation systems

Future Enhancements

  • LCD display integration
  • Wireless monitoring
  • IoT distance logging
  • Mobile app interface

Conclusion

The Ultrasonic Distance Meter is an efficient and reliable project that demonstrates real-time distance measurement using ultrasonic technology. It is an essential project for students learning embedded systems and robotics.

Leave a Reply

Shopping cart

0
image/svg+xml

No products in the cart.

Continue Shopping