Sensor
HC-SR04 Ultrasonic Distance Sensor
The HC-SR04 is an ultrasonic sensor that measures distance by sending out sound waves and timing how long they take to bounce back. It's widely used in beginner electronics projects for detecting objects and measuring distance without physical contact.
Difficulty
Beginner → Advanced
Category
Electronics
How it works
How this sensor works
The sensor has two parts: a transmitter and a receiver. The Trig pin sends out a short ultrasonic pulse (sound wave above human hearing range). This pulse travels through the air, hits an object, and bounces back to the Echo pin. By measuring the time between sending and receiving the pulse, and knowing the speed of sound, the sensor calculates the distance to the object.
Applications
Common use cases
Required
Components needed
Projects
Related projects
Build something with this sensor.
Measuring Distance with HC-SR04 on Raspberry Pi Pico
Learn how to use the HC-SR04 ultrasonic sensor to measure distance in centimeters using a Raspberry...
View projectMeasuring Distance with HC-SR04 on ESP32
Learn how to use the HC-SR04 ultrasonic sensor with an ESP32 to measure distance in centimeters. Thi...
View projectTutorials
Video tutorials
Watch, follow along, then build your own version.
Measuring Distance with HC-SR04 on Raspberry Pi Pico (Beginner Tutorial)
How do parking sensors measure a vehicle's distance from a wall? In this video,...
Measuring Distance with HC-SR04 on ESP32
How do parking sensors measure how far a car is from a wall? In this video, we'l...