Arduino Ultrasonic Distance Measurement with HC-SR04 Sensor
Автор: Teach Point
Загружено: 2025-11-05
Просмотров: 6
Описание:
How It Works? (Principle) :
The HC-SR04 uses the “echo” principle — similar to how bats navigate.
The Trigger pin sends an ultrasonic pulse (sound wave) at 40 kHz.
The pulse travels through the air until it hits an object.
The sound wave bounces back to the sensor.
The Echo pin receives the reflected signal.
The sensor measures the time duration between sending and receiving the pulse.
Using the speed of sound (≈ 343 m/s), it calculates the distance.
Formula for Distance :
Distance=(Time×Speed of Sound)/2
The division by 2 is because the sound travels to the object and back.
Pin Configuration :
VCC --- +5V Power Supply
TRIG --- Trigger Input – sends the ultrasonic pulse
ECHO --- Echo Output – receives the reflected signal
GND--- Ground
Typical Connections with Arduino (HC-SR04) :
VCC --- 5V
TRIG --- Digital Pin (e.g., 9)
ECHO--- Digital Pin (e.g., 10)
GND--- GND
Measuring Range :
Minimum distance: ~2 cm
Maximum distance: ~400 cm (4 meters)
Accuracy: ±3 mm (approximately)
Applications :
Obstacle avoidance (robots)
Distance measurement
Level detection (water tank)
Parking sensors
Smart automation systems
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: