Ultrasonic sensor working principle | How does HC-SR04 Work

preview_player
Показать описание
Ultrasonic sensor or ultrasound sensor is one of the most used sensor in various projects.It is generally used to find the range/distance of objects.The HC-SR 04 is one of the commonly used ultrasonic sensor.This sensor produces a ultrasound which is reflected back if an object is present in front of it.Then this reflected sound is detected by the receiver of the sensor .The distance is calculated by calculating the time travelled by the sound and velocity of sound.Watch the animation in the video.
Thank you for watching the video.

Watch more:

How to test a Capacitor Without a Multimeter

555 timer basics

water level indicator working principle

IR proximity sensor working principle

how to use potentiometer as variable resistor and voltage divider

rf module working | rf transmitter and receiver tutorial

what is PIR motion sensor /detector | Passive infrared motion sensor basic

Ultrasonic sensor working principle | How does HC-SR04 Work
Рекомендации по теме
Комментарии
Автор

// Define the pins for the ultrasonic sensor
const int trigPin = 9;
const int echoPin = 10;

// Define the pin for the servo motor that makes the dinosaur jump
const int servoPin = 6;

// Include the Servo library
#include <Servo.h>

// Create a Servo object
Servo myServo;

void setup() {
// Initialize the ultrasonic sensor pins
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);

// Attach the servo motor to its pin
myServo.attach(servoPin);
}

void loop() {
// Measure the distance to the nearest obstacle
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration / 2) / 29.1; // Convert to distance

// If an obstacle is detected within 20 cm, make the dinosaur jump
if (distance < 20) {
// Make the dinosaur jump by moving the servo motor
myServo.write(90); // Adjust this angle as needed for the jump
delay(500); // Adjust the delay as needed for the jump duration
myServo.write(0); // Return to the original position
}

delay(100); // Wait before the next loop iteration
}

rayapudihindusri
Автор

What guarantees that the sound will be coming back? If the sensor is not perpendicular to the surface checked for instance?

plouf
Автор

How to purchase the this material can you send the link

chelladeepa
Автор

My objective is to test ultrasound generator like mosquito or rodant repellent.

ashoksafaya
Автор

Is ultrasonic sensor sound is harmful?

pvsreenath
Автор

Hi! nice work. Can you help me with some similar circuit?

mrzloopa
Автор

Does the Zino 2 drone use this module?

Northstar-Media