In this Raspberry Pi tutorial, we're going to introduce a new sensor, the HC-SR04 ultrasonic distance sensor, along with handling GPIO input. The HC-SR04 distance sensor measures distance based on emitting a sound burst, and timing how long it takes to receive the echo back. Using the known constant that is the speed of sound, we can mathmematically determine the distance of any object in front of this sensor by simply measuring how much time passed while the sound waves were emitted, hit the object in front of the sensor, bounced back, and came back to the sensor. Text-based version of this series: sentdex
Hide player controls
Hide resume playing