Many insects such as desert ants, crickets, locusts, dung beetles, bees and monarch butterflies have been found to extract their navigation cues from the regular pattern of the linearly polarized skylight. These species are equipped with ommatidia in the dorsal rim area of their compound eyes, which are sensitive to the angle of polarization of the skylight. In the polarization-based robotic vision, most of the sensors used so far comprise high-definition CCD or CMOS cameras topped with linear polarizers. Here, we present a 2-pixel polarization-sensitive visual sensor, which was strongly inspired by the dorsal rim area of desert ants' compound eyes, designed to determine the direction of polarization of the skylight. The spectral sensitivity of this minimalistic sensor, which requires no lenses, is in the ultraviolet range. Five different methods of computing the direction of polarization were implemented and tested here. Our own methods, the extended and AntBot method, outperformed the other three, giving a mean angular error of only 0.62° ± 0.40° (median: 0.24°) and 0.69° ± 0.52° (median: 0.39°), respectively (mean ± standard deviation). The results obtained in outdoor field studies show that our celestial compass gives excellent results at a very low computational cost, which makes it highly suitable for autonomous outdoor navigation purposes.