Abstract. According to the requirement of small satellite, this paper designed a digital sun sensor which diaphragm is a V-shaped cross-section structure. Using Position Sensitive Detector (PSD) as the light detector, we designed the V-shaped cross-section structure based on the pinhole imaging principle. The sun sensor realized the accurate calculation for two axis sun angle of the sun sensor. The mechanical test, thermal test and testing of the sun sensor are designed and carried out. The mechanical test and thermal test results verify the stability of the sun sensor. Testing result shows that the detection angle can reach (120°)×(120°), and the attitude determination accuracy is better than 6" in the entire viewing field. The mass, volume and power consumption of the sun sensor is 0.177 kg, 78 mm×77 mm×21 mm and 0.25 W. The sun sensor has low power consumption, large viewing angle and high precision characteristics, which realized the sun sensor the miniaturization and meet the requirements of the micro satellite. Its performance has been verified in orbit.