Kerry Wong needed some ultrasonic range finders for a project so he build his own. He writes:
The theory behind ultrasonic ranging is quite simple. Typically a short ultrasonic burst is transmitted from the transmitter. When there is an object in the path of the ultrasonic pulse, some portion of the transmitted ultrasonic wave is reflected and the ultrasonic receiver can detect such echo.
He provides schematic and code on the link below.
A Sensitive DIY Ultrasonic Range Sensor – [Link]