Existing methods of improving measurement accuracy, such as polynomial fitting and increasing pixel numbers, cannot guarantee high precision and good miniaturization specifications of a microsun sensor at the same time. Therefore, a novel integrated and accurate error compensation method is proposed. A mathematical error model is established according to the analysis results of all the contributing factors, and the model parameters are calculated through multi-sets simultaneous calibration. The numerical simulation results prove that the calibration method is unaffected by installation errors introduced by the calibration process, and is capable of separating the sensor's intrinsic and extrinsic parameters precisely, and obtaining accurate and robust intrinsic parameters. In laboratorial calibration, the calibration data are generated by using a two-axis rotation table and a sun simulator. The experimental results show that owing to the proposed error compensation method, the sun sensor's measurement accuracy is improved by 30 times throughout its field of view (±60° × ±60°), with a RMS error of 0.1°.