Microcontroller › 8051 › how to interface parallax ultrasonic distance sensor with ats89c51…. › the ping sensor is one of the
the ping sensor is one of the simplest means of measuring distance.
if you go through the datasheet you’ll find out that you need to just make the trig pin of it high for 10us. Then basically you need to read the echo pin until it goes low. This gives you the time. use the formula– time/58 to get the distance in cm.
hope this helps