Arduino ® Code
A Hall sensor module can be used to calculation the speed of opject.
Use Hall Effect Sensor - US1881.
For application and instrcution please search the Arduini official website.