Ultrasonic sensor is a sensor used to measure distance, can be used to help the car to avoid obstacles or other related distance obstacle avoidance projects.
The ultrasonic transmitter emits ultrasonic waves in a certain direction, at the same time the timer starts timing, ultrasonic waves spread in the air, on the way to encounter obstacles will immediately return, ultrasonic receiver received reflected waves immediately stop timing. The propagation speed of sound wave in the air is 340m/s.
Distance Calculation: According to the time t recorded by the timer, the distance s between the launching point and the obstacle can be calculated: s = 340 * t / 2.
Application reference: obstacle avoidance car, handheld range finder, water level monitoring, ultrasonic counter, etc.