Design and implementation is critically important for micro electro mechanical systems (MEMS) based devices, modules. As a typical instance, modern attitude and heading reference systems (AHRS) generally use Kalman Filter to integrate gyroscopes with some other augmenting sensors, such as accelerometers and magnetometers, so as to provide a long term stable orientation solution. While warpage of printed circuit board (PCB) induced by initial installation error or thermal deflection may result in non-orthogonality and misalignment of MEMS devices, similar to inner interaxis alignment error of multi-axis MEMS device, consequently output values of MEMS devices are unable to reflect the actual angular velocity, acceleration and magnetic field intensity, etc. These physical quantities obtained in the body frame cannot be transformed into the local level frame exactly, so that the accuracy of attitude and heading reference system cannot be guaranteed during the long time Kalman filtering process. This paper deals with the warpage of a micro AHRS composed of the low-cost inertial and magnetic sensors. Experimental results show that thermal cycling has a significant impact on the accuracy of AHRS. A warpage model of PCB based on thermomechanics is developed. Then the non-orthogonality and misalignment matrices induced by thermal deflection are obtained. A body/local level frame transformation matrix is used to study that mechanical parameters (orthogonalization and alignment parameters) are not independent of temperature and time during operation. The most important concern is that this accumulated error is unbounded in time. We analyze the interactions between MEMS device and its application to system so as to guarantee the accuracy of AHRS. Experiments and simulation results are consistent with what we envisage before.