This paper describes the research activity at the university of Naples concerning the design and prototype development of a low-cost APS-based miniature sun sensor for micro/nanosatellites applications. In the paper the sensor architecture is described, as well as the development of its prototype and of the facility for laboratory testing. Part of the project is also the development of a numerical code to simulate the sensor operation and predict the sensor performance. Numerical results show that an angular accuracy better than 1arcmin is achievable.