An experimental scheme for measuring 1iquid viscosity coe佑cient with smartphone magnetic sensor was proposed,so as to solve the problems of the photoelectric gate timing and falling ball method to measure liquid viscosity coemcient,such as calibration of photoelectric gate,must be take out the baU for multiple measurements,and just suitable for traIlsparent liquid.A spring oscillator is used to vibrate damping with time in the measured liquid,and the period of attenuated vibration is measured indirecdy by the phone magnetometer,so as to obtain the Viscosity coecient of the liquid.The resuIts showed that the relatiVe error of the viscosity coemcient of castor oil was 3.2%,which was equivalently to that of the falling ball method under the same experimental conditions.Compared with the fdling ball method,the proposed scheme has the advantages of simple operation and can measure the viscosity coemcient of opaque liquid.