An aggregate 9-axis sensor composed of accelerometer, gyroscope, and magnetometer is embedded in most smartphone today. Applications such as 3D game/compass/gesture recognition, virtual reality, and seamless positioning require a 9-axis sensor fusion. The core of a 9-axis sensor fusion is a quaternion estimator. In this paper, we proposed an efficient quaternion estimator based upon EKF(Extended Kalman Filter) integrated with a motion detector and compared it with the conventional quaternion estimators. Simulation and postprocessing results show that the proposed quaternion estimator has the same performance as the conventional quaternion estimators.