Accelerometer sensor is applied to detect device directions