Controlling UAV requires high-precision dynamic information input. However, mini UAV needs more demands because of the its small volume. Using MEMS sensor can make the UAV become high-precision, low power consumption and inexpensive machine. In this research, the core part is focusing on STM32F405, designing and implement the attitude and heading reference system (AHRS) based on 3-axis MEMS gyroscope, 3-axis MEMS accelerometer and magnetometer. Quaternion Kalman filter has been adopted in this study in order to achieve the attitude measurement and error control of transporter.