This paper deals with design and prototype development of an Active Pixel Sensor -based miniature sun sensor and a laboratory facility for its indoor test and calibration. The miniature sun sensor is described and the laboratory test facility is presented in detail. The major focus of the paper is on tests and calibration of the sensor. Two different calibration functions have been adopted. They are based, respectively, on a geometrical model, which has required least-squares optimisation of system physical parameters estimates, and on neural networks. Calibration results are presented for the above solutions, showing that accuracy in the order of 0.01° has been achieved. Neural calibration functions have attained better performance thanks to their intrinsic auto-adaptive structure.