NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.7

Assume, V - stands for average speed (velocity), T - stands for traveling time and D - stands for traveled distance.

Average Speed can be calculated by using the formula: V = D/T
Traveled distance can be calculated as: D = V*T
Traveling time can be calculated using: T = D/V

You may want to start a thread in the programming questions area for your project. Below, is some help to get you started.
You have a sensor that can provide distance information. This is your "D" variable.

You can use millis() or micros() to measure your time between distance checks. This is your "T" variable. FirstMillis() - SecondMillis() = time between distance checks.

V = D/T......."V" velocity, = "D" distance / "T" time.

Before you ask more questions, you need to read this thread so that you will get the best help possible. http://arduino.cc/forum/index.php/topic,97455.0.html

Good luck, your project is easily possible but, you need to put in some time to make it happen.