Abrupt and random change of flow and distribution of particles are two main factors of poor test precision when detecting hydraulic oil contamination under complex environment.A new type of sensor was designed by using the FARIMA model and random processes spectrum analysis method,which could realize the recognition and compensation of flow information and change of the distribution about particles in oil.The test result proves that the designed sensor can get better repeatability precision.This new type of sensor has already been used for in-line contamination detection in many hydraulic devices.