I don't know if you saw the example code using Basic Stamp, OOPIC, etc., but it is available. Also, the timing diagrams for connecting the device are all over the internet for your viewing.
By serial port, you mean through the serial port on a PC? How can it be mobile if this is the case?
You need to simply bring the input high for 10uS and low again. This will set the echo output high immediately, then when the ping is recieved, it will fall low again. A simple solution is to use an internal timer on a micro. Find how long it is for each increment, or prescale it internally to a desired value that will fit your counter. Then simply multiply this value by the speed of sound, then you have the distance!
As far as the algorithm, I am not familiar with it.
Steve