It is well known that star sensor is an accurate attitude sensor in various real applications, which however has not been fully used to observe stars and the moon simultaneously. This paper investigates how the moon and stars can be observed by the star sensor, and how to process the images taken under different light conditions to extract information to determine attitude and location of the observer. Experiments are conducted to show that the star sensor can be efficiently applied as an integrated celestial sensor, providing economical, reliable and autonomous benefits to the missions conducted on the earth, in the air, on other planets and so on.