A new type of sensor for water contamination detection was designed by using capacitance with PI selective film for water molecules and double spiral lines with continuously curvature.The basic principle of new type of sensor was analyzed,and its mathematic model was established.Its composing and software algorithm flow were introduced.The test results show that this new type of sensor can be used in online detection of water in hydraulic oil continuously,and the detection precision of water content is high.This type of sensor has already been used successfully in real time state monitoring for hydraulic device,which provides references for active maintenance of large type of equipments.