Intelligent intermediate flange which considerably simplifies the measurement of speed and sense of rotation