In the paper, an attitude and heading reference system based on MIMU/magnetometers with moderate accuracy is presented. To meet the requirements of the real-time measurement, a master/slave CPU structure is proposed in order to improve the data refresh rate effectively. In the algorithm part, an adaptive extended Kalman filter equation is applied in the system, where the filter equation uses three tilt angles of attitude and three bias errors for the gyroscopes as state vectors, the measurements of three accelerometers and magnetometers are used to drive the state update. When the system is in dynamic mode, the measured values of the accelerometers consist of the gravity vector and the dynamic accelerations, an adaptive extended Kalman filter tunes its gain automatically based on the system dynamics sensed by the accelerometers to yield optimal performance. The experiment result shows that the attitude and heading angle errors are within 0.2 deg and 0.5 deg respectively in stationary mode, and the result can reflect the attitude angles reasonably in dynamic mode.